Skip to content

Commit ea133c3

Browse files
CI: Add SDE (emulator) to CI (#11777)
* SDE emulator add * revert changes to individual tests for sde, since we run only cranelift-tools now * cargo fmt, cleanup comment * prtest:sde * prtest:full * omit filtering out sde tests for full ci * remove install-sde action, do it with curl/tar instead in ci
1 parent 8211252 commit ea133c3

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.github/workflows/main.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ jobs:
686686
runs-on: ${{ matrix.os }}
687687
env:
688688
QEMU_BUILD_VERSION: 10.0.3
689+
SDE_BUILD_VERSION: 9.58.0-2025-06-16
689690
strategy:
690691
fail-fast: ${{ github.event_name != 'pull_request' }}
691692
matrix: ${{ fromJson(needs.determine.outputs.test-matrix) }}
@@ -733,6 +734,13 @@ jobs:
733734
path: ${{ runner.tool_cache }}/qemu
734735
key: qemu-${{ matrix.target }}-${{ env.QEMU_BUILD_VERSION }}-patchcpuinfo
735736
if: matrix.qemu != ''
737+
738+
- uses: actions/cache@v4
739+
with:
740+
path: ${{ runner.tool_cache }}/sde
741+
key: sde-${{ env.SDE_BUILD_VERSION }}
742+
if: matrix.sde != ''
743+
736744
- name: Install qemu
737745
run: |
738746
set -ex
@@ -769,6 +777,40 @@ jobs:
769777
touch ${{ runner.tool_cache }}/qemu/built
770778
if: matrix.qemu != ''
771779

780+
- name: Install Intel SDE
781+
run: |
782+
set -ex
783+
784+
# Set up SDE as runner for x86_64 targets
785+
echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=${{ runner.tool_cache }}/sde/sde64 -future --" >> $GITHUB_ENV
786+
787+
# SDE emulation is very slow, so use release mode for better performance
788+
echo CARGO_PROFILE_DEV_OPT_LEVEL=2 >> $GITHUB_ENV
789+
790+
# Enable environment variable to indicate SDE is being used
791+
echo WASMTIME_TEST_SDE=1 >> $GITHUB_ENV
792+
793+
# Generic variable for skipping tests that are problematic under SDE (performance, compatibility, etc.)
794+
echo WASMTIME_TEST_NO_SDE=1 >> $GITHUB_ENV
795+
796+
# Similar to QEMU, reduce memory usage during SDE emulation
797+
echo WASMTIME_TEST_NO_HOG_MEMORY=1 >> $GITHUB_ENV
798+
799+
# See if SDE is already in the cache
800+
if [ -f ${{ runner.tool_cache }}/sde/sde64 ]; then
801+
exit 0
802+
fi
803+
804+
curl --retry 5 --retry-all-errors -o sde.tar.xz \
805+
https://downloadmirror.intel.com/859732/sde-external-${{ env.SDE_BUILD_VERSION }}-lin.tar.xz
806+
807+
mkdir -p ${{ runner.tool_cache }}/sde
808+
tar xJf sde.tar.xz --strip-components=1 -C ${{ runner.tool_cache }}/sde
809+
rm sde.tar.xz
810+
811+
chmod +x ${{ runner.tool_cache }}/sde/sde64
812+
if: matrix.sde != ''
813+
772814
- name: Configure ASAN
773815
run: |
774816
echo CARGO_PROFILE_DEV_OPT_LEVEL=2 >> $GITHUB_ENV

ci/build-test-matrix.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ const FAST_MATRIX = [
5454
// QEMU and installing cross compilers to execute a cross-compiled test suite
5555
// on CI.
5656
//
57+
// * `sde` - if `true`, indicates this test should use Intel SDE for instruction
58+
// emulation. SDE will be set up and configured as the test runner.
59+
//
5760
// * `rust` - the Rust version to install, and if unset this'll be set to
5861
// `default`
5962
const FULL_MATRIX = [
@@ -78,6 +81,14 @@ const FULL_MATRIX = [
7881
"rust": "wasmtime-ci-pinned-nightly",
7982
"target": "x86_64-unknown-linux-gnu",
8083
},
84+
{
85+
"os": ubuntu,
86+
"name": "Test Linux x86_64 with SDE",
87+
"filter": "sde",
88+
"isa": "x64",
89+
"sde": true,
90+
"crates": "cranelift-tools",
91+
},
8192
{
8293
"os": macos,
8394
"name": "Test macOS x86_64",
@@ -226,6 +237,19 @@ async function shard(configs) {
226237
// created above.
227238
const sharded = [];
228239
for (const config of configs) {
240+
// If crates is specified, don't shard, just use the specified crates
241+
if (config.crates) {
242+
sharded.push(Object.assign(
243+
{},
244+
config,
245+
{
246+
bucket: members
247+
.map(c => c === config.crates ? `--package ${c}` : `--exclude ${c}`)
248+
.join(" ")
249+
}
250+
));
251+
continue;
252+
}
229253
for (const bucket of buckets) {
230254
sharded.push(Object.assign(
231255
{},

0 commit comments

Comments
 (0)