-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add preference for version named manifest files #43845
Add preference for version named manifest files #43845
Conversation
If we need to do a breaking change to the Manifest spec in the future (surely we will), then this would be problematic. It's also often easiest to just manage versions as separate files on the filesystem. For example, if I'm developing my package (which supports Julia 1.7) with 1.8 because I like it more, it doesn't mean I want that 1.8-specific bit of Manifest committed with the rest of the versions in the Manifest when I go to push a change. |
Good point. Also, I don't think this would need backporting to 1.6, you'd just include the 1.6 one as |
|
base/loading.jl
Outdated
const manifest_names = ("JuliaManifest$(VERSION.major).$(VERSION.minor).toml", "JuliaManifest.toml", | ||
"Manifest$(VERSION.major).$(VERSION.minor).toml", "Manifest.toml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This order probably makes more sense
const manifest_names = ("JuliaManifest$(VERSION.major).$(VERSION.minor).toml", "JuliaManifest.toml", | |
"Manifest$(VERSION.major).$(VERSION.minor).toml", "Manifest.toml") | |
const manifest_names = ("JuliaManifest$(VERSION.major).$(VERSION.minor).toml", | |
"Manifest$(VERSION.major).$(VERSION.minor).toml", | |
"JuliaManifest.toml", | |
"Manifest.toml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. I hope we are not wasting time now with a stat
call (aka isfile
), since it is substantially faster (and more accurate) to just try to open the file name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IanButterworth I think this is resolved by 6c36a8d, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first issue is resolved, but Jameson's point is worth keeping visible. Currently loading does do the bad thing of isfile
testing rather than just opening because it happens in different places.
I prefer the format I'd also be okay with I really dislike |
In the General registry1, we've already implemented the pattern of Footnotes
|
If I recall correctly (from the last time I looked at this code), you'll need to make a few small changes to Pkg, but nothing terribly difficult. |
bump? |
It might be good to get some more Pkg views @KristofferC @StefanKarpinski @fredrikekre Perhaps run by triage too? |
It could also be useful to have a Pkg call. |
6c36a8d
to
6c3b200
Compare
bumping for Pkg team opinions. Given there's a little work to do in Pkg if this merges, it would be good to get it decided before the 1.8 freeze |
I think it's fair to say from a slack discussion in #pkg-dev that there's some dislike of this approach, and a suggestion by @GunnarFarneback to add a Potential use models are:
There was also the idea of doing the same via a cc. @GunnarFarneback @DilumAluthge @fredrikekre @StefanKarpinski |
I think we only need to worry about use cases 1 and 3, which is exactly what your PR #44286 does. |
6c3b200
to
87f6da8
Compare
This has come up a few times recently, and seems to be the preferred approach over #44286 |
Co-Authored-By: Dilum Aluthge <dilum@aluthge.com>
87f6da8
to
7effd1b
Compare
This is RTM from my perspective. I will merge this and bump Pkg immediately after merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Shall this be back-ported? If yes, to which Julia versions? |
Features are not usually backported. If we don't backport this, and you are using both 1.9 and 1.10, then you'll have to keep dealing with the problems for now. If you are using 1.10 and 1.11, though, then you can have a Manifest.toml file that is for 1.10 and a Manifest-v1.11.toml file that is for 1.11, and each Julia version will know to use the correct manifest file. |
Is there a way to cause Julia to automatically create versioned Manifests? Would make switching versions a lot nicer. Also an empty Manifest file is treated as v1
|
Co-authored-by: Dilum Aluthge <dilum@aluthge.com> (cherry picked from commit e9b0fa1)
(Updated to latest)
This makes julia prefer manifest files in the format
(Julia)Manifest-v{major}.{minor}.toml
over a simple(Julia)Manifest.toml
, to allow maintaining multiple manifests for different julia versions concurrently.A new manifest will still save as
(Julia)Manifest.toml
(theJulia
prefix is used if you have aJuliaProject.toml
), so it's up to the user to manually rename the manifest to enable this. SoManifest-v1.11.toml
would work for v1.11.A downside of this approach is adding two file stat operations on-top of the most common scenarios of just having a Manifest.toml or no manifest saved at all, which might be non-negligible on some filesystems. There are design optimizations possible there though (see #43845 (comment))
An alternative is to store multiple julia-versioned manifests within a single Manifest.toml