Hey all! Thanks for the amazing work on repo2docker!! I was looking through the code and I have a suggestion for using Julia's Manifest.toml, and I can answer some questions about the default Julia version.
New: Julia version in Manifest
Since Julia 1.7, Manifest.toml has a new format (the old one is still backwards compatible). One feature of this new format is that the Manifest.toml contains a top-level field julia_version with the exact Julia version number that was used to resolve the Manifest:
finds the latest Julia version that is semver-compatible with the compat entry for julia in Project.toml. This seems to be working according to Julia Pkg spec, and this means:
The commented test is indeed meant to fail: the latest Julia version is intentional (because the fallback compat version is "1.6" which will resolve to latest 1.x).
If you want to test that compat can be used to define something other than the latest version, you could add this to Project.toml:
Hey all! Thanks for the amazing work on repo2docker!! I was looking through the code and I have a suggestion for using Julia's Manifest.toml, and I can answer some questions about the default Julia version.
New: Julia version in Manifest
Since Julia 1.7, Manifest.toml has a new format (the old one is still backwards compatible). One feature of this new format is that the Manifest.toml contains a top-level field
julia_version
with the exact Julia version number that was used to resolve the Manifest:https://pkgdocs.julialang.org/v1/toml-files/#Manifest.toml-entries
I think this is a good fit for repo2docker, as it allows automatically reproducing the exact Julia version. My suggestion is to use this as follows:
julia_version
. If this version is in the downloaded list, use it 🎉This will not change anything for older repositories that use the old Manifest format, since the top-level
julia_version
is not defined.Questions in comments about the current semver algorithm
This code:
https://github.com/jupyterhub/repo2docker/blob/239c4f57f5a40f7241bb4b4746019eb173475ed8/repo2docker/buildpacks/julia/julia_project.py#L49-L67
finds the latest Julia version that is semver-compatible with the
compat
entry forjulia
in Project.toml. This seems to be working according to Julia Pkg spec, and this means:Compat entry
"1.6"
is the same as"^1.6"
(caret is default), which means[1.6.0, 2.0.0)
, see https://pkgdocs.julialang.org/v1/compatibility/#Caret-specifiersSo right now, this means that the latest Julia version will be installed:
1.11.1
.This FIXME comment:
The commented test is indeed meant to fail: the latest Julia version is intentional (because the fallback compat version is
"1.6"
which will resolve to latest1.x
).If you want to test that
compat
can be used to define something other than the latest version, you could add this to Project.toml:And check
v"1.7.0" <= VERSION < v"1.8.0"
.This FIXME comment
The observed behaviour in the comment seems correct, the comment can be removed.
The default compat entry
https://github.com/jupyterhub/repo2docker/blob/239c4f57f5a40f7241bb4b4746019eb173475ed8/repo2docker/buildpacks/julia/julia_project.py#L65
This does not seem fully intentional. I think two good options here are:
"1"
(install the latest 1.y version of Julia) this is the same behaviour as currently, but"~1.10"
(install1.10.z
) the current LTS cycle of Julia, this used to be 1.6 until this month.