-
-
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: add cleandeps keyword argument to Pkg.rm #12350
Conversation
Interesting. I guess I'd switch PkgEval to Pkg.subtract then |
I don't really like this. Is this really necessary? Pedantically, the opposite of If
|
I agree with @aviks that remove is a the common name for this. A more nuanced approach would be to remove the package if nothing depends on it, and if anything depends on it, print a message like "Package X cannot be fully removed because packages Y and Z depend on X. X will be removed automatically when all packages which depend on it are removed." |
What @kmsquire said. The only tricky part is that e.g. package X (to be removed) could depend on package Y, which is not explicitly required, but is itself required by package Z. It shouldn't be too hard to write though, one just needs to explore the graph outwards until explicitly required packages are found. One more complete approach for this kind of info message could be:
At this point, one could even add a |
Did you read the discussion in #7054 first? The status quo is broken. The problem is the semantics don't match user expectations for how this should behave, and without fundamentally rewriting Pkg that's difficult to change. Modifying the If the Pkg code actually had any comments then I'd think about a more dramatic refactoring. As things stand right now, if you call
|
Perhaps |
What if when we move things to |
Do you have a good heuristic for what makes for a "generated thing" as opposed to "user's work" ? |
We do use a satisfiability solver. (One specialized for package dependencies.) I'm not aware of any problems with it. I think the problem with |
The other alternative is saving more state in the system re: #11262, which I haven't implemented a prototype for since it's a more complicated change. I guess we could |
Doing a full git clean kind of defeats the purpose. Just cleaning deps would be good. |
git clean -fdx deps
when moving packages to .trash
Precompilation is easy, anyway this is off-topic here. At any rate, the bottleneck there seems to be the part where the current status is read (
To the API. See Stefan's comments.
Sorry, my first post was mostly a warning about what @kmsquire proposed, and a note for whomever may want to tackle that (possibly myself). |
Ah, good to know, you've profiled this in much more detail than I have. I meant
#7757 is certainly a bug. The message from #4108 would be good to bring back to explain why
Okay. Stefan didn't say anything about the API. If he or anyone else had suggested cleaning deps anywhere in #7054 then that probably would've been prototyped by now. I'll try that and replace this branch, probably add a keyword argument
Yes, quoting |
defaults to true, runs `git clean -qdfx .trash/$pkg/deps` for removed package
git clean -fdx deps
when moving packages to .trashgit clean -qfdx deps
when moving packages to .trash
Okay, take a look at this version. Seems to do the right thing in local tests. |
git clean -qfdx deps
when moving packages to .trash
Apologies for not being clear. I agree |
Ah, gotcha. Maybe had you led with "-1 for the subtract pun" I would've gotten your point more directly. Sorry for being snappy, I've been coming across as more negative/hostile than intended lately. Maybe I should start throwing in more emoji 😔 Anyway, if people like the name/behavior of the kwarg then there's just the decision of whether it should default to true or false. IMO we should be changing the default behavior here since so many users have hit BinDeps trouble, tried |
Don't worry about it. I was imprecise in my comment above. Your response was perfectly understandable. |
I have mixed feelings about |
I'm very strongly against a separate action on the grounds that it's not discoverable enough, unless we go the originally proposed route of making The packages get moved to The intent here is that running |
How about we use |
cc @carnaval @amitmurthy on that travis failure https://gist.github.com/tkelman/e69eae8a9718952101eb |
Maybe we should just add, and very clearly document and encourage, a |
Obsolete with the new package manager, if still applicable needs to be reopened against Pkg.jl |
and rename current Pkg.rm to Pkg.subtractoriginal commit db0cb23 was replacedshould fix #7054, probably a simpler alternative to #11262
I can't really think of a situation where I call
Pkg.rm
and really strongly want to keep that package around in.trash
. If I did this correctly it still does dependency resolution in a way that moves no-longer-required packages to.trash
, but actually deletes the specific package you asked to remove when you callPkg.rm
.