Skip to content

Wasm BUILD refactor#162

Open
tameware wants to merge 3 commits into
dds-bridge:developfrom
tameware:wasm-refactor
Open

Wasm BUILD refactor#162
tameware wants to merge 3 commits into
dds-bridge:developfrom
tameware:wasm-refactor

Conversation

@tameware
Copy link
Copy Markdown
Contributor

@tameware tameware commented Jun 1, 2026

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.

- 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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks strange.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/wasm package with wasm_cc_binary wrappers and a public all_examples_wasm filegroup.
  • Removes legacy “WASM sources” filegroup() plumbing and the .bazelrc build:wasm profile; 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 thread docs/wasm_build.md
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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants