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

Potential to eliminate code in Julia provisioner #1383

Open
agoose77 opened this issue Dec 3, 2024 · 0 comments
Open

Potential to eliminate code in Julia provisioner #1383

agoose77 opened this issue Dec 3, 2024 · 0 comments

Comments

@agoose77
Copy link

agoose77 commented Dec 3, 2024

In #1376, @GeorgianaElena and I did some digging and concluded that a bug in julia<1.4.1 was the reason for the addition of a call to resolve() (https://github.com/fonsp/repo2docker/blob/239c4f57f5a40f7241bb4b4746019eb173475ed8/repo2docker/buildpacks/julia/julia_project.py#L180).

At the time of that PR (#879), the julia command was:

julia --project=${REPO_DIR} -e 'using Pkg; Pkg.instantiate(); pkg"precompile"'

Our reading of this is that at the time, instantiate did not precompile, and resolve() call was then added in #879 to address a bug for missing dependencies.

julia --project=${REPO_DIR} -e 'using Pkg; Pkg.instantiate(); Pkg.resolve(); pkg"precompile"'

Later, in #1376, the call to precompile was changed to instantiate(), to eliminate this warning:

julia --project=${REPO_DIR} -e 'using Pkg; Pkg.instantiate(); Pkg.resolve(); Pkg.instantiate()'

It would appear that for newer Julia versions, the call to resolve() is not necessary, leaving us with

julia --project=${REPO_DIR} -e 'using Pkg; Pkg.instantiate(); Pkg.instantiate()'

Furthermore, the double instantiate() seems superfluous.

Therefore, for newer Julia versions, it would seem that we can remove both resolve() and the second instantiate(). However, we are not familiar enough with repo2docker to make a judgement on whether it is better to leave redundant code, or introduce a julia-version-sensitive branch.

Next steps for this are to test a reproducer for the original #879 to ensure that both #879 and #1736 are solved by simply:

julia --project=${REPO_DIR} -e 'using Pkg; Pkg.instantiate();'

And if so, a maintainer should make a decision about whether we should introduce this simplification through a branch dependent upon the Julia version.

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

1 participant