Skip to content
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

Prune versions not referenced in juliaup.json with --prune-orphans #1146

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

christiangnrd
Copy link
Contributor

@christiangnrd christiangnrd commented Jan 17, 2025

I took a look at #1129 and it seems like if a direct download channel was deleted and the .juliaup folder was not, it would forever be ignored by the gc command. I attempt to address it by adding a --prune-orphans flag similar to the --prune-linked flag that will remove any folder that starts with "julia-" that is not referenced by the "juliaup.json" config file.

Name is definitely open for suggestions, and I'd love suggestions to make my code more idiomatic. At the moment it feels clunky.

If this approach is accepted, I'll write a test.

I also added some clarifying comments to the SystemChannel code to make it easier to understand.

This is to remove julia folders in the juliaup folder whose path is not referenced in juliaup.json

This will typically clean up direct download version that were somehow not removed.
@ket395
Copy link

ket395 commented Mar 8, 2025

Really appreciate the comments and clean simple code. I ran into this issue. But didn't have time to figure out a way to contribute a fix. My current workaround is to just not download any new versions.

Before I forget, a suggestion for a different PR would be to add the inverse of this flag to juliaup to preserve old behaviour by default because most probably someone is depending on it. As surprising or as obvious as it is.

I saw a comic about an exaggerated version of this phenomena in software engineering on a comic but I forget the link. I suspect it was XKCD and it was about a bug fix in the even more older no ancient, religiously venerable Emacs software system with an obscure oldfangled help shortcuts and docs. Its configured by using a dialect of Lisp, Emacs Lisp which allows modern bundles of it like Spacemacs. But I may be absolutely wrong about the comic.

I wish I knew about this PR before. Or that someone had reviewed it for idiomatic Rust lang code.

PS - Can't think of any other issue with this commit. Will check the PR later, possibly.

Manish, check out my kind of oldfangled, kinda newfangled, kinda cool, inevitably thought-provoking profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants