-
-
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
RFC allow packages to fall back to finding UUID in project if not in deps of manifest #27932
Conversation
(Closes JuliaLang/Pkg.jl#457) |
What's the status of this? |
This is a non-breaking change so I don't think it's a blocker. Would be nice to have though. |
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
Should be ready for review.
Need to add a test but want to get an approval of the method first. |
db17b5b
to
fabd2e4
Compare
FreeBSD is ye ol' ccall failure: #28191. |
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
Example
inJSON
.The current steps to properly do this before
JSON
can be loaded is:import Example
toJSON
.JSON
project your active project.Pkg.add("Example")
to updateProject.toml
inJSON
(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
deps
section 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 Example
toJSON
.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