RFC allow packages to fall back to finding UUID in project if not in deps of manifest#27932
Merged
StefanKarpinski merged 2 commits intomasterfrom Jul 20, 2018
Merged
RFC allow packages to fall back to finding UUID in project if not in deps of manifest#27932StefanKarpinski merged 2 commits intomasterfrom
StefanKarpinski merged 2 commits intomasterfrom
Conversation
Member
|
(Closes JuliaLang/Pkg.jl#457) |
Member
|
What's the status of this? |
Member
|
This is a non-breaking change so I don't think it's a blocker. Would be nice to have though. |
Member
Author
|
I think this will really spam warning messages so need to work on that a bit. One thing where this would be good to have is where you set the context module to something else (like is common in Atom). Right now, you can't import almost any packages when you do that due to them not having the correct deps entries. |
d3691af to
db17b5b
Compare
Member
Author
|
Should be ready for review. Need to add a test but want to get an approval of the method first. |
db17b5b to
fabd2e4
Compare
Member
|
FreeBSD is ye ol' ccall failure: #28191. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A common developer situation is that you have a project with a bunch of dependencies. You are working on the dependencies and want to add a dependency to one of them.
As a concrete example, let's say I have:
Now, I want to use
ExampleinJSON.The current steps to properly do this before
JSONcan be loaded is:import ExampletoJSON.JSONproject your active project.Pkg.add("Example")to updateProject.tomlinJSON(this could potentially fail due to some weird constraints in the Manifest file in the JSON project)Pkg.resolve()to update the main project'sManifest.toml, which looks at JSON'sProject.toml(populatedeps = ["Example"]forJSON).JSON.Arguably, the steps 2-5 is kinda annoying while you are in the heat of developing. The reason we need to lookup the
depssection in the Manifest is because `JSON´ could potentially have used another package (another UUID) that also had the name Example. However, sometimes the Project.toml Example is the only package with that name in the Manifest, and it is likely that that is the package that one wanted to load into JSON anyway. So it feels a bit cruel to not allow it to just be loaded.This PR instead makes the workflow:
import ExampletoJSON.JSON.with the result
So it is quite clear that something wrong is happening but you can still continue working.
There are of course other solutions to this issue:
pkg> add JSON:Example; resolve)The current implementation is not perfect. It will look for fallback packages in environments below you in the stack which is perhaps not wanted. Also, maybe this should only be enabled for packages that are in "developer mode", i.e. tracking a path.
cc @Keno, @stevengj who has been "bitten" by this issue, cc @StefanKarpinski