Skip to content

Commit

Permalink
Canonicalize installed tool root on init
Browse files Browse the repository at this point in the history
in an attempt to address snapshot differences
  • Loading branch information
zanieb committed Jun 28, 2024
1 parent bca8d50 commit e679a91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions crates/uv-tool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ impl InstalledTools {
let contents = match fs_err::read_to_string(&path) {
Ok(contents) => contents,
Err(err) if err.kind() == io::ErrorKind::NotFound => {
warn_user_once!(
"Ignoring malformed tool `{}`: missing receipt at {}",
name,
path.user_display()
);
warn_user_once!("Ignoring malformed tool `{}`: missing receipt", name);
continue;
}
Err(err) => return Err(err.into()),
Expand Down Expand Up @@ -224,7 +220,9 @@ impl InstalledTools {
Err(err) => return Err(err.into()),
}

Ok(self)
Ok(Self {
root: root.canonicalize()?,
})
}

/// Return the path of the tools directory.
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/tests/tool_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn tool_list_missing_receipt() {
----- stderr -----
warning: `uv tool list` is experimental and may change without warning.
warning: Ignoring malformed tool `black`: missing receipt at [TEMP_DIR]/tools/black/uv-receipt.toml
warning: Ignoring malformed tool `black`: missing receipt
No tools installed
"###);
}

0 comments on commit e679a91

Please sign in to comment.