Skip to content

Commit 1c592c0

Browse files
authored
Shrink C API release artifacts (#11483) (#11484)
This is needed to currently shrink our `*.a` artifacts under 100M in size which is required downstream in the wasmtime-go embedding. Some testing in #11475 of using full LTO or only building Linux/macOS with 1 CGU shows that this'll likely increase cycle time by ~1 minute. Windows builders are already the slowest release build builders and this is adding 1 minute using 1 CGU vs 2-3 extra minutes for full LTO. Linux/macOS are switched to using full LTO which the CI builders currently have plenty of time for. This shaves 50M off the C API artifacts for Linux which buys a good amount of headroom for future changes. Closes #11476
1 parent 18b4bc0 commit 1c592c0

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

RELEASES.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 36.0.1
22

3-
Released 2025-08-20.
3+
Released 2025-08-21.
44

55
### Added
66

@@ -9,6 +9,12 @@ Released 2025-08-20.
99
release.
1010
[#11473](https://github.com/bytecodealliance/wasmtime/pull/11473)
1111

12+
### Changed
13+
14+
* Release artifacts for the C API are now smaller than the previous release to
15+
assist with redistribution as-is.
16+
[#11483](https://github.com/bytecodealliance/wasmtime/pull/11483)
17+
1218
--------------------------------------------------------------------------------
1319

1420
## 36.0.0

ci/build-release-artifacts.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,21 @@ fi
7171

7272
cargo build --release $flags --target $target -p wasmtime-cli $bin_flags --features run
7373

74+
# Shrink the size of `*.a` artifacts without spending too much extra time in CI.
75+
# See #11476 for some more context. Here Windows builds achieve this with 1 CGU
76+
# which results in modest size gains, and other platforms use LTO to achieve
77+
# much more significant size gains. The reason the platforms are different is
78+
# that CI is extremely slow on Windows, almost 2x slower, so this is an attempt
79+
# to keep CI cycle time under control.
80+
case $build in
81+
*-mingw* | *-windows*)
82+
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
83+
;;
84+
*)
85+
export CARGO_PROFILE_RELEASE_LTO=true
86+
;;
87+
esac
88+
7489
mkdir -p target/c-api-build
7590
cd target/c-api-build
7691
cmake \

0 commit comments

Comments
 (0)