Skip to content

Commit af8b577

Browse files
Copilotfs-eire
andauthored
Fix --build_wasm_static_lib implicitly enable --build_wasm (#27342)
### Description Moves the `--build_wasm_static_lib → --build_wasm` implication from `build.py` into `build_args.py`'s post-processing, **before** the cmake generator selection. Previously, `build_args.py` chose the generator based on `args.build_wasm` (still `False`), and `build.py` only set it to `True` afterwards—too late. - **`tools/ci_build/build_args.py`**: Set `args.build_wasm = True` when `args.build_wasm_static_lib` is set, prior to generator and cross-compilation logic. - **`tools/ci_build/build.py`**: Remove the now-redundant identical check. ### Motivation and Context Using `--build_wasm_static_lib` without `--build_wasm` caused cmake to use the wrong generator (e.g., Visual Studio instead of Ninja on Windows) and miss Emscripten-specific configuration, leading to build failures like missing `libiconv`. <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: fs-eire <7679871+fs-eire@users.noreply.github.com>
1 parent 9b24046 commit af8b577

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

tools/ci_build/build.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2327,9 +2327,6 @@ def main():
23272327
if args.nnapi_min_api < 27:
23282328
raise BuildError("--nnapi_min_api should be 27+")
23292329

2330-
if args.build_wasm_static_lib:
2331-
args.build_wasm = True
2332-
23332330
if args.build_wasm:
23342331
if not args.disable_wasm_exception_catching and args.disable_exceptions:
23352332
# When '--disable_exceptions' is set, we set '--disable_wasm_exception_catching' as well

tools/ci_build/build_args.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,10 @@ def convert_arg_line_to_args(self, arg_line: str) -> list[str]: # Use list[str]
938938
if args.android_ndk_path:
939939
args.android_ndk_path = os.path.normpath(args.android_ndk_path)
940940

941+
# Treat --build_wasm_static_lib as implying --build_wasm
942+
if args.build_wasm_static_lib:
943+
args.build_wasm = True
944+
941945
# Handle WASM exception logic
942946
if args.enable_wasm_api_exception_catching:
943947
args.disable_wasm_exception_catching = True # Catching at API level implies disabling broader catching

0 commit comments

Comments
 (0)