rigraph icon indicating copy to clipboard operation
rigraph copied to clipboard

add some explanation of aaa-auto.R generation in CONTRIBUTING.md

Open maelle opened this issue 2 years ago • 21 comments

Obviously asking for a friend :sweat_smile:

maelle avatar Mar 30 '23 11:03 maelle

Maybe a reference to https://github.com/igraph/rigraph/blob/main/src/README.md, and document there?

I agree the current docs are sparse.

krlmlr avatar Mar 30 '23 16:03 krlmlr

yes, pointing to external docs would be good.

Maybe with some sort of FAQ/guide: how to find whether the function you want to modify was generated automatically (it lives in aaa-auto.R) in particular.

maelle avatar Apr 11 '23 14:04 maelle

some inspiration for the contributing guide https://arrow.apache.org/docs/r/articles/index.html#developer-guides

maelle avatar Jun 05 '23 14:06 maelle

That's a great contributor's guide that would of course be nice to have. The bottleneck is the time required to write it. Another problem is that the infrastructure is in flux at the moment.

I'd suggest drafting a guide in the GitHub wiki. If you figure out something that wasn't properly documented, feel free to write it down there. Once we have something solid, it can be migrated to a public location like CONTRIBUTORS.md

It's easier to add to a wiki than a public location. The writing doesn't have to be perfect, you can first write and later ask if it's accurate, and generally make quicker progress.

szhorvat avatar Jun 05 '23 14:06 szhorvat

current status of my using the generation #850

maelle avatar Jun 16 '23 08:06 maelle

I use:

docker run --rm -ti --platform linux/amd64 -v $(pwd):/root/workspace ghcr.io/cynkra/rig-ubuntu-igraph:main make -f Makefile-cigraph

for full reproducibility. The only noisy things are lex and yacc, we could add version checks here too.

krlmlr avatar Dec 29 '23 21:12 krlmlr

what should pwd be?

maelle avatar Jan 15 '24 14:01 maelle

I am not sure I understand how one would actually run the command.

maelle avatar Jan 15 '24 14:01 maelle

The only noisy things are lex and yacc

Let's call these flex and bison. We do use extensions provided by GNU Flex and GNU Bison.

Not sure what version you're using now, but I strongly recommend the latest Bison, namely 3.8.2. Bison 3.8 generates better end-user error messages (i.e. messages that igraph users will see) than earlier versions.

As for Flex, it hasn't had a release in ages. Any platform we might ever use should have Flex 2.6.4.

szhorvat avatar Jan 15 '24 15:01 szhorvat

Run

docker run --rm -ti --platform linux/amd64 -v $(pwd):/root/workspace ghcr.io/cynkra/rig-ubuntu-igraph:main make -f Makefile-cigraph

from a local clone of this repository. With this, $(pwd) expands to the right location.

Just checked, we have the right versions in our Docker image:

docker run --rm -ti --platform linux/amd64 -v $(pwd):/root/workspace ghcr.io/cynkra/rig-ubuntu-igraph:main bison --version
# bison (GNU Bison) 3.8.2
# Written by Robert Corbett and Richard Stallman.
#
# Copyright (C) 2021 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions.  There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
docker run --rm -ti --platform linux/amd64 -v $(pwd):/root/workspace ghcr.io/cynkra/rig-ubuntu-igraph:main flex --version
# flex 2.6.4

krlmlr avatar Jan 15 '24 20:01 krlmlr

Add -B to rerun everything in the Makefile.

krlmlr avatar Jan 30 '24 13:01 krlmlr

Notes for myself at the moment.

I edited functions-R.yaml. Running the code with -B didn't change R/aaa-auto.R. I need to add an argument for the path.

maelle avatar Feb 09 '24 10:02 maelle

https://github.com/igraph/rigraph/issues/1176#issuecomment-1916988433

maelle avatar Feb 09 '24 10:02 maelle

it worked, I feel so empowered :smiling_imp:

maelle avatar Feb 09 '24 10:02 maelle

Now trying to work out how to expose a function with no argument.

maelle avatar Feb 09 '24 10:02 maelle

In 6356a50 (#1229) I don't know how to have no argument in res <- .Call(R_igraph_version, ). I tried editing functions-R.yaml too.

maelle avatar Feb 09 '24 10:02 maelle

idea: add an .Rbuildignored R file with an R function that'd wrap the commands for regenerating the code.

maelle avatar Feb 09 '24 10:02 maelle

docker run --rm -ti --platform linux/amd64 -v $(pwd):/root/workspace ghcr.io/cynkra/rig-ubuntu-igraph:main make -f Makefile-cigraph -B

maelle avatar Aug 21 '25 09:08 maelle

I believe we confirmed that make -f Makefile-cigraph -B works in a clean setup? Do we need more resilience, such as detecting a borked .venv directory?

krlmlr avatar Aug 22 '25 05:08 krlmlr

I deleted .venv then ran make -f Makefile-cigraph -B and it worked. I am surprised because I think it didn't work last time?! Good news I guess though!

maelle avatar Aug 27 '25 09:08 maelle

https://github.com/igraph/rigraph/issues/2109

maelle avatar Sep 02 '25 08:09 maelle