Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Allow custom compiler bootstrap scripts for external backends #146

Open
jonathanrlouie opened this issue Aug 10, 2022 · 1 comment

Comments

@jonathanrlouie
Copy link

When specifying the idris-jvm backend as the idris2 url for a package set, building an Idris2 project with pack causes the build to fail with the following error:

43/95: Building Debug.Trace (Debug/Trace.idr)
Error: The given specifier '["jvm:toString(java/lang/Object java/lang/String),java/util/Objects"]' was not accepted
by any backend. Available backends:
  chez, chez-sep, racket, node, javascript, refc, gambit, vmcode-interp
Some backends have additional specifier rules, refer to their documentation.

This is because the pack bootstrapping process does not use a previous version of the idris-jvm compiler to build the idris-jvm compiler. Instead, it will try to run make bootstrap as part of Pack.Runner.Install.mkIdris, which idris-jvm does not use. Idris-jvm bootstraps the compiler by running the following commands (as seen in its GitHub Actions install workflow):

export IDRIS2_TESTS_CG=jvm
export PREVIOUS_VERSION=0.5.1
export IDRIS2_PREFIX=$HOME/bin/idris2-$PREVIOUS_VERSION/lib
export PREFIX=$IDRIS2_PREFIX
mvn dependency:copy -Dartifact=io.github.mmhelloworld:idris-jvm-compiler:$PREVIOUS_VERSION:zip -DoutputDirectory=. -U
unzip idris-jvm-compiler-*.zip -d $HOME/bin
echo "::add-path::$HOME/bin/idris2-$PREVIOUS_VERSION/bin"
mvn -B install -Dinteractive= -Didris.tests="only=jvm"

These commands use Maven to download a previous version of the Idris2 compiler from Maven Central, and then use that downloaded compiler to build the new compiler.

I think pack should allow a custom bootstrapping script to be specified to allow external backends like idris-jvm to be used with pack.

@stefan-hoeck
Copy link
Owner

Yes, we definitely need this (and other ways for custom installations).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants