Skip to content

Commit e05fcbf

Browse files
Rename compiler wasm artifact compiler_lib.wasm -> compiler.wasm
Renames the [lib] to "compiler" so the cdylib output is compiler.wasm, and updates all references (CI actions, cli build, runtime, demo, docs, tests) plus the inter-job artifact name compiler_lib_wasm -> compiler_wasm.
1 parent cbb012d commit e05fcbf

35 files changed

Lines changed: 84 additions & 84 deletions

File tree

.github/actions/cdn-deploy/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ runs:
1515
- name: Download compiler wasm
1616
uses: actions/download-artifact@v8
1717
with:
18-
name: compiler_lib_wasm
18+
name: compiler_wasm
1919
path: /tmp/compiler/
2020

2121
- name: Download std artifacts
@@ -38,11 +38,11 @@ runs:
3838
mkdir -p _site/compiler _site/runtime _site/std _site/host _site/cli
3939
4040
# compiler: the wasm module.
41-
cp /tmp/compiler/compiler_lib.wasm _site/compiler/
41+
cp /tmp/compiler/compiler.wasm _site/compiler/
4242
4343
# runtime: JS sources plus the wasm it bundles.
4444
cp -r runtime/. _site/runtime/
45-
cp /tmp/compiler/compiler_lib.wasm _site/runtime/
45+
cp /tmp/compiler/compiler.wasm _site/runtime/
4646
4747
# std: <pkg>.wasm / <pkg>.py.
4848
cp -r /tmp/std/. _site/std/

.github/actions/compiler/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ runs:
8585
- name: Size (unoptimized)
8686
if: inputs.mode == 'build'
8787
shell: bash
88-
run: ls -lh target/wasm32-unknown-unknown/release/compiler_lib.wasm
88+
run: ls -lh target/wasm32-unknown-unknown/release/compiler.wasm
8989

9090
# Two passes: -Oz with traps-never-happen, then reflatten for a fresh CFG.
9191
- name: Optimize
9292
if: inputs.mode == 'build'
9393
shell: bash
9494
run: |
95-
INPUT=target/wasm32-unknown-unknown/release/compiler_lib.wasm
95+
INPUT=target/wasm32-unknown-unknown/release/compiler.wasm
9696
9797
wasm-opt -Oz --converge \
9898
--generate-global-effects \
@@ -114,7 +114,7 @@ runs:
114114
- name: Size (optimized)
115115
if: inputs.mode == 'build'
116116
shell: bash
117-
run: ls -lh target/wasm32-unknown-unknown/release/compiler_lib.wasm
117+
run: ls -lh target/wasm32-unknown-unknown/release/compiler.wasm
118118

119119
- name: Test
120120
if: inputs.mode == 'build'
@@ -125,15 +125,15 @@ runs:
125125
if: inputs.mode == 'build'
126126
uses: actions/upload-artifact@v6
127127
with:
128-
name: compiler_lib_wasm
129-
path: target/wasm32-unknown-unknown/release/compiler_lib.wasm
128+
name: compiler_wasm
129+
path: target/wasm32-unknown-unknown/release/compiler.wasm
130130
retention-days: 1
131131

132132
- name: Upload WASM Release
133133
if: inputs.mode == 'build' && startsWith(github.ref, 'refs/tags/')
134134
uses: softprops/action-gh-release@v2
135135
with:
136136
token: ${{ inputs.github-token }}
137-
files: target/wasm32-unknown-unknown/release/compiler_lib.wasm
137+
files: target/wasm32-unknown-unknown/release/compiler.wasm
138138
fail_on_unmatched_files: true
139139
generate_release_notes: true

.github/actions/demo/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ runs:
2020
- name: Download wasm artifact
2121
uses: actions/download-artifact@v8
2222
with:
23-
name: compiler_lib_wasm
23+
name: compiler_wasm
2424
path: /tmp/wasm/
2525

2626
# Hash compiler wasm + runtime JS + demo Python entries for cache-busting.
2727
- name: Write version manifest
2828
shell: bash
2929
run: |
30-
HASH=$( { sha256sum /tmp/wasm/compiler_lib.wasm; \
30+
HASH=$( { sha256sum /tmp/wasm/compiler.wasm; \
3131
find runtime -type f | LC_ALL=C sort | xargs sha256sum; \
3232
find demo/runtime -type f | LC_ALL=C sort | xargs sha256sum; \
3333
} | sha256sum | cut -c1-12)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The runtime spawns a Web Worker that pre-fetches imports, dispatches native call
7878

7979
### Consume the release from a Rust host
8080

81-
Declare `edge-python` as a dependency and `compiler_lib.wasm` from the matching GitHub Release is fetched into `OUT_DIR` automatically, no manual download.
81+
Declare `edge-python` as a dependency and `compiler.wasm` from the matching GitHub Release is fetched into `OUT_DIR` automatically, no manual download.
8282

8383
```toml
8484
# Cargo.toml
@@ -90,16 +90,16 @@ edge-python = { git = "https://github.com/dylan-sutton-chavez/edge-python", tag
9090
// build.rs
9191
fn main() {
9292
println!("cargo::rerun-if-changed=build.rs");
93-
let wasm = std::env::var("DEP_COMPILER_LIB_WASM").expect("`DEP_COMPILER_LIB_WASM` unset, upstream must declare `links = \"compiler_lib\"`");
94-
std::fs::copy(&wasm, "runtime/compiler_lib.wasm").expect("copy failed");
93+
let wasm = std::env::var("DEP_COMPILER_LIB_WASM").expect("`DEP_COMPILER_LIB_WASM` unset, upstream must declare `links = \"compiler\"`");
94+
std::fs::copy(&wasm, "runtime/compiler.wasm").expect("copy failed");
9595
}
9696
```
9797

9898
Pin to a tag for reproducible builds; use `branch = "main"` for unreleased changes. Requires `curl` on PATH. Gated by the default-on `prebuilt` feature.
9999

100100
### Server / edge runtimes (Wasmtime, Wasmer, Cloudflare Workers, Fastly Compute, Spin)
101101

102-
Edge Python is a `cdylib`, your host instantiates `compiler_lib.wasm` and calls its exports. The same `.wasm` you serve to browsers is the server-side artifact; the host owns I/O, fetching, and output (WASI / runtime APIs instead of `fetch` / `postMessage`). No server-side CLI ships here (the `cli/` tool targets the browser runtime), so embed `compiler_lib.wasm` in around 50 LOC wasmtime shell for local dev.
102+
Edge Python is a `cdylib`, your host instantiates `compiler.wasm` and calls its exports. The same `.wasm` you serve to browsers is the server-side artifact; the host owns I/O, fetching, and output (WASI / runtime APIs instead of `fetch` / `postMessage`). No server-side CLI ships here (the `cli/` tool targets the browser runtime), so embed `compiler.wasm` in around 50 LOC wasmtime shell for local dev.
103103

104104
## What it is
105105

cli/src/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::pkg::{self, Kind, Manifest};
1212

1313
// Production layout we mirror into dist/runtime/ and dist/.
1414
const RUNTIME_BASE: &str = "https://runtime.edgepython.com/js/";
15-
const COMPILER_WASM: &str = "https://runtime.edgepython.com/js/compiler_lib.wasm";
15+
const COMPILER_WASM: &str = "https://runtime.edgepython.com/js/compiler.wasm";
1616
const RUNTIME_FILES: &[&str] = &[
1717
"src/index.js",
1818
"src/element.js",
@@ -49,11 +49,11 @@ pub fn run(manifest_path: &Path, out_dir: PathBuf) -> Result<()> {
4949
}
5050

5151
let sp = crate::ui::spinner("fetching compiler.wasm");
52-
let compiler_bytes = match fetch(COMPILER_WASM).context("fetching compiler_lib.wasm") {
52+
let compiler_bytes = match fetch(COMPILER_WASM).context("fetching compiler.wasm") {
5353
Ok(b) => b,
5454
Err(e) => { sp.fail("failed to fetch compiler.wasm"); return Err(e); }
5555
};
56-
fs::write(out_dir.join("compiler_lib.wasm"), &compiler_bytes)?;
56+
fs::write(out_dir.join("compiler.wasm"), &compiler_bytes)?;
5757
sp.done("fetched compiler.wasm");
5858

5959
let scripts = collect_scripts(&project, &out_dir);

cli/src/templates/dist.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
const pkgs = await fetch("./packages.json").then((r) => r.json());
1212
const src = await fetch("./__EDGE_ENTRY__").then((r) => r.text());
1313
const worker = await createWorker({
14-
wasmUrl: "./compiler_lib.wasm",
14+
wasmUrl: "./compiler.wasm",
1515
imports: pkgs.imports || {},
1616
hostModules: pkgs.host || {},
1717
defaults: false,

cli/tests/cli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
{
111111
"given": { "main.py": "print('ok')\n", "packages.json": "{}\n" },
112112
"run": ["build"],
113-
"creates": ["dist/index.html", "dist/main.py", "dist/compiler_lib.wasm"]
113+
"creates": ["dist/index.html", "dist/main.py", "dist/compiler.wasm"]
114114
},
115115
{
116116
"run": ["repl"],

compiler/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ description = "Single-pass SSA compiler and threaded-code VM for a sandboxed Pyt
88
readme = "README.md"
99
autotests = false
1010
autobins = false
11-
links = "compiler_lib"
11+
links = "compiler"
1212

1313
[lib]
14-
name = "compiler_lib"
14+
name = "compiler"
1515
crate-type = ["cdylib", "rlib"]
1616
test = false
1717
doctest = false
@@ -20,7 +20,7 @@ doctest = false
2020
name = "tests"
2121
path = "tests/main.rs"
2222

23-
# `prebuilt` (default on) gates the `build.rs` download of `compiler_lib.wasm`. Consumers get the wasm transparently; this repo's own producer-side commands pass `--no-default-features` to skip the fetch (nothing here reads `DEP_COMPILER_LIB_WASM`).
23+
# `prebuilt` (default on) gates the `build.rs` download of `compiler.wasm`. Consumers get the wasm transparently; this repo's own producer-side commands pass `--no-default-features` to skip the fetch (nothing here reads `DEP_COMPILER_LIB_WASM`).
2424
[features]
2525
default = ["prebuilt"]
2626
prebuilt = []

compiler/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ Full rationale, NaN-box patterns, IC thresholds, GC roots, and intentional omiss
3838
## Quick start
3939

4040
```bash
41-
cargo wasm # release WASM artifact -> target/wasm32-unknown-unknown/release/compiler_lib.wasm
41+
cargo wasm # release WASM artifact -> target/wasm32-unknown-unknown/release/compiler.wasm
4242
cargo test --release # host-side test suite
4343
```
4444

45-
`cargo wasm` is a workspace alias (`.cargo/config.toml`) for `cargo build --release --target wasm32-unknown-unknown -p edge-python`. Plain `cargo build --release` produces host artifacts (`.rlib` + cdylib) for embedders linking `compiler_lib`. To add native modules from your own crate, implement the `Resolver` trait, see [Writing modules](https://edgepython.com/reference/writing-modules).
45+
`cargo wasm` is a workspace alias (`.cargo/config.toml`) for `cargo build --release --target wasm32-unknown-unknown -p edge-python`. Plain `cargo build --release` produces host artifacts (`.rlib` + cdylib) for embedders linking `compiler`. To add native modules from your own crate, implement the `Resolver` trait, see [Writing modules](https://edgepython.com/reference/writing-modules).
4646

4747
The host runtime owns I/O, network, and module fetching; there is no native CLI. Browser hosts use the [`runtime/`](../runtime/) JS package; server/edge runtimes use wasmtime, wasmer, Cloudflare Workers, Fastly Compute, Spin.
4848

4949
### Consuming the release from another Rust crate
5050

51-
This crate declares `links = "compiler_lib"` and its `build.rs` downloads the matching `compiler_lib.wasm` from the GitHub Release for `CARGO_PKG_VERSION` into `OUT_DIR`. Downstream crates read the absolute path through `DEP_COMPILER_LIB_WASM`.
51+
This crate declares `links = "compiler"` and its `build.rs` downloads the matching `compiler.wasm` from the GitHub Release for `CARGO_PKG_VERSION` into `OUT_DIR`. Downstream crates read the absolute path through `DEP_COMPILER_LIB_WASM`.
5252

5353
```toml
5454
# Downstream Cargo.toml
@@ -61,12 +61,12 @@ edge-python = { git = "https://github.com/dylan-sutton-chavez/edge-python", tag
6161
fn main() {
6262
println!("cargo::rerun-if-changed=build.rs");
6363
let wasm = std::env::var("DEP_COMPILER_LIB_WASM")
64-
.expect("`DEP_COMPILER_LIB_WASM` unset, upstream `edge-python` must declare `links = \"compiler_lib\"`");
65-
std::fs::copy(&wasm, "runtime/compiler_lib.wasm").expect("copy failed");
64+
.expect("`DEP_COMPILER_LIB_WASM` unset, upstream `edge-python` must declare `links = \"compiler\"`");
65+
std::fs::copy(&wasm, "runtime/compiler.wasm").expect("copy failed");
6666
}
6767
```
6868

69-
URL is derived from `<repository>/releases/download/v<version>/compiler_lib.wasm`, a tag bump is the only retarget needed. Use `branch = "main"` for unreleased work. Requires `curl` on PATH. Gated by the default-on `prebuilt` feature; producer-side commands pass `--no-default-features` to skip.
69+
URL is derived from `<repository>/releases/download/v<version>/compiler.wasm`, a tag bump is the only retarget needed. Use `branch = "main"` for unreleased work. Requires `curl` on PATH. Gated by the default-on `prebuilt` feature; producer-side commands pass `--no-default-features` to skip.
7070

7171
## References
7272

compiler/tests/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ use std::cell::RefCell;
88
use std::collections::{HashMap, HashSet};
99
use std::rc::Rc;
1010

11-
use compiler_lib::util::fx::FxHashMap;
12-
use compiler_lib::modules::packages::{
11+
use compiler::util::fx::FxHashMap;
12+
use compiler::modules::packages::{
1313
NativeBinding, Resolved, Resolver, partition_bindings,
1414
Manifest, walk_up_dirs, dir_of, join_relative,
1515
};
16-
use compiler_lib::modules::vm::types::{HeapObj, HeapPool, Val, VmErr};
16+
use compiler::modules::vm::types::{HeapObj, HeapPool, Val, VmErr};
1717

1818
// TestResolver
1919

0 commit comments

Comments
 (0)