Skip to content

Commit

Permalink
Remove read_executable_link
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Oct 28, 2024
1 parent d2cd6cb commit ac27720
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 0 additions & 18 deletions crates/uv-fs/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,24 +250,6 @@ pub fn canonicalize_executable(path: impl AsRef<Path>) -> std::io::Result<PathBu
}
}

/// Resolve a symlink for an executable. Unlike `fs_err::canonicalize`, this does not resolve
/// symlinks recursively.
pub fn read_executable_link(executable: &Path) -> Result<Option<PathBuf>, std::io::Error> {
let Ok(link) = executable.read_link() else {
return Ok(None);
};
if link.is_absolute() {
Ok(Some(link))
} else {
executable
.parent()
.map(|parent| parent.join(link))
.as_deref()
.map(normalize_absolute_path)
.transpose()
}
}

/// Compute a path describing `path` relative to `base`.
///
/// `lib/python/site-packages/foo/__init__.py` and `lib/python/site-packages` -> `foo/__init__.py`
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-python/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ impl Interpreter {
/// `python-build-standalone`; if it returns `false`, the interpreter is definitely _not_ from
/// `python-build-standalone`.
///
/// See: https://github.com/indygreg/python-build-standalone/issues/382
/// See: <https://github.com/indygreg/python-build-standalone/issues/382>
pub fn is_standalone(&self) -> bool {
self.sysconfig_prefix()
.is_some_and(|prefix| prefix == Path::new("/install"))
Expand Down

0 comments on commit ac27720

Please sign in to comment.