thedevyashsaini opened PR #11096 from thedevyashsaini:main to bytecodealliance:main:
This PR introduces a dedicated CI job (
build-static-lib) that verifies the static library build of Wasmtime by passing-DWASMEDGE_BUILD_STATIC_LIB=ONto CMake.Changes:
- Added a standalone
build-static-libjob in.github/workflows/main.yml, triggered alongside regular builds.- This job uses a fixed Rust toolchain (
stable) and target (x86_64-unknown-linux-gnu).- It runs independently of the main matrix-based
buildjob to avoid cache conflicts or artifact overrides.- Static build logic is activated via
static=truepassed toci/build-release-artifacts.sh.Motivation:
Static library builds can fail due to symbol collisions or source file name conflicts. CI coverage ensures we catch such regressions early.
Related:
Fixes #3608
Refs this comment suggesting the need for aSTATIC_LIB=ONbuild in CI.
thedevyashsaini requested fitzgen for a review on PR #11096.
thedevyashsaini requested wasmtime-default-reviewers for a review on PR #11096.
alexcrichton commented on PR #11096:
@thedevyashsaini did you mean to send this PR to the WasmEdge project instead of Wasmtime?
thedevyashsaini commented on PR #11096:
@alexcrichton yeaah, this started as a fix for WasmEdge and somewhere down the rabbit hole I ended up static linking Wasmtime by instinct :sweat_smile:
That said - the CI test might still be useful here, but feel free to shut it down if it's out of scope...
alexcrichton commented on PR #11096:
Ok, in that case I'm going to close this beacuse I don't think this does what you think it does in terms of testing. AFAIK this doesn't actually do anything on CI as the cmake option you specify here isn't read anywhere. As a result I'm going to close this.
alexcrichton closed without merge PR #11096.
thedevyashsaini commented on PR #11096:
@alexcrichton
Totally understand closing this — thanks for reviewing!
Just wanted to clarify one point you mentioned:
“the cmake option you specify here isn’t read anywhere…”
I believe it is wired through the CI scripts. Here’s the flow I followed:
In
.github/workflows/main.yml(line \~1115), the job runs:
bash static=true ./ci/build-release-artifacts.sh release x86_64-unknown-linux-gnuThen inside
ci/build-release-artifacts.shthe "static" option is checked, around line 69:
bash if [[ "$static" == "true" ]]; then cmake_flags="$cmake_flags -DWASMEDGE_BUILD_STATIC_LIB=ON" fiThese
$cmake_flagsare passed into thecmakecommand at line \~82:
bash cmake \ -G Ninja \ ../../crates/c-api \ $cmake_flags \ ...So
-DWASMEDGE_BUILD_STATIC_LIB=ONshould be included in the build, unless I’ve misunderstood something else upstream (like the flag not being handled in the actual CMakeLists).In any case, totally fair to close this if it's not useful — just thought I'd clarify in case this ends up being worth revisiting later. Cheers!
thedevyashsaini deleted a comment on PR #11096:
@alexcrichton
Totally understand closing this — thanks for reviewing!
Just wanted to clarify one point you mentioned:
“the cmake option you specify here isn’t read anywhere…”
I believe it is wired through the CI scripts. Here’s the flow I followed:
In
.github/workflows/main.yml(line \~1115), the job runs:
bash static=true ./ci/build-release-artifacts.sh release x86_64-unknown-linux-gnuThen inside
ci/build-release-artifacts.shthe "static" option is checked, around line 69:
bash if [[ "$static" == "true" ]]; then cmake_flags="$cmake_flags -DWASMEDGE_BUILD_STATIC_LIB=ON" fiThese
$cmake_flagsare passed into thecmakecommand at line \~82:
bash cmake \ -G Ninja \ ../../crates/c-api \ $cmake_flags \ ...So
-DWASMEDGE_BUILD_STATIC_LIB=ONshould be included in the build, unless I’ve misunderstood something else upstream (like the flag not being handled in the actual CMakeLists).In any case, totally fair to close this if it's not useful — just thought I'd clarify in case this ends up being worth revisiting later. Cheers!
thedevyashsaini commented on PR #11096:
Thanks for the review! Yep, just realized
-DWASMEDGE_BUILD_STATIC_LIBisn’t defined in Wasmtime’s CMake. Appreciate the clarification!
Last updated: Dec 06 2025 at 06:05 UTC