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 <mdawson@devrus.com>

PR-URL: #47286
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
mhdawson authored and danielleadams committed Jul 6, 2023
1 parent b1bcdce commit 58afcc2
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 @@ -466,6 +466,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 @@ -103,9 +103,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 @@ -179,7 +179,8 @@ Select extension resolution algorithm for ES Modules; either 'explicit' (default
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 @@ -70,7 +70,6 @@ function prepareExecution(options) {
initializeReport();
initializeSourceMapsHandlers();
initializeDeprecations();
initializeWASI();
require('internal/dns/utils').initializeDns();

if (isMainThread) {
Expand Down Expand Up @@ -532,13 +531,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 CJSLoader = require('internal/modules/cjs/loader');
if (!getEmbedderOptions().noGlobalSearchPaths) {
Expand Down
6 changes: 2 additions & 4 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,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 @@ -185,7 +185,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 @@ -49,7 +49,6 @@ if (process.argv[2] === 'wasi-child') {
opts.input = options.stdin;

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

0 comments on commit 58afcc2

Please sign in to comment.