summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-09-03 10:07:02 +0100
committerGitHub <noreply@github.com>2024-09-03 11:07:02 +0200
commit71e4ac774bc18902a0d23f29d9b18b43b19bbbf2 (patch)
tree751a25bf46a9eb0c0ced483877e39c3bef7b4200 /runtime
parentbf7571a6f93659ef087ef529225642ce85e215d4 (diff)
BREAKING(unstable): drop support for Deno.run.{clearEnv,gid,uid} (#25371)
These are unstable options and the APIs is now deprecated. To limit amount of unstable flags we elected to have these APIs removed.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/js/40_process.js6
-rw-r--r--runtime/lib.rs3
-rw-r--r--runtime/ops/process.rs20
3 files changed, 2 insertions, 27 deletions
diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js
index 0f28b9d5c..b2269ffd6 100644
--- a/runtime/js/40_process.js
+++ b/runtime/js/40_process.js
@@ -133,10 +133,7 @@ class Process {
function run({
cmd,
cwd = undefined,
- clearEnv = false,
env = { __proto__: null },
- gid = undefined,
- uid = undefined,
stdout = "inherit",
stderr = "inherit",
stdin = "inherit",
@@ -155,10 +152,7 @@ function run({
const res = opRun({
cmd: ArrayPrototypeMap(cmd, String),
cwd,
- clearEnv,
env: ObjectEntries(env),
- gid,
- uid,
stdin,
stdout,
stderr,
diff --git a/runtime/lib.rs b/runtime/lib.rs
index 0b3abba3d..083acf657 100644
--- a/runtime/lib.rs
+++ b/runtime/lib.rs
@@ -99,10 +99,11 @@ pub static UNSTABLE_GRANULAR_FLAGS: &[UnstableGranularFlag] = &[
show_in_help: true,
id: 7,
},
+ // TODO(bartlomieju): consider removing it
UnstableGranularFlag {
name: ops::process::UNSTABLE_FEATURE_NAME,
help_text: "Enable unstable process APIs",
- show_in_help: true,
+ show_in_help: false,
id: 8,
},
UnstableGranularFlag {
diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs
index 25edfe662..11e439051 100644
--- a/runtime/ops/process.rs
+++ b/runtime/ops/process.rs
@@ -1,6 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-use super::check_unstable;
use deno_core::anyhow::Context;
use deno_core::error::type_error;
use deno_core::error::AnyError;
@@ -642,12 +641,7 @@ mod deprecated {
pub struct RunArgs {
cmd: Vec<String>,
cwd: Option<String>,
- clear_env: bool,
env: Vec<(String, String)>,
- #[cfg(unix)]
- gid: Option<u32>,
- #[cfg(unix)]
- uid: Option<u32>,
stdin: StdioOrRid,
stdout: StdioOrRid,
stderr: StdioOrRid,
@@ -700,25 +694,11 @@ mod deprecated {
});
cwd.map(|d| c.current_dir(d));
- if run_args.clear_env {
- super::check_unstable(state, UNSTABLE_FEATURE_NAME, "Deno.run.clearEnv");
- c.env_clear();
- }
for (key, value) in &env {
c.env(key, value);
}
#[cfg(unix)]
- if let Some(gid) = run_args.gid {
- super::check_unstable(state, UNSTABLE_FEATURE_NAME, "Deno.run.gid");
- c.gid(gid);
- }
- #[cfg(unix)]
- if let Some(uid) = run_args.uid {
- super::check_unstable(state, UNSTABLE_FEATURE_NAME, "Deno.run.uid");
- c.uid(uid);
- }
- #[cfg(unix)]
// TODO(bartlomieju):
#[allow(clippy::undocumented_unsafe_blocks)]
unsafe {