Skip to content

Commit 9f21bf3

Browse files
authored
BREAKING CHANGE: Remove support for WASI (#2439)
1 parent 11094c5 commit 9f21bf3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+34
-46370
lines changed

cli/options.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@
157157
"category": "Features",
158158
"description": [
159159
"Exports the start function using the specified name instead",
160-
"of calling it implicitly. Useful for WASI or to obtain the",
161-
"exported memory before executing any code accessing it."
160+
"of calling it implicitly. Useful to obtain the exported memory",
161+
"before executing any code accessing it."
162162
],
163163
"type": "s"
164164
},

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"watch": "node scripts/build --watch",
7373
"test": "npm run test:parser && npm run test:compiler -- --parallel && npm run test:browser && npm run test:asconfig && npm run test:transform",
7474
"test:parser": "node --enable-source-maps tests/parser",
75-
"test:compiler": "node --enable-source-maps --experimental-wasi-unstable-preview1 --no-warnings tests/compiler",
75+
"test:compiler": "node --enable-source-maps --no-warnings tests/compiler",
7676
"test:browser": "node --enable-source-maps tests/browser",
7777
"test:asconfig": "cd tests/asconfig && npm run test",
7878
"test:transform": "npm run test:transform:esm && npm run test:transform:cjs",

src/builtins.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -734,11 +734,6 @@ export namespace BuiltinNames {
734734
export const String_eq = "~lib/string/String.__eq";
735735
export const String_ne = "~lib/string/String.__ne";
736736
export const String_not = "~lib/string/String.__not";
737-
738-
// std/bindings/wasi.ts
739-
export const wasiAbort = "~lib/wasi/index/abort";
740-
export const wasiTrace = "~lib/wasi/index/trace";
741-
export const wasiSeed = "~lib/wasi/index/seed";
742737
}
743738

744739
/** Builtin compilation context. */

src/common.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ export namespace CommonNames {
169169
export const ASC_SHRINK_LEVEL = "ASC_SHRINK_LEVEL";
170170
export const ASC_LOW_MEMORY_LIMIT = "ASC_LOW_MEMORY_LIMIT";
171171
export const ASC_EXPORT_RUNTIME = "ASC_EXPORT_RUNTIME";
172-
export const ASC_WASI = "ASC_WASI";
173172
export const ASC_FEATURE_SIGN_EXTENSION = "ASC_FEATURE_SIGN_EXTENSION";
174173
export const ASC_FEATURE_MUTABLE_GLOBALS = "ASC_FEATURE_MUTABLE_GLOBALS";
175174
export const ASC_FEATURE_NONTRAPPING_F2I = "ASC_FEATURE_NONTRAPPING_F2I";

src/compiler.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,6 @@ export class Compiler extends DiagnosticEmitter {
762762
// compile the start function if not empty or if explicitly requested
763763
var startIsEmpty = !startFunctionBody.length;
764764
var exportStart = options.exportStart;
765-
if (program.isWasi && !exportStart) {
766-
// Try to do the right thing for WASI. If the module has custom function
767-
// exports it is likely a reactor, otherwise it is likely a command.
768-
exportStart = this.hasCustomFunctionExports ? "_initialize" : "_start";
769-
}
770765
if (!startIsEmpty || exportStart != null) {
771766
let signature = startFunctionInstance.signature;
772767
if (!startIsEmpty && exportStart != null) {

src/program.ts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -781,11 +781,6 @@ export class Program extends DiagnosticEmitter {
781781

782782
// Utility
783783

784-
/** Tests whether this is a WASI program. */
785-
get isWasi(): bool {
786-
return this.elementsByName.has(CommonNames.ASC_WASI);
787-
}
788-
789784
/** Obtains the source matching the specified internal path. */
790785
getSource(internalPath: string): string | null {
791786
var sources = this.sources;
@@ -1401,27 +1396,14 @@ export class Program extends DiagnosticEmitter {
14011396
{
14021397
let globalAliases = options.globalAliases;
14031398
if (!globalAliases) globalAliases = new Map();
1404-
let isWasi = this.isWasi;
14051399
if (!globalAliases.has(CommonNames.abort)) {
1406-
globalAliases.set(CommonNames.abort,
1407-
isWasi
1408-
? BuiltinNames.wasiAbort
1409-
: BuiltinNames.abort
1410-
);
1400+
globalAliases.set(CommonNames.abort, BuiltinNames.abort);
14111401
}
14121402
if (!globalAliases.has(CommonNames.trace)) {
1413-
globalAliases.set(CommonNames.trace,
1414-
isWasi
1415-
? BuiltinNames.wasiTrace
1416-
: BuiltinNames.trace
1417-
);
1403+
globalAliases.set(CommonNames.trace, BuiltinNames.trace);
14181404
}
14191405
if (!globalAliases.has(CommonNames.seed)) {
1420-
globalAliases.set(CommonNames.seed,
1421-
isWasi
1422-
? BuiltinNames.wasiSeed
1423-
: BuiltinNames.seed
1424-
);
1406+
globalAliases.set(CommonNames.seed, BuiltinNames.seed);
14251407
}
14261408
if (!globalAliases.has(CommonNames.Math)) {
14271409
globalAliases.set(CommonNames.Math, CommonNames.NativeMath);

std/assembly/bindings/wasi.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)