Idris2 icon indicating copy to clipboard operation
Idris2 copied to clipboard

Compilation error at Builtin.idr with Chez Scheme

Open ionathanch opened this issue 2 years ago • 5 comments

Chez Scheme version: 9.5.8, installed from AUR Idris version: 38caff23b8b9f1fc9a7a55d73fa10fe4e7cf7b79 Running the following:

make clean
make bootstrap-clean
make distclean
make bootstrap SCHEME=chez

After a while, I reach this point:

make -C libs/prelude IDRIS2=/home/jonathan/Documents/Idris2/build/exec/idris2 IDRIS2_INC_CGS=chez IDRIS2_PATH="/home/jonathan/Documents/Idris2/libs/prelude/build/ttc:/home/jonathan/Documents/Idris2/libs/base/build/ttc:/home/jonathan/Documents/Idris2/libs/contrib/build/ttc:/home/jonathan/Documents/Idris2/libs/network/build/ttc:/home/jonathan/Documents/Idris2/libs/test/build/ttc:/home/jonathan/Documents/Idris2/libs/linear/build/ttc"
make[2]: Entering directory '/home/jonathan/Documents/Idris2/libs/prelude'
/home/jonathan/Documents/Idris2/build/exec/idris2 --build prelude.ipkg
 1/14: Building Builtin (Builtin.idr)
Exception: incorrect number of arguments to #<procedure System-getEnv at System.ss:5400>
make[2]: *** [Makefile:2: all] Error 255

On the other hand, bootstrapping from Racket works.

ionathanch avatar Jun 28 '22 02:06 ionathanch

How did you install Chez? I know there was an issue where chez had to be built with threading enabled, maybe that's the issue?

JoeyEremondi avatar Jun 28 '22 04:06 JoeyEremondi

I installed it through AUR, and running (threaded?) in Chez gives me #t

ionathanch avatar Jun 28 '22 04:06 ionathanch

I was thinking of filing this after a discussion on discord about a pack install failure. This occurs if you have IDRIS2_INC_CGS=chez set in the environment.

I haven't dug deeper yet, but maybe it's just that the ttc / so files need to be cleaned sometime during bootstrap?

dunhamsteve avatar Jun 28 '22 04:06 dunhamsteve

That was it! I had IDRIS2_INC_CGS=chez set and unsetting it let me compile all the way through. Is it not supposed to be set (could've sworn I copied it from INSTALL.md...) or is there just something going wrong with that?

ionathanch avatar Jun 28 '22 04:06 ionathanch

You probably don't want it set. It can be useful when working on Idris itself, but the tradeoff is that the compiler builds faster, but the resulting program runs slower. I tried it once, but ran into some issues and bailed.

It is mentioned in the INSTALL.md around step 7. I think it's safe to set after the initial make bootstrap.

dunhamsteve avatar Jun 28 '22 05:06 dunhamsteve