From 83642976bf267c81f36742793a5a4a9250f54591 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 25 Jan 2023 12:28:08 -0500 Subject: [PATCH] fix: remove leftover Deno.spawn references (#17524) --- cli/tests/integration/run_tests.rs | 10 ++--- cli/tsc/diagnostics.rs | 4 -- cli/tsc/dts/lib.deno.unstable.d.ts | 67 +----------------------------- runtime/js/90_deno_ns.js | 3 -- runtime/ops/spawn.rs | 6 +-- 5 files changed, 9 insertions(+), 81 deletions(-) diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 2494df8811..fd6e6588c1 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -202,7 +202,7 @@ itest!(_044_bad_resource { exit_code: 1, }); -// TODO(bartlomieju): remove --unstable once Deno.spawn is stabilized +// TODO(bartlomieju): remove --unstable once Deno.Command is stabilized itest!(_045_proxy { args: "run -L debug --unstable --allow-net --allow-env --allow-run --allow-read --reload --quiet run/045_proxy_test.ts", output: "run/045_proxy_test.ts.out", @@ -537,7 +537,7 @@ itest!(_088_dynamic_import_already_evaluating { output: "run/088_dynamic_import_already_evaluating.ts.out", }); -// TODO(bartlomieju): remove --unstable once Deno.spawn is stabilized +// TODO(bartlomieju): remove --unstable once Deno.Command is stabilized itest!(_089_run_allow_list { args: "run --unstable --allow-run=curl run/089_run_allow_list.ts", output: "run/089_run_allow_list.ts.out", @@ -625,7 +625,7 @@ itest!(private_field_presence_no_check { output: "run/private_field_presence.ts.out", }); -// TODO(bartlomieju): remove --unstable once Deno.spawn is stabilized +// TODO(bartlomieju): remove --unstable once Deno.Command is stabilized itest!(lock_write_fetch { args: "run --quiet --allow-read --allow-write --allow-env --allow-run --unstable run/lock_write_fetch/main.ts", @@ -1916,7 +1916,7 @@ fn dont_cache_on_check_fail() { mod permissions { use test_util as util; - // TODO(bartlomieju): remove --unstable once Deno.spawn is stabilized + // TODO(bartlomieju): remove --unstable once Deno.Command is stabilized #[test] fn with_allow() { for permission in &util::PERMISSION_VARIANTS { @@ -1935,7 +1935,7 @@ mod permissions { } } - // TODO(bartlomieju): remove --unstable once Deno.spawn is stabilized + // TODO(bartlomieju): remove --unstable once Deno.Command is stabilized #[test] fn without_allow() { for permission in &util::PERMISSION_VARIANTS { diff --git a/cli/tsc/diagnostics.rs b/cli/tsc/diagnostics.rs index b3026d9347..ffb4a946dc 100644 --- a/cli/tsc/diagnostics.rs +++ b/cli/tsc/diagnostics.rs @@ -29,12 +29,8 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[ "removeSignalListener", "shutdown", "umask", - "spawnChild", "Child", "ChildProcess", - "spawn", - "spawnSync", - "SpawnOptions", "ChildStatus", "SpawnOutput", "command", diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index 12186c0b3e..5ffde749b6 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -1407,71 +1407,6 @@ declare namespace Deno { */ export function upgradeHttpRaw(request: Request): [Deno.Conn, Uint8Array]; - /** **UNSTABLE**: New API, yet to be vetted. - * - * @deprecated Use the Deno.Command API instead. - * - * Options which can be set when calling {@linkcode Deno.spawn}, - * {@linkcode Deno.spawnSync}, and {@linkcode Deno.spawnChild}. - * - * @category Sub Process - */ - export interface SpawnOptions { - /** Arguments to pass to the process. */ - args?: string[]; - /** - * The working directory of the process. - * - * If not specified, the `cwd` of the parent process is used. - */ - cwd?: string | URL; - /** - * Clear environmental variables from parent process. - * - * Doesn't guarantee that only `env` variables are present, as the OS may - * set environmental variables for processes. - * - * @default {false} - */ - clearEnv?: boolean; - /** Environmental variables to pass to the subprocess. */ - env?: Record; - /** - * Sets the child process’s user ID. This translates to a setuid call in the - * child process. Failure in the set uid call will cause the spawn to fail. - */ - uid?: number; - /** Similar to `uid`, but sets the group ID of the child process. */ - gid?: number; - /** - * An {@linkcode AbortSignal} that allows closing the process using the - * corresponding {@linkcode AbortController} by sending the process a - * SIGTERM signal. - * - * Not supported in {@linkcode Deno.spawnSync}. - */ - signal?: AbortSignal; - - /** How `stdin` of the spawned process should be handled. - * - * Defaults to `"null"`. */ - stdin?: "piped" | "inherit" | "null"; - /** How `stdout` of the spawned process should be handled. - * - * Defaults to `"piped". */ - stdout?: "piped" | "inherit" | "null"; - /** How `stderr` of the spawned process should be handled. - * - * Defaults to `"piped"`. */ - stderr?: "piped" | "inherit" | "null"; - - /** Skips quoting and escaping of the arguments on windows. This option - * is ignored on non-windows platforms. - * - * @default {false} */ - windowsRawArguments?: boolean; - } - /** **UNSTABLE**: New API, yet to be vetted. * * Create a child process. @@ -1634,7 +1569,7 @@ declare namespace Deno { * corresponding {@linkcode AbortController} by sending the process a * SIGTERM signal. * - * Not supported in {@linkcode Deno.spawnSync}. + * Not supported in {@linkcode Deno.Command.outputSync}. */ signal?: AbortSignal; diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index f18593df76..d2c76e0039 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -146,9 +146,6 @@ funlockSync: __bootstrap.fs.funlockSync, Child: __bootstrap.spawn.Child, ChildProcess: __bootstrap.spawn.ChildProcess, - spawnChild: __bootstrap.spawn.spawnChild, - spawn: __bootstrap.spawn.spawn, - spawnSync: __bootstrap.spawn.spawnSync, Command: __bootstrap.spawn.Command, serve: __bootstrap.flash.serve, upgradeHttp: __bootstrap.http.upgradeHttp, diff --git a/runtime/ops/spawn.rs b/runtime/ops/spawn.rs index e5bf10cf05..e5454371e2 100644 --- a/runtime/ops/spawn.rs +++ b/runtime/ops/spawn.rs @@ -193,7 +193,7 @@ fn create_command( args: SpawnArgs, api_name: &str, ) -> Result { - super::check_unstable(state, "Deno.spawn"); + super::check_unstable(state, "Deno.Command"); state .borrow_mut::() .check_run(&args.cmd, api_name)?; @@ -223,12 +223,12 @@ fn create_command( #[cfg(unix)] if let Some(gid) = args.gid { - super::check_unstable(state, "Deno.spawn.gid"); + super::check_unstable(state, "Deno.CommandOptions.gid"); command.gid(gid); } #[cfg(unix)] if let Some(uid) = args.uid { - super::check_unstable(state, "Deno.spawn.uid"); + super::check_unstable(state, "Deno.CommandOptions.uid"); command.uid(uid); } #[cfg(unix)]