Wasm BUILD refactor#162
Open
tameware wants to merge 3 commits into
Open
Conversation
…sm targets without breaking "bazel build --config=wasm //..."
zzcgumn
reviewed
Jun 2, 2026
| - name: Smoke test solve_board_wasm | ||
| run: node bazel-bin/examples/solve_board.js | ||
| run: node bazel-bin/examples/wasm/solve_board.js | ||
| git push -u origin wasm-refactor No newline at end of file |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the Bazel WebAssembly build so WASM artifacts are built via wasm_cc_binary platform transitions (no --config=wasm), and relocates WASM outputs under bazel-bin/examples/wasm/.
Changes:
- Adds a dedicated
//examples/wasmpackage withwasm_cc_binarywrappers and a publicall_examples_wasmfilegroup. - Removes legacy “WASM sources”
filegroup()plumbing and the.bazelrcbuild:wasmprofile; updates docs and CI to build//examples/wasm:*. - Centralizes shared Emscripten link flags in
//:wasm_compat.bzl.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| wasm/BUILD.bazel | Adds a placeholder package comment pointing to //:wasm_compat.bzl. |
| wasm_compat.bzl | Introduces shared WASM_LINKOPTS for Emscripten builds. |
| library/tests/utility/BUILD.bazel | Minor formatting (blank line). |
| library/tests/trans_table/BUILD.bazel | Minor formatting / closing paren normalization. |
| library/tests/solve_board/BUILD.bazel | Minor formatting (blank line). |
| library/tests/regression/heuristic_sorting/BUILD.bazel | Minor formatting (blank line). |
| library/tests/moves/BUILD.bazel | Removes package-level default visibility; minor formatting. |
| library/tests/heuristic_sorting/BUILD.bazel | Minor formatting / closing paren normalization. |
| library/src/utility/BUILD.bazel | Removes legacy wasm_sources filegroup. |
| library/src/trans_table/BUILD.bazel | Removes legacy wasm_sources filegroup. |
| library/src/system/BUILD.bazel | Removes legacy wasm_sources filegroup. |
| library/src/solver_context/BUILD.bazel | Removes legacy wasm_sources filegroup. |
| library/src/moves/BUILD.bazel | Removes legacy wasm_sources filegroup. |
| library/src/lookup_tables/BUILD.bazel | Removes legacy wasm_sources filegroup. |
| library/src/heuristic_sorting/BUILD.bazel | Removes legacy wasm_sources filegroup. |
| library/src/BUILD.bazel | Removes legacy dds_wasm_sources filegroup. |
| examples/wasm/BUILD.bazel | Adds WASM wrapper targets and public all_examples_wasm. |
| examples/BUILD.bazel | Moves WASM build entrypoints to //examples/wasm, adds shared linkopts, and exposes wrapped native binaries to that package. |
| docs/wasm_build.md | Updates build/run instructions and output paths for the new WASM structure. |
| BUILD.bazel | Clarifies build_wasm config_setting semantics (transition-driven cpu=wasm). |
| .github/workflows/ci_wasm.yml | Updates CI to build/run from //examples/wasm and new output path. |
| .bazelrc | Removes the build:wasm profile. |
| - name: Smoke test solve_board_wasm | ||
| run: node bazel-bin/examples/solve_board.js | ||
| run: node bazel-bin/examples/wasm/solve_board.js | ||
| git push -u origin wasm-refactor No newline at end of file |
Comment on lines
+78
to
+81
| ## C++ standard | ||
|
|
||
| ## C++ Standard | ||
| WASM example binaries are built as C++20. The Emscripten toolchain (via `wasm_cc_binary`) compiles the transitioned `cc_target`; project flags for that configuration come from `CPPVARIABLES.bzl` when `//:build_wasm` matches (`--cpu=wasm` set by the transition). | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove the requirement for
--config=wasm.bazel build //...now builds all targets, wasm included. The destination folder has changed. Smoke test with:node bazel-bin/examples/solve_board.js
Vibe-coded by Cursor.