Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasi: no longer require flag to enable wasi #47286

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
targos marked this conversation as resolved.
Show resolved Hide resolved
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