Dependency/edition bump, plus features#100
Open
dwink wants to merge 4 commits into
Open
Conversation
added 4 commits
October 20, 2025 20:05
* adds a `--verbose` flag to `list` which shows the configured version as well as all installed versions of the app * adds a `prune` command which removes all versions not referenced in the config * replace `serde_yaml` with maintained `serde_yaml_ng` * 2024 edition * adjust `files::delete_if_exists` to handle deleting symlinks (previously, the code used `exists()` and `is_dir()` which always follow symlinks; now checks for symlink first.
apmorton
reviewed
Oct 21, 2025
Comment on lines
+468
to
+470
| unsafe { | ||
| std::env::set_var("PATH", updated_path); | ||
| }; |
Contributor
There was a problem hiding this comment.
setting an environment variable is unsafe now?
Contributor
Author
There was a problem hiding this comment.
Yes. Technically only in multithreaded contexts on non-Windows. Discussion here.
| .join(&self.version)) | ||
| } | ||
|
|
||
| pub fn versions(&self) -> Result<Vec<String>> { |
Contributor
There was a problem hiding this comment.
this (and prune_other_versions) are unfortunately fighting an uphill battle with some history:
/home/amorton/.cache/ozy/meter:
total 8.0K
drwxrwxr-x 3 amorton amorton 135 Mar 4 2025 ./
drwxrwxr-x 46 amorton amorton 4.0K Oct 16 04:51 ../
lrwxrwxrwx 1 amorton amorton 71 Jan 28 2025 348 -> /home/amorton/.cache/ozy/meter/348.8861341d-5179-414d-95ed-06f385fe5bdc/
drwxrwxr-x 15 amorton amorton 4.0K Jan 28 2025 348.8861341d-5179-414d-95ed-06f385fe5bdc/
-rw-rw-r-- 1 amorton amorton 0 Jan 28 2025 348.lock
lrwxrwxrwx 1 amorton amorton 51 Jan 28 2025 353 -> /home/amorton/.cache/ozy/internal_install/meter/353/
-rw-rw-r-- 1 amorton amorton 0 Jan 28 2025 353.lock
lrwxrwxrwx 1 amorton amorton 51 Mar 4 2025 359 -> /home/amorton/.cache/ozy/internal_install/meter/359/
-rw-rw-r-- 1 amorton amorton 0 Mar 4 2025 359.lock
internal_install wasn't always a thing; we used to install to <version>.<uuid> and symlink. I actually preferred that since it meant there was exactly one directory tree per app, but 🤷
I think the most robust thing to do is:
- look for
.lockfiles and remove the.locksuffix - those are your installed versions
to uninstall
- lock .lock
- check if is a symlink, and if it is contained within the ozy install path follow it
- if is a symlink, remove that first
- atomically rename directories to remove to something random (possibly into ~/.cache/ozy/to_delete/` so we can easily resume interrupted unlinks?)
- recursively remove the directory
Contributor
Author
There was a problem hiding this comment.
Interesting...do you know why internal_install was created/favored over the uuid directory/symlink?
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.
--verboseflag tolistwhich shows the configured version as well as all installed versions of the appprunecommand which removes all versions not referenced in the configserde_yamlwith maintainedserde_yaml_ngfiles::delete_if_existsto handle deleting symlinks (previously, the code usedexists()andis_dir()which always follow symlinks; now checks for symlink first.