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

internal-build-dir flag is not respected when default stdlib is used #2273

Closed
paulcadman opened this issue Aug 4, 2023 · 1 comment · Fixed by #2283
Closed

internal-build-dir flag is not respected when default stdlib is used #2273

paulcadman opened this issue Aug 4, 2023 · 1 comment · Fixed by #2283

Comments

@paulcadman
Copy link
Collaborator

paulcadman commented Aug 4, 2023

There's a failing smoke test for this bug at 67fa4f0

To reproduce, make a fresh Juvix project with no explicit dependencies and compile using the --internal-build-dir flag.

buildDir=$(mktemp -d)
rootDir=$(mktemp -d)
cp ./examples/milestone/HelloWorld/HelloWorld.juvix "$rootDir"
touch "$rootDir/juvix.yaml"
cd "$rootDir"
juvix compile HelloWorld.juvix --internal-build-dir "$buildDir"

The --internal-build-dir flag means that the user wants to use $buildDir for build artifacts instead of $rootDir/.juvix-build.

Expected behaviour

The default stdlib is copied into $buildDir/stdlib (i.e the directory pointed to by --internal-build-dir).

Actual behaviour

The default stdlib is copied into $rootDir/.juvix-build/stdlib

@paulcadman
Copy link
Collaborator Author

paulcadman commented Aug 4, 2023

This issue is simple to fix. However the fix would break projects that use juvix init and then compile with --internal-build-dir as juvix init hardcodes the stdlib dependency to .juvix-build/stdlib/.

See:

@jonaprieto jonaprieto added this to the 0.4.3 milestone Aug 9, 2023
paulcadman added a commit that referenced this issue Aug 9, 2023
)

The mechanism for using `--internal-build-flag` to set the build
directory for the default stdlib location already existed, it was just
unused (Nothing always passed in, instead of the entry point):


https://github.com/anoma/juvix/blob/11ebc4acde4d1c7e70568b35326074e5ee671a77/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/PathResolver.hs#L128

This PR fixes that issue, adds some smoke tests to check the behaviour
of the stdlib dependency.

* Closes #2273

The issue with what to do with relative stdlib dependency paths when
`--internal-build-flag` is set remains open:
#2274
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants