Skip to content

Commit

Permalink
chore: remove the requirement of bootstrap (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrCai0907 authored Nov 3, 2024
1 parent 2705fe8 commit 4d7962f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 106 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,6 @@ jobs:
run: npm run build
- name: Test
run: npm test
bootstrap:
name: "Bootstrap (${{ matrix.target }})"
runs-on: ubuntu-latest
needs: check
strategy:
matrix:
target: ["debug", "release"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: current
- name: Install dependencies
run: npm ci --no-audit
- name: Build
run: npm run build
- name: "Bootstrap ${{ matrix.target }}"
run: npm run bootstrap:${{ matrix.target }}
- name: "Test ${{ matrix.target }}"
run: npm run test:compiler -- --wasm build/assemblyscript.${{ matrix.target }}-bootstrap.js
- name: "Compile ${{ matrix.target }} -> ${{ matrix.target == 'debug' && 'release' || 'debug' }}"
run: node bin/asc --config src/asconfig.json --target ${{ matrix.target == 'debug' && 'release' || 'debug' }}-bootstrap --wasm ./build/assemblyscript.${{ matrix.target }}-bootstrap.js
- name: "Test ${{ matrix.target == 'debug' && 'release' || 'debug' }}"
run: npm run test:compiler -- --wasm build/assemblyscript.${{ matrix.target == 'debug' && 'release' || 'debug' }}-bootstrap.js
features:
name: "Features"
runs-on: ubuntu-latest
Expand Down
10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,7 @@
"test:transform": "npm run test:transform:esm && npm run test:transform:cjs",
"test:transform:esm": "node bin/asc tests/compiler/empty --transform ./tests/transform/index.js --noEmit && node bin/asc tests/compiler/empty --transform ./tests/transform/simple.js --noEmit",
"test:transform:cjs": "node bin/asc tests/compiler/empty --transform ./tests/transform/cjs/index.js --noEmit && node bin/asc tests/compiler/empty --transform ./tests/transform/cjs/simple.js --noEmit",
"test:cli": "node tests/cli/options.js",
"asbuild": "npm run asbuild:debug && npm run asbuild:release",
"asbuild:debug": "node bin/asc --config src/asconfig.json --target debug",
"asbuild:release": "node bin/asc --config src/asconfig.json --target release",
"asbuild:rtraced": "node bin/asc --config src/asconfig.json --target rtraced",
"bootstrap": "npm run bootstrap:debug && npm run bootstrap:release",
"bootstrap:debug": "node bin/asc --config src/asconfig.json --target debug && node bin/asc --config src/asconfig.json --target debug-bootstrap --wasm ./build/assemblyscript.debug.js && node bin/asc --config src/asconfig.json --target debug-bootstrap --wasm ./build/assemblyscript.debug-bootstrap.js && git --no-pager diff --no-index build/assemblyscript.debug.wast build/assemblyscript.debug-bootstrap.wast",
"bootstrap:release": "node bin/asc --config src/asconfig.json --target release && node bin/asc --config src/asconfig.json --target release-bootstrap --wasm ./build/assemblyscript.release.js && node bin/asc --config src/asconfig.json --target release-bootstrap --wasm ./build/assemblyscript.release-bootstrap.js && git --no-pager diff --no-index build/assemblyscript.release.wast build/assemblyscript.release-bootstrap.wast",
"bootstrap:rtraced": "node bin/asc --config src/asconfig.json --target rtraced && node bin/asc --config src/asconfig.json --target rtraced --wasm ./build/assemblyscript.rtraced.js"
"test:cli": "node tests/cli/options.js"
},
"files": [
"bin/",
Expand Down
7 changes: 0 additions & 7 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,3 @@ Various scripts for development purposes.
| npm run watch | Builds the compiler and watches for changes |
| npm run check | Performs sanity checks on code style etc. |
| npm test | Runs the test suite |

### WebAssembly target

| Command | Description |
| ----------------- | -------------------------------------- |
| npm run asbuild | Compiles the compiler to WebAssembly |
| npm run bootstrap | Bootstraps the compiler to WebAssembly |
22 changes: 0 additions & 22 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,3 @@ The rebuild automatically when there are changes, do:
```sh
npm run watch
```

### Building to WebAssembly

To build the compiler to a WebAssembly binary, run:

```sh
npm run bootstrap
```

Uses the AssemblyScript compiler compiled to JavaScript to compile itself to WebAssembly, building to WebAssembly again using itself compiled to WebAssembly. Builds to `build/`. Performs a `git diff` to make sure that both the initial and the final artifacts are the same. Note that this builds the compiler as a library, while the `asc` frontend setting it up and feeding it source files is JavaScript for now.

Running `asc` with the WebAssembly variant:

```ts
asc [options...] --wasm build/assemblyscript.release-bootstrap.js
```

Running the compiler tests with the WebAssembly variant:

```ts
npm run test:compiler -- --wasm build/assemblyscript.release-bootstrap.js
```
44 changes: 0 additions & 44 deletions src/asconfig.json

This file was deleted.

0 comments on commit 4d7962f

Please sign in to comment.