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

Bootstrapped Idris2 fails to resolve paths when IDRIS2_PREFIX is manually set #3022

Closed
scarf005 opened this issue Jul 19, 2023 · 9 comments · Fixed by #3024
Closed

Bootstrapped Idris2 fails to resolve paths when IDRIS2_PREFIX is manually set #3022

scarf005 opened this issue Jul 19, 2023 · 9 comments · Fixed by #3024
Labels
Installation Issue Problem compiling or running Idris status: confirmed bug Something isn't working

Comments

@scarf005
Copy link
Contributor

scarf005 commented Jul 19, 2023

Summary

# ...logs
/home/scarf/repo/Idris2/bootstrap-build/bin/idris2 --build idris2.ipkg
Uncaught error: EmptyFC:Failed to resolve the dependencies for idris2app:
  required network any but no matching version is installed

make[1]: *** [Makefile:67: /home/scarf/repo/Idris2/build/exec/idris2] Error 1
make[1]: Leaving directory '/home/scarf/repo/Idris2'
make: *** [Makefile:249: bootstrap] Error 2

Idris2 bootstrapped from source (commit 23694c7) with custom environment variables cannot resolve dependency paths.

environment

environment variables (followed from official docs)

IDRIS2_PREFIX: /home/scarf/.local/share/idris2
PACK_DIR: /home/scarf/.local/share/pack
PATH: /home/scarf/.idris2/bin /home/scarf/.pack/bin # ...

scheme version: 9.5.9 (built from source with threads enabled)
OS: Kubuntu 23.04 x86_64
Shell: fish 3.6.0

$ SCHEME=scheme ./bootstrap-build/bin/idris2 --paths
+ Working Directory      :: "/home/scarf/repo/Idris2"
+ Source Directory       :: Nothing
+ Build Directory        :: "build"
+ Local Depend Directory :: "depends"
+ Output Directory       :: "build/exec"
+ Installation Prefix    :: "/home/scarf/.local/share/idris2"
+ Extra Directories      :: ["."]
+ Package Directories    :: []
+ CG Library Directories :: ["/home/scarf/.local/share/idris2/idris2-0.6.0/lib", "/home/scarf/repo/Idris2"]
+ Data Directories       :: ["/home/scarf/.local/share/idris2/idris2-0.6.0/support"]

build log

build.3.log

@scarf005 scarf005 added the Installation Issue Problem compiling or running Idris label Jul 19, 2023
@CodingCellist
Copy link
Collaborator

PATH: /home/scarf/.local/share/idris2 /home/scarf/.local/share/pack # ...

Might it be that PATH should point to [...]/bin for both of those? I.e.

/home/scarf/.local/share/idris2/bin
/home/scarf/.local/share/pack/bin

? : )

@CodingCellist
Copy link
Collaborator

CodingCellist commented Jul 20, 2023

Latest main seems to bootstrap fine when using a similar directory structure for me (using make bootstrap, not using pack). Could this be a pack issue rather than an Idris2 issue?

@scarf005
Copy link
Contributor Author

scarf005 commented Jul 20, 2023

Might it be that PATH should point to [...]/bin for both of those? I.e.

...oh, must've mistyped, thanks for finding out. it doesn't seem to work after changing PATH, tho.

Could this be a pack issue rather than an Idris2 issue?

I'm bootstrapping idris2 from source

build.2.log

@scarf005
Copy link
Contributor Author

was finally able to build by explicitly setting IDRIS2_DATA and IDRIS2_PACKAGE_PATH.
as @stefan-hoeck suggested, i believe this is due to my IDRIS2_PREFIX env var explicitly est to $XDG_DATA_HOME/idris2(that is,/home/scarf/.local/share`).

IDRIS2_DATA=./bootstrap-build/idris2-0.6.0/support  IDRIS2_PACKAGE_PATH=./bootstrap-build/idris2-0.6.0/ ./bootstrap-build/bin/idris2 --verbose --build idris2.ipkg

@stefan-hoeck
Copy link
Contributor

As noted on discord, I have experienced this before. In my case, setting IDRIS2_PREFIX was an issue during bootstrapping. If you are using pack, please only set the PACK_DIR variable. Pack should take care of everything else.

@scarf005 scarf005 changed the title Cannot bootstrap Idris2 from source Bootstrapped Idris2 fails to resolve paths when IDRIS2_PREFIX is manually set Jul 20, 2023
@CodingCellist
Copy link
Collaborator

@scarf005 are we good to close this in that case? : )

@scarf005
Copy link
Contributor Author

Well it's a major bug in bootstrap process so i doubt we should. I'm planning to open a PR (when i get some time)

@CodingCellist
Copy link
Collaborator

CodingCellist commented Jul 20, 2023

Sorry for the slow reply, I was triple-checking, because that's a bizarre error! Thanks for catching that!

  1. Set IDRIS2_PREFIX => FAIL
  2. Set PREFIX => PASS
  3. Set IDRIS2_PREFIX and PREFIX => FAIL 👀

I believe I've fixed it, although I'm not fluent enough in Make to understand why. I'll push in a mo : )

CodingCellist added a commit to CodingCellist/Idris2 that referenced this issue Jul 20, 2023
Original issue spotted and reported by scarf005 and Stefan Höck.

For some reason, using `:=` instead of `?=` in the Makefile causes the
second part of bootstrapping to fail. So the fix is to use `?=`.

Fixes idris-lang#3022
CodingCellist added a commit to CodingCellist/Idris2 that referenced this issue Jul 20, 2023
We've modified the environment variables, but nobody seemingly bothered
updating the docs.

Discovered as part of idris-lang#3022
CodingCellist added a commit to CodingCellist/Idris2 that referenced this issue Jul 20, 2023
As well as the envvars doc update.
@CodingCellist CodingCellist linked a pull request Jul 20, 2023 that will close this issue
1 task
@CodingCellist CodingCellist added status: confirmed bug Something isn't working and removed status: info needed labels Jul 20, 2023
@gallais
Copy link
Member

gallais commented Jul 31, 2023

Thanks for the bug report & the investigation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Installation Issue Problem compiling or running Idris status: confirmed bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants