fix(ci): pre-stage wasm-opt in the WASM builder image (CI flake) #321

Merged
YousifShkara merged 1 commit from fix/dx-build-wasm-opt-preinstall into main 2026-06-23 08:38:46 +02:00
Owner

The dx build --release step in the production Dockerfile downloads wasm-opt from a GitHub release every build. CI hit "connection reset" mid-download and failed the WASM bundle build with Failed to create wasm-opt instance after spending 230 seconds compiling - the bundle was already built; the failure was a tooling fetch flake one step before bundling.

dx 0.7.3's wasm_opt::get_binary_path (packages/cli/src/wasm_opt.rs) short-circuits the download when an wasm-opt binary already exists at <DX_HOME>/binaryen/bin/wasm-opt. Pinning DX_HOME=/opt/dx-cache and symlinking the Debian-packaged binaryen's /usr/bin/wasm-opt there means the first thing dx does at bundle time is path.exists() and proceeds straight to optimisation. Decouples the build from GitHub Releases uptime entirely.

NOT setting NO_DOWNLOADS=1 because that env also gates dx's wasm-bindgen-cli and esbuild fetches; wasm-bindgen-cli is version-pinned per dx release and is not packaged in trixie, so the no-downloads path would replace one flake with three.

The `dx build --release` step in the production Dockerfile downloads `wasm-opt` from a GitHub release every build. CI hit "connection reset" mid-download and failed the WASM bundle build with `Failed to create wasm-opt instance` after spending 230 seconds compiling - the bundle was already built; the failure was a tooling fetch flake one step before bundling. dx 0.7.3's `wasm_opt::get_binary_path` (packages/cli/src/wasm_opt.rs) short-circuits the download when an `wasm-opt` binary already exists at `<DX_HOME>/binaryen/bin/wasm-opt`. Pinning `DX_HOME=/opt/dx-cache` and symlinking the Debian-packaged `binaryen`'s `/usr/bin/wasm-opt` there means the first thing dx does at bundle time is `path.exists()` and proceeds straight to optimisation. Decouples the build from GitHub Releases uptime entirely. NOT setting `NO_DOWNLOADS=1` because that env also gates dx's `wasm-bindgen-cli` and `esbuild` fetches; wasm-bindgen-cli is version-pinned per dx release and is not packaged in trixie, so the no-downloads path would replace one flake with three.
fix(ci): pre-stage wasm-opt in the WASM builder image (CI flake)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m19s
Create release / Create release from merged PR (pull_request) Has been skipped
3efbc8a607
The `dx build --release` step in the production Dockerfile downloads `wasm-opt` from a GitHub release every build. CI hit "connection reset" mid-download and failed the WASM bundle build with `Failed to create wasm-opt instance` after spending 230 seconds compiling - the bundle was already built; the failure was a tooling fetch flake one step before bundling.

dx 0.7.3's `wasm_opt::get_binary_path` (packages/cli/src/wasm_opt.rs) short-circuits the download when an `wasm-opt` binary already exists at `<DX_HOME>/binaryen/bin/wasm-opt`. Pinning `DX_HOME=/opt/dx-cache` and symlinking the Debian-packaged `binaryen`'s `/usr/bin/wasm-opt` there means the first thing dx does at bundle time is `path.exists()` and proceeds straight to optimisation. Decouples the build from GitHub Releases uptime entirely.

NOT setting `NO_DOWNLOADS=1` because that env also gates dx's `wasm-bindgen-cli` and `esbuild` fetches; wasm-bindgen-cli is version-pinned per dx release and is not packaged in trixie, so the no-downloads path would replace one flake with three.
YousifShkara deleted branch fix/dx-build-wasm-opt-preinstall 2026-06-23 08:38:46 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!321
No description provided.