-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
73: Clean command: removes installation from state if directory missing. r=Hoverbear a=amanjeev This was a bug that if the directory of the installation is missing from the file system, and the installation is still present in the state file, the clean command will not remove the installation from the state file. This was certainly a problem because if there is accidental deletion of the toolchain directory, we need to be able to clean up the state file too. #### Start with a clean state.json. For best results, delete the entire criticalup installation directory. #### Install project 1 Use this manifest to install first project. Name this file project1.toml. ```toml manifest-version = 1 [products.ferrocene] release = "stable-24.11.0" packages = [ "cargo-${rustc-host}", "rustc-${rustc-host}", ] ``` #### Install this project ``` criticalup install ``` #### Check state.json state.json file should contain an installation with ID "c8f887068792bbf1f09ce4b6ddbe84fd7d9dcde18407d608968c26b89862d15e". #### Delete the installation directory In the appropriate location of toolchain installations, find the directory where this is installed and delete the toolchain of this project only. DO NOT delete the root directory of CriticalUp configs and installation. On Linux, you can see this at `~/.local/share/criticalup/toolchains/c8f887068792bbf1f09ce4b6ddbe84fd7d9dcde18407d608968c26b89862d15e/`. #### Run clean ``` criticalup clean ``` Result: you should see that the state.json file does not have the installation of the above. Co-authored-by: Amanjeev Sethi <amanjeev.sethi@ferrous-systems.com>
- Loading branch information
Showing
8 changed files
with
145 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
14 changes: 14 additions & 0 deletions
14
...s/snapshots/cli__clean__clean_deletes_only_unused_installations_that_are_not_on_disk.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
source: crates/criticalup-cli/tests/cli/clean.rs | ||
expression: repr | ||
--- | ||
exit: exit status: 0 | ||
|
||
empty stdout | ||
|
||
stderr | ||
------ | ||
INFO Deleting unused installation installation_id_2 | ||
INFO Deleting unused installation installation_id_3 | ||
INFO No untracked installation directories found | ||
------ |
This file contains 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