-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* riscv64: Extend distance trampolines can jump Use a PIC-friendly set of instructions to enable destination of the trampoline to be more than 4k away from the tail call site of the trampoline itself. * Build "min" artifacts on CI This commit updates the binary artifacts produced by CI to include "min" builds where all default features are disabled. Additionally all the stops are pulled in terms of build flags, nightly versions, etc, to get a build that is as small as possible without actual source code changes. This effectively codifies the instructions in #7282 into an easily downloadable artifact. No new tarballs are created for github releases but instead tarballs that previously had a `wasmtime` executable for example now have a `wasmtime-min` executable. Furthermore the C API which previously had `libwasmtime.so` for example now has `libwasmtime-min.so`. The intention is that the minimum-size artifacts are handy for determining a rough size of Wasmtime but they're not so important that it seems worthwhile to dedicate entire release entries for. CI is refactored to support these minimum builds with separate builders. This means that a single tarball produced as a final result is actually two separate tarballs merged together, one for the normal build we do today plus a new "min" tarball produced on the new "min" builders. Various scripts and CI organization has been adjusted accordingly. While here I went ahead and enabled `panic=abort` and debuginfo stripping in our current release artifacts. While this doesn't affect a whole lot it's less to upload to GitHub Actions all the time. * Fix Windows unzip
- Loading branch information
1 parent
a5d9bbe
commit a80da75
Showing
12 changed files
with
295 additions
and
106 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Small script used to calculate the matrix of builds that are going to be | ||
// done if CI decides to do a release build. | ||
// | ||
// This is a separate script primarily to write out all the release | ||
// targets/platforms once and then duplicate them all with a "min" build. | ||
|
||
const array = [ | ||
{ | ||
// The name of the build which shows up in the name of the artifact for | ||
// Wasmtime's github releases. | ||
"build": "x86_64-linux", | ||
// The GitHub Actions platform that this build runs on | ||
"os": "ubuntu-latest", | ||
// The Rust target that will be used for the build. | ||
"target": "x86_64-unknown-linux-gnu", | ||
}, | ||
{ | ||
"build": "aarch64-linux", | ||
"os": "ubuntu-latest", | ||
"target": "aarch64-unknown-linux-gnu", | ||
}, | ||
{ | ||
"build": "s390x-linux", | ||
"os": "ubuntu-latest", | ||
"target": "s390x-unknown-linux-gnu", | ||
}, | ||
{ | ||
"build": "riscv64gc-linux", | ||
"os": "ubuntu-latest", | ||
"target": "riscv64gc-unknown-linux-gnu", | ||
}, | ||
{ | ||
"build": "x86_64-macos", | ||
"os": "macos-latest", | ||
"target": "x86_64-apple-darwin", | ||
}, | ||
{ | ||
"build": "aarch64-macos", | ||
"os": "macos-latest", | ||
"target": "aarch64-apple-darwin", | ||
}, | ||
{ | ||
"build": "x86_64-windows", | ||
"os": "windows-latest", | ||
"target": "x86_64-pc-windows-msvc", | ||
}, | ||
{ | ||
"build": "x86_64-mingw", | ||
"os": "windows-latest", | ||
"target": "x86_64-pc-windows-gnu", | ||
}, | ||
]; | ||
|
||
const builds = []; | ||
for (let build of array) { | ||
// Perform a "deep clone" roundtripping through JSON for a copy of the build | ||
// that's normal | ||
build.rust = 'stable'; | ||
builds.push(JSON.parse(JSON.stringify(build))); | ||
|
||
// Next generate a "min" build and add it to the builds list. Min builds | ||
// require Nightly rust due to some nightly build options that are configured. | ||
build.build += '-min'; | ||
build.rust = 'nightly-2023-10-10'; | ||
builds.push(build); | ||
} | ||
|
||
console.log(JSON.stringify(builds)); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# A script to build the release artifacts of Wasmtime into the `target` | ||
# directory. For now this is the CLI and the C API. Note that this script only | ||
# produces the artifacts through Cargo and doesn't package things up. That's | ||
# intended for the `build-tarballs.sh` script. | ||
# | ||
# This script takes a Rust target as its first input and optionally a parameter | ||
# afterwards which can be "-min" to indicate that a minimal build should be | ||
# produced with as many features as possible stripped out. | ||
|
||
set -ex | ||
|
||
build=$1 | ||
target=$2 | ||
|
||
# Default build flags for release artifacts. Leave debugging for | ||
# builds-from-source which have richer information anyway, and additionally the | ||
# CLI won't benefit from catching unwinds and neither will the C API so use | ||
# panic=abort in both situations. | ||
export CARGO_PROFILE_RELEASE_STRIP=debuginfo | ||
export CARGO_PROFILE_RELEASE_PANIC=abort | ||
|
||
if [[ "$build" = *-min ]]; then | ||
# Configure a whole bunch of compile-time options which help reduce the size | ||
# of the binary artifact produced. | ||
export CARGO_PROFILE_RELEASE_OPT_LEVEL=s | ||
export RUSTFLAGS=-Zlocation-detail=none | ||
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 | ||
export CARGO_PROFILE_RELEASE_LTO=true | ||
flags="-Zbuild-std=std,panic_abort --no-default-features -Zbuild-std-features=" | ||
flags="$flags --features disable-logging" | ||
else | ||
# For release builds the CLI is built a bit more feature-ful than the Cargo | ||
# defaults to provide artifacts that can do as much as possible. | ||
bin_flags="--features all-arch,component-model" | ||
fi | ||
|
||
cargo build --release $flags --target $target -p wasmtime-cli $bin_flags | ||
cargo build --release $flags --target $target -p wasmtime-c-api |
This file contains 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
This file contains 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
Oops, something went wrong.