Skip to content

BREAKING CHANGE: Remove support for WASI #2439

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

Merged
merged 7 commits into from
Aug 20, 2022
Merged
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: 2 additions & 2 deletions cli/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@
"category": "Features",
"description": [
"Exports the start function using the specified name instead",
"of calling it implicitly. Useful for WASI or to obtain the",
"exported memory before executing any code accessing it."
"of calling it implicitly. Useful to obtain the exported memory",
"before executing any code accessing it."
],
"type": "s"
},
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"watch": "node scripts/build --watch",
"test": "npm run test:parser && npm run test:compiler -- --parallel && npm run test:browser && npm run test:asconfig && npm run test:transform",
"test:parser": "node --enable-source-maps tests/parser",
"test:compiler": "node --enable-source-maps --experimental-wasi-unstable-preview1 --no-warnings tests/compiler",
"test:compiler": "node --enable-source-maps --no-warnings tests/compiler",
"test:browser": "node --enable-source-maps tests/browser",
"test:asconfig": "cd tests/asconfig && npm run test",
"test:transform": "npm run test:transform:esm && npm run test:transform:cjs",
Expand Down
5 changes: 0 additions & 5 deletions src/builtins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,11 +734,6 @@ export namespace BuiltinNames {
export const String_eq = "~lib/string/String.__eq";
export const String_ne = "~lib/string/String.__ne";
export const String_not = "~lib/string/String.__not";

// std/bindings/wasi.ts
export const wasiAbort = "~lib/wasi/index/abort";
export const wasiTrace = "~lib/wasi/index/trace";
export const wasiSeed = "~lib/wasi/index/seed";
}

/** Builtin compilation context. */
Expand Down
1 change: 0 additions & 1 deletion src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ export namespace CommonNames {
export const ASC_SHRINK_LEVEL = "ASC_SHRINK_LEVEL";
export const ASC_LOW_MEMORY_LIMIT = "ASC_LOW_MEMORY_LIMIT";
export const ASC_EXPORT_RUNTIME = "ASC_EXPORT_RUNTIME";
export const ASC_WASI = "ASC_WASI";
export const ASC_FEATURE_SIGN_EXTENSION = "ASC_FEATURE_SIGN_EXTENSION";
export const ASC_FEATURE_MUTABLE_GLOBALS = "ASC_FEATURE_MUTABLE_GLOBALS";
export const ASC_FEATURE_NONTRAPPING_F2I = "ASC_FEATURE_NONTRAPPING_F2I";
Expand Down
5 changes: 0 additions & 5 deletions src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -760,11 +760,6 @@ export class Compiler extends DiagnosticEmitter {
// compile the start function if not empty or if explicitly requested
var startIsEmpty = !startFunctionBody.length;
var exportStart = options.exportStart;
if (program.isWasi && !exportStart) {
// Try to do the right thing for WASI. If the module has custom function
// exports it is likely a reactor, otherwise it is likely a command.
exportStart = this.hasCustomFunctionExports ? "_initialize" : "_start";
}
if (!startIsEmpty || exportStart != null) {
let signature = startFunctionInstance.signature;
if (!startIsEmpty && exportStart != null) {
Expand Down
24 changes: 3 additions & 21 deletions src/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,11 +781,6 @@ export class Program extends DiagnosticEmitter {

// Utility

/** Tests whether this is a WASI program. */
get isWasi(): bool {
return this.elementsByName.has(CommonNames.ASC_WASI);
}

/** Obtains the source matching the specified internal path. */
getSource(internalPath: string): string | null {
var sources = this.sources;
Expand Down Expand Up @@ -1401,27 +1396,14 @@ export class Program extends DiagnosticEmitter {
{
let globalAliases = options.globalAliases;
if (!globalAliases) globalAliases = new Map();
let isWasi = this.isWasi;
if (!globalAliases.has(CommonNames.abort)) {
globalAliases.set(CommonNames.abort,
isWasi
? BuiltinNames.wasiAbort
: BuiltinNames.abort
);
globalAliases.set(CommonNames.abort, BuiltinNames.abort);
}
if (!globalAliases.has(CommonNames.trace)) {
globalAliases.set(CommonNames.trace,
isWasi
? BuiltinNames.wasiTrace
: BuiltinNames.trace
);
globalAliases.set(CommonNames.trace, BuiltinNames.trace);
}
if (!globalAliases.has(CommonNames.seed)) {
globalAliases.set(CommonNames.seed,
isWasi
? BuiltinNames.wasiSeed
: BuiltinNames.seed
);
globalAliases.set(CommonNames.seed, BuiltinNames.seed);
}
if (!globalAliases.has(CommonNames.Math)) {
globalAliases.set(CommonNames.Math, CommonNames.NativeMath);
Expand Down
6 changes: 0 additions & 6 deletions std/assembly/bindings/wasi.ts

This file was deleted.

Loading