Skip to content

Commit

Permalink
wasi: no longer require flag to enable wasi
Browse files Browse the repository at this point in the history
- no longer require flag to enable experimental wasi feature
- wasi is still documented as experimental

Signed-off-by: Michael Dawson <[email protected]>

PR-URL: #47286
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
mhdawson committed Mar 30, 2023
1 parent dad0b07 commit 978b57d
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 84 deletions.
4 changes: 4 additions & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,10 @@ added:
- v13.3.0
- v12.16.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/47286
description: This option is no longer required as WASI is
enabled by default, but can still be passed.
- version: v13.6.0
pr-url: https://github.com/nodejs/node/pull/30980
description: changed from `--experimental-wasi-unstable-preview0` to
Expand Down
3 changes: 0 additions & 3 deletions doc/api/wasi.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm`
$ wat2wasm demo.wat
```

The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
example to run.

## Class: `WASI`

<!-- YAML
Expand Down
3 changes: 2 additions & 1 deletion doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ Disable top-level await keyword support in REPL.
Enable experimental ES module support in VM module.
.
.It Fl -experimental-wasi-unstable-preview1
Enable experimental WebAssembly System Interface support.
Enable experimental WebAssembly System Interface support. This
flag is no longer required as WASI is enabled by default.
.
.It Fl -experimental-wasm-modules
Enable experimental WebAssembly module support.
Expand Down
8 changes: 0 additions & 8 deletions lib/internal/process/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ function prepareExecution(options) {

initializeSourceMapsHandlers();
initializeDeprecations();
initializeWASI();

require('internal/dns/utils').initializeDns();

Expand Down Expand Up @@ -596,13 +595,6 @@ function readPolicyFromDisk() {
}
}

function initializeWASI() {
const { BuiltinModule } = require('internal/bootstrap/loaders');
const mod = BuiltinModule.map.get('wasi');
mod.canBeRequiredByUsers =
getOptionValue('--experimental-wasi-unstable-preview1');
}

function initializeCJSLoader() {
const { initializeCJS } = require('internal/modules/cjs/loader');
initializeCJS();
Expand Down
6 changes: 2 additions & 4 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
kAllowedInEnvvar);
AddOption("--experimental-worker", "", NoOp{}, kAllowedInEnvvar);
AddOption("--experimental-report", "", NoOp{}, kAllowedInEnvvar);
AddOption("--experimental-wasi-unstable-preview1",
"experimental WASI support",
&EnvironmentOptions::experimental_wasi,
kAllowedInEnvvar);
AddOption(
"--experimental-wasi-unstable-preview1", "", NoOp{}, kAllowedInEnvvar);
AddOption("--expose-internals", "", &EnvironmentOptions::expose_internals);
AddOption("--frozen-intrinsics",
"experimental frozen intrinsics support",
Expand Down
1 change: 0 additions & 1 deletion src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ class EnvironmentOptions : public Options {

bool syntax_check_only = false;
bool has_eval_string = false;
bool experimental_wasi = false;
std::string eval_string;
bool print_eval = false;
bool force_repl = false;
Expand Down
48 changes: 0 additions & 48 deletions test/parallel/test-repl-built-in-modules.js

This file was deleted.

1 change: 0 additions & 1 deletion test/wasi/test-return-on-exit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-wasi-unstable-preview1
'use strict';
const common = require('../common');
const assert = require('assert');
Expand Down
1 change: 0 additions & 1 deletion test/wasi/test-wasi-initialize-validation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-wasi-unstable-preview1
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/wasi/test-wasi-not-started.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ if (process.argv[2] === 'wasi-child') {
const cp = require('child_process');

const child = cp.spawnSync(process.execPath, [
'--experimental-wasi-unstable-preview1',
__filename,
'wasi-child',
], {
Expand Down
2 changes: 0 additions & 2 deletions test/wasi/test-wasi-options-validation.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

// Flags: --experimental-wasi-unstable-preview1

require('../common');
const assert = require('assert');
const { WASI } = require('wasi');
Expand Down
9 changes: 0 additions & 9 deletions test/wasi/test-wasi-require-flag.js

This file was deleted.

1 change: 0 additions & 1 deletion test/wasi/test-wasi-start-validation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-wasi-unstable-preview1
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/wasi/test-wasi-stdio.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-wasi-unstable-preview1
'use strict';
const common = require('../common');
const tmpdir = require('../common/tmpdir');
Expand Down
1 change: 0 additions & 1 deletion test/wasi/test-wasi-symlinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ if (process.argv[2] === 'wasi-child') {
console.log('executing', options.test);
const opts = { env: { ...process.env, NODE_DEBUG_NATIVE: 'wasi' } };
const child = cp.spawnSync(process.execPath, [
'--experimental-wasi-unstable-preview1',
__filename,
'wasi-child',
options.test,
Expand Down
1 change: 0 additions & 1 deletion test/wasi/test-wasi-worker-terminate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-wasi-unstable-preview1
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/wasi/test-wasi.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ if (process.argv[2] === 'wasi-child-default') {

const child = cp.spawnSync(process.execPath, [
...args,
'--experimental-wasi-unstable-preview1',
__filename,
'wasi-child-' + flavor,
options.test,
Expand Down

0 comments on commit 978b57d

Please sign in to comment.