refactor: allow deno_permissions to compile to wasm32-unknown-unknown (#29487)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions

This commit is contained in:
David Sherret 2025-05-28 14:27:42 -04:00 committed by GitHub
parent 437afebf5c
commit cb23193f74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 411 additions and 106 deletions

View file

@ -254,7 +254,7 @@ pub enum ProcessError {
BorrowMut(std::cell::BorrowMutError),
#[class(generic)]
#[error(transparent)]
Which(which::Error),
Which(deno_permissions::which::Error),
#[class(type)]
#[error("Child process has already terminated.")]
ChildProcessAlreadyTerminated,
@ -800,9 +800,14 @@ fn resolve_cmd(cmd: &str, env: &RunEnv) -> Result<PathBuf, ProcessError> {
Ok(resolve_path(cmd, &env.cwd))
} else {
let path = env.envs.get(&EnvVarKey::new(OsString::from("PATH")));
match which::which_in(cmd, path, &env.cwd) {
match deno_permissions::which::which_in(
sys_traits::impls::RealSys,
cmd,
path.cloned(),
env.cwd.clone(),
) {
Ok(cmd) => Ok(cmd),
Err(which::Error::CannotFindBinaryPath) => {
Err(deno_permissions::which::Error::CannotFindBinaryPath) => {
Err(std::io::Error::from(std::io::ErrorKind::NotFound).into())
}
Err(err) => Err(ProcessError::Which(err)),