-
Notifications
You must be signed in to change notification settings - Fork 28
Keep, clean, and remove releases #47
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
base: master
Are you sure you want to change the base?
Conversation
|
We seem to be lacking a normal "remove" command to remove a compiler that's not been marked to keep. I'm not sure we need a distinction between removing a version that's been marked to keep or not, if the user has explicitly asked anyzig to remove a specific version, I think we can infer they no longer want to keep it. With that, we could implement all the use cases by enhancing |
|
There is a |
|
I think I'd prefer just one command with optional arguments. |
|
Should be working as expected now |
src/main.zig
Outdated
| try stdout.print("{}\t{s}{s}{s}\n", .{ version, p_path, std.fs.path.sep_str, hash }); | ||
|
|
||
| // Check for keep file | ||
| const keep_file_path = try std.fs.path.join(global.arena, &.{ p_path, hash, "keep" }); |
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.
We should store the keep files in anyzig's appdata directory, not in zig's global cache directory.
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.
is there any specific value in having the keep file outside of the release folder? by my eyes the current implementation actually makes the removal process a bit simpler
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.
I'm not sure what you mean by "release folder"? You're storing the keep files in zig's global cache which horribly breaks how zig's caching system works. You've modified the contents of a "content addressable store"...which...would mean you'd need to change the path of what you're storing because you changed it's content.
It's the same idea as modifying the contents of a git commit and without updating the commit hash.
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.
Oh I see, I had some false assumptions about how the caching system works. I thought it was specific to the executable, not the folder contents. This makes a lot of sense, I will have to rework.
|
Let me know what you think about this implementation. It now creates/finds a kept-releases folder in the anyzig data folder to store keep files. |
Keep/Clean Releases
Description
Added commands to manage which Zig versions are kept or removed from cache
Changes
any keep VERSION: Prevents a version from being removedany clean: Removes all non-kept versionsany force-remove VERSION: Force removes a version (bypasses keep)keepfiles in version directorieslist-installedto show kept statuskeepCompiler()- Creates keep markerscleanReleases()- Cleans non-kept versionsremoveRelease()- Handles version deletionTesting
Notes