Open iacore opened 2 years ago
The IDRIS2_INC_CGS
environment variable asks Idris to build the .so files for all listed codegens whenever it builds the .ttc
files. Internally, the .ttc
files contain a list of incremental backends for which they have incremental support.
Technically this is consistent with the documentation at IncrementalCodeGeneration, but I don't think it's clear from that documentation that the binary code is produced regardless of the target codegen. I only know this because I saw it in the code:
If an existing ttc
doesn't support an incremental back end (has no .so file) during an incremental build, the compiler tries to switch to whole program (but there is a bug, #2557, that causes incremental to be reenabled, generating a broken executable).
Having IDRIS2_INC_CGS
defined also globally disables an optimization in Inline.idr
.
Steps to Reproduce
Compile the following code
set -x IDRIS2_INC_CGS chez
orexport IDRIS2_INC_CGS=chez
idris2 --cg javascript --wp callcc.idr
%foreign "javascript:lambda:(f)=>f()"
Main> :r
Expected Behavior
%foreign "javascript:lambda:(f)=>f()"
should be accepted as valid code.Observed Behavior
See above