-
-
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
Make versioned .julia/v0.x dir by default. #3344
Make versioned .julia/v0.x dir by default. #3344
Conversation
The build failure shouldn't have anything to do with this request. Tests for the clang version didn't complete for some reason. |
I think it is actually a good idea to create versioned package directories by default. Simplifying this will also encourage package developers to support older released versions of julia easily. |
Bump. This isn't really necessary at this instant, because so few people were using |
I just can't see more than a smallish minority of users ever having multiple versions of Julia installed. For those users, we already support using versioned |
I agree with @kmsquire. Avoiding mysterious breakage in corner cases is worth an extra few characters in the path. |
Ok, I'm outvoted. I'm going to test this out and merge if there aren't any problems. |
Ok, this definitely has conflicts now; please rebase. |
I also wonder about the appropriate level of granularity here. Should we really have separate versioned |
It needs to include the minor version, because minor versions may add features that are not forwards-compatible. (e.g. there may be package versions that work with 1.3 but not with 1.2.) We went through the same discussion already for /usr/share/julia/VERSDIR ... |
I'll try to get to this tonight. I'm wondering if the package cache should |
Do you suggest sharing |
I think we could share the package cache (which is a set of git repos), but I'm thinking each version should have its own METADATA, because when Julia |
Okay, I've rebased the pull request. As of right now, it uses a shared cache dir, but each version Some comments
|
I wonder if we shouldn't set the .cache up as a symlink, which would allow manually separating the caches. |
if isdir(d) || !isdir(b) || !isdir(joinpath(b, "METADATA")) | ||
return d | ||
end | ||
#warn_once("Using unversioned package dir\n $b\nRun `Pkg.update_pkgdir()` to update to\n $d.") |
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.
What's up with the commented out warning?
A symlink for the cache dir sounds good. The warning is commented out because the function to migrate to a versioned package dir doesn't exist yet (sorry, should have probably just removed that). I'll update the pull request. |
Is a symlink going to be a problem on Windows, or is this not going to be used there? |
Whoops, got simonster's commit mixed up in there... |
Sorry, this took a little while (real work, life, yadda yadda...). I was trying to figure out the best way to upgrade non-versioned to versioned, add Windows symlinks, etc., but finally realized that all that was holding up this relatively trivial patch, and that stuff can be taken care of in later patches.
For right now, it's not used, but I submitted #4396 to add support for symlinks on Windows. |
Right, we should probably do this one too for 0.2. Almost forgot. |
Unfortunately, probably needs yet another update to deal with recent WINDOWS changes. |
I rebased, but AFAICT, the recent Windows changed only updated The patch doesn't make any attempt to move old versions of the dir, and on Windows, it doesn't attempt symlinking (#4396 needs a slight update won't be merged until after 0.2 is released, and it's unclear what to do about Windows XP, which doesn't support symlinks). Otherwise, the patch is pretty minimal. Is there something else it should do or needs to take care of? |
I'm still reluctant to merge this, for the following reason: I want to add support for per-project package directories. This is like a Let's say I'm using a single shared set of system packages and I feel like using the latest and greatest for project A and so I upgrade and fix any problems that might result. Now projects B, C, D, etc. might be in a broken states because they were relying on the system packages and I didn't check to see if they were messed up by the upgrade. Obviously, this is not good. With per-project packages, this doesn't happen since I choose the upgrade the packages each project is using independently. With per-project Another thing to consider is where binary dependencies live. They probably should not live where they do now, inside of the installed package. That implies that when you have multiple With per-project |
Isn't having multiple |
Somewhat, but they both entail shared |
OK. |
@kmsquire – I think we need to go ahead with this now. Could you rebase? |
Sure, will get to it tomorrow. |
Re: per-project .julia directories - I think that this is a great idea, and something that in Python you need a separate package (virtualenv) to achieve. It's a common problem and it would be great to have it included in the language. I'm not necessarily sold on the value of shared binary deps between project-local package stores. I feel like you either want a sandboxed version of a package or you don't. For me I'm willing to wait a little longer for a package's binary dependencies to build for the simplicity and peace of mind that there's no interaction between projects. For the most part it seems like the trend is to not require users to compile binary dependencies anyways, and instead to provide pre-built binaries, right? |
I was mostly concerned about very large binary dependencies like |
* On linux, link to common cache dir
Rebased. |
Two more thoughts:
|
Ok, those can both be taken care of after this is merged. I have a probably-undue amount of dread about merging this, but I'm just going to do it and see what happens... |
Make versioned .julia/v0.x dir by default.
I recommend breathing. ;-) |
I have PTSD from developing the package manager. |
I'm not surprised. |
… 'library improvements'; NEWS for #3344
This addresses JuliaLang/METADATA.jl#264.
Pkg already had the ability to deal with julia-versioned package directories (
.julia/v0.x
), but didn't create them by default. This patch causes that to happen. Currently existing.julia
directories will continue to work.The same fix was made in
base/pkg2
, so the upcoming Pkg update will have the same behavior.Note that, unfortunately, git submodules don't work well with being moved, so for existing installations, the best solution is to blow away
.julia
and start afresh.cc: @StefanKarpinski