Skip to content

Commit aae46f6

Browse files
authored
Update starlingmonkey to 0.2.0 (#285)
1 parent af35a08 commit aae46f6

File tree

18 files changed

+56
-239
lines changed

18 files changed

+56
-239
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ jobs:
8787
build-type:
8888
- 'release'
8989
- 'debug'
90-
- 'weval'
9190
steps:
9291
- uses: actions/checkout@v4
9392
with:
@@ -159,7 +158,6 @@ jobs:
159158
build-type:
160159
- 'release'
161160
- 'debug'
162-
- 'weval'
163161
steps:
164162
- uses: actions/checkout@v4
165163

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ examples/hello-world/guest/package-lock.json
1010
examples/hello-world/guest/hello.component.wasm
1111
/build-debug
1212
/build-release
13-
/build-release-weval
1413
.vscode
1514
/package-lock.json
1615
.idea

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,10 @@ set(EMBEDDING_DEP "starling-raw.wasm")
2626
# Define output filenames based on build configuration
2727
set(OUTPUT_NAME_RELEASE "starlingmonkey_embedding.wasm")
2828
set(OUTPUT_NAME_DEBUG "starlingmonkey_embedding.debug.wasm")
29-
set(OUTPUT_NAME_WEVAL "starlingmonkey_embedding_weval.wasm")
3029

3130
# Set the appropriate name based on current configuration
3231
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
3332
set(OUTPUT_FILENAME ${OUTPUT_NAME_DEBUG})
34-
elseif(WEVAL)
35-
set(OUTPUT_FILENAME ${OUTPUT_NAME_WEVAL})
36-
set(EMBEDDING_DEP "starling-ics.wevalcache")
3733
else()
3834
set(OUTPUT_FILENAME ${OUTPUT_NAME_RELEASE})
3935
endif()

Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ STARLINGMONKEY_DEPS = $(STARLINGMONKEY_SRC)/cmake/* embedding/* $(STARLINGMONKEY
1515
all: release
1616
debug: lib/starlingmonkey_embedding.debug.wasm lib/spidermonkey-embedding-splicer.js
1717
release: lib/starlingmonkey_embedding.wasm lib/spidermonkey-embedding-splicer.js
18-
release-weval: lib/starlingmonkey_ics.wevalcache lib/spidermonkey-embedding-splicer.js
1918

2019
lib/spidermonkey-embedding-splicer.js: target/wasm32-wasip1/release/splicer_component.wasm crates/spidermonkey-embedding-splicer/wit/spidermonkey-embedding-splicer.wit | obj lib
2120
@$(JCO) new target/wasm32-wasip1/release/splicer_component.wasm -o obj/spidermonkey-embedding-splicer.wasm --wasi-reactor
@@ -28,12 +27,6 @@ lib/starlingmonkey_embedding.wasm: $(STARLINGMONKEY_DEPS) | lib
2827
cmake -B build-release -DCMAKE_BUILD_TYPE=Release
2928
make -j16 -C build-release starlingmonkey_embedding
3029

31-
lib/starlingmonkey_embedding_weval.wasm: $(STARLINGMONKEY_DEPS) | lib
32-
cmake -B build-release-weval -DCMAKE_BUILD_TYPE=Release -DUSE_WASM_OPT=OFF -DWEVAL=ON
33-
make -j16 -C build-release-weval starlingmonkey_embedding
34-
35-
lib/starlingmonkey_ics.wevalcache: lib/starlingmonkey_embedding_weval.wasm
36-
@cp build-release-weval/starling-raw.wasm/starling-ics.wevalcache $@
3730

3831
lib/starlingmonkey_embedding.debug.wasm: $(STARLINGMONKEY_DEPS) | lib
3932
cmake -B build-debug -DCMAKE_BUILD_TYPE=RelWithDebInfo

README.md

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,25 @@ Establishing this initial prototype as a singular flexible engine foundation tha
5151

5252
### Weval AOT Compilation
5353

54+
Note: unfortunately Weval AOT Compilation is disabled for the time being, due to incompatibilities with newer versions of the LLVM toolchain used to compile StarlingMonkey. See [this](https://bytecodealliance.zulipchat.com/#narrow/channel/459697-StarlingMonkey/topic/Updating.20Gecko.20version/near/527089464) and the following messages for details.
5455

5556
## Platform APIs
5657

5758
The following APIs are available:
5859

5960
* **Legacy Encoding**: `atob`, `btoa`, `decodeURI`, `encodeURI`, `decodeURIComponent`, `encodeURIComponent`
6061
* **Streams**: `ReadableStream`, `ReadableStreamBYOBReader`, `ReadableStreamBYOBRequest`, `ReadableStreamDefaultReader`, `ReadableStreamDefaultController`, `ReadableByteStreamController`, `WritableStream` `ByteLengthQueuingStrategy` `CountQueuingStrategy`, `TransformStream`
61-
* **URL**: `URL` `URLSearchParams`
62+
* **URL**: `URL`, `URLSearchParams`
6263
* **Console**: `console`
6364
* **Performance**: `Performance`
6465
* **Task**: `queueMicrotask`, `setInterval` `setTimeout` `clearInterval` `clearTimeout`
6566
* **Location**: `WorkerLocation`, `location`
6667
* **Encoding**: `TextEncoder`, `TextDecoder`, `CompressionStream`, `DecompressionStream`
6768
* **Structured Clone**: `structuredClone`
68-
* **Fetch**: `fetch` `Request` `Response` `Headers`
69+
* **Fetch**: `fetch`, `Request`, `Response`, `Headers`
6970
* **Forms, Files, and Blobs**: `FormData`, `MultipartFormData`, `File`, `Blob`
70-
* **Crypto**: `SubtleCrypto` `Crypto` `crypto` `CryptoKey`
71+
* **Crypto**: `SubtleCrypto`, `Crypto`, `crypto`, `CryptoKey`
72+
* **Abort**: `AbortController`, `AbortSignal`
7173

7274
## Usage
7375

@@ -106,23 +108,7 @@ See [types.d.ts](types.d.ts) for the full interface options.
106108

107109
The component itself can be executed in any component runtime, see the [example](EXAMPLE.md) for an end to end workflow in Wasmtime.
108110

109-
### AOT Compilation
110-
111-
To enable AOT compilation, set the `enableAot: true` option to run [Weval][weval] ahead-of-time compilation.
112-
113-
AOT compilation can also be configured with the following options:
114-
115-
| Option | Type | Example | Description |
116-
|------------------------|-------------------------------------|-----------------|--------------------------------------------------------------------------|
117-
| `aotMinStackSizeBytes` | `nubmer | Number | bigint | BigInt` | `2_007_846_092` | The minimum stack size (via `RUST_MIN_STACK` to set when running `weval` |
118-
119-
[weval]: https://github.com/bytecodealliance/weval
120-
121-
### Custom `weval` binary for AOT
122-
123-
To use a custom (pre-downloaded) [`weval`][weval] binary, set the `wevalBin` option to the path to your desired weval binary.
124-
125-
### Custom `wizer` binary when AOT is disabled
111+
### Custom `wizer` binary
126112

127113
To use a custom (pre-downloaded) [`wizer`](https://github.com/bytecodealliance/wizer) binary, set the `wizerBin` option to the path to your desired wizer binary.
128114

@@ -229,18 +215,6 @@ export function componentize(opts: {
229215
* Path to custom ComponentizeJS engine build to use
230216
*/
231217
engine?: string;
232-
/**
233-
* Path to custom weval cache to use
234-
*/
235-
aotCache?: string;
236-
/**
237-
* Enable AoT using weval
238-
*/
239-
enableAot?: boolean;
240-
/**
241-
* Use a pre-existing path to the `weval` binary, if present
242-
*/
243-
wevalBin?: string;
244218
/**
245219
* Use a pre-existing path to the `wizer` binary, if present
246220
*/
@@ -266,7 +240,7 @@ export function componentize(opts: {
266240
*/
267241
enableFeatures?: [];
268242
/**
269-
* Pass environment variables to the spawned Wizer or Weval Process
243+
* Pass environment variables to the spawned Wizer Process
270244
* If set to true, all host environment variables are passed
271245
* To pass only a subset, provide an object with the desired variables
272246
*/
@@ -345,14 +319,6 @@ npm install
345319
npm run build
346320
```
347321

348-
Before being able to use `componetize-js` (ex. via `npm link`, from `jco`), you'll need to run:
349-
350-
```
351-
npm run build:weval
352-
```
353-
354-
This will produce a few files, most importantly `lib/starlingmonkey_embedding_weval.wasm`.
355-
356322
To clean up a local installation (i.e. remove the installation of StarlingMonkey):
357323

358324
```console

StarlingMonkey

Submodule StarlingMonkey updated 207 files

examples/hello-world/guest/componentize.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ import { resolve } from 'node:path';
33

44
import { componentize } from '@bytecodealliance/componentize-js';
55

6-
// AoT compilation makes use of weval (https://github.com/bytecodealliance/weval)
7-
const enableAot = process.env.ENABLE_AOT == '1';
8-
96
const jsSource = await readFile('hello.js', 'utf8');
107

118
const { component } = await componentize(jsSource, {
129
witPath: resolve('hello.wit'),
13-
enableAot
1410
});
1511

1612
await writeFile('hello.component.wasm', component);

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
},
2323
"dependencies": {
2424
"@bytecodealliance/jco": "^1.9.1",
25-
"@bytecodealliance/weval": "^0.3.4",
2625
"@bytecodealliance/wizer": "^10.0.0",
2726
"es-module-lexer": "^1.6.0",
2827
"oxc-parser": "^0.76.0"
@@ -31,13 +30,11 @@
3130
"scripts": {
3231
"clean": "npm run clean:starlingmonkey",
3332
"clean:starlingmonkey": "rm -rf build-release",
34-
"build": "npm run build:release && npm run build:debug && npm run build:weval",
33+
"build": "npm run build:release && npm run build:debug",
3534
"build:release": "make release",
36-
"build:weval": "make release-weval",
3735
"build:debug": "make debug",
3836
"test": "vitest run -c test/vitest.ts",
3937
"test:release": "vitest run -c test/vitest.ts",
40-
"test:weval": "cross-env WEVAL_TEST=1 vitest run -c test/vitest.ts",
4138
"test:debug": "cross-env DEBUG_TEST=1 vitest run -c test/vitest.ts",
4239
"prepack": "node scripts/prepack.mjs"
4340
},
@@ -46,12 +43,10 @@
4643
"lib/spidermonkey-*",
4744
"lib/starlingmonkey_embedding.wasm",
4845
"lib/starlingmonkey_embedding.debug.wasm",
49-
"lib/starlingmonkey_embedding_weval.wasm",
50-
"lib/starlingmonkey_ics.wevalcache",
5146
"src",
5247
"types.d.ts"
5348
],
5449
"workspaces": [
5550
"."
5651
]
57-
}
52+
}

src/cli.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export async function componentizeCmd(jsSource, opts) {
1111
witPath: resolve(opts.wit),
1212
worldName: opts.worldName,
1313
runtimeArgs: opts.runtimeArgs,
14-
enableAot: opts.aot,
1514
disableFeatures: opts.disable,
1615
preview2Adapter: opts.preview2Adapter,
1716
debugBindings: opts.debugBindings,
@@ -29,7 +28,6 @@ program
2928
.requiredOption('-w, --wit <path>', 'WIT path to build with')
3029
.option('-n, --world-name <name>', 'WIT world to build')
3130
.option('--runtime-args <string>', 'arguments to pass to the runtime')
32-
.option('--aot', 'enable AOT compilation')
3331
.addOption(
3432
new Option('-d, --disable <feature...>', 'disable WASI features').choices(
3533
DEFAULT_FEATURES,

0 commit comments

Comments
 (0)