Skip to content

Commit 0457c38

Browse files
authoredJan 2, 2025··
refactor: remove use of home crate (denoland#27516)
The two places mentioned in the issue are now consolidated. Closes denoland#24385
1 parent 225c3de commit 0457c38

File tree

5 files changed

+13
-23
lines changed

5 files changed

+13
-23
lines changed
 

‎Cargo.lock

+4-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ url = { version = "2.5", features = ["serde", "expose_internals"] }
212212
uuid = { version = "1.3.0", features = ["v4"] }
213213
webpki-root-certs = "0.26.5"
214214
webpki-roots = "0.26"
215-
which = "4.2.5"
215+
which = "6"
216216
yoke = { version = "0.7.4", features = ["derive"] }
217217
zeromq = { version = "=0.4.1", default-features = false, features = ["tcp-transport", "tokio-runtime"] }
218218
zstd = "=0.12.4"

‎ext/node/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ errno = "0.2.8"
4949
faster-hex.workspace = true
5050
h2.workspace = true
5151
hkdf.workspace = true
52-
home = "0.5.9"
5352
http.workspace = true
5453
http-body-util.workspace = true
5554
hyper.workspace = true
@@ -93,7 +92,7 @@ simd-json = "0.14.0"
9392
sm3 = "0.4.2"
9493
spki.workspace = true
9594
stable_deref_trait = "1.2.0"
96-
sys_traits = { workspace = true, features = ["real"] }
95+
sys_traits = { workspace = true, features = ["real", "winapi", "libc"] }
9796
thiserror.workspace = true
9897
tokio.workspace = true
9998
tokio-eld = "0.2"

‎ext/node/ops/os/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::mem::MaybeUninit;
44

55
use deno_core::op2;
66
use deno_core::OpState;
7+
use sys_traits::EnvHomeDir;
78

89
use crate::NodePermissions;
910

@@ -282,5 +283,9 @@ where
282283
permissions.check_sys("homedir", "node:os.homedir()")?;
283284
}
284285

285-
Ok(home::home_dir().map(|path| path.to_string_lossy().to_string()))
286+
Ok(
287+
sys_traits::impls::RealSys
288+
.env_home_dir()
289+
.map(|path| path.to_string_lossy().to_string()),
290+
)
286291
}

‎runtime/permissions/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1510,11 +1510,10 @@ impl AllowRunDescriptor {
15101510
match which::which_in(text, std::env::var_os("PATH"), cwd) {
15111511
Ok(path) => path,
15121512
Err(err) => match err {
1513-
which::Error::BadAbsolutePath | which::Error::BadRelativePath => {
1513+
which::Error::CannotGetCurrentDirAndPathListEmpty => {
15141514
return Err(err);
15151515
}
15161516
which::Error::CannotFindBinaryPath
1517-
| which::Error::CannotGetCurrentDir
15181517
| which::Error::CannotCanonicalize => {
15191518
return Ok(AllowRunDescriptorParseResult::Unresolved(Box::new(err)))
15201519
}

0 commit comments

Comments
 (0)
Please sign in to comment.