File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -e
3+
4+ # Verifies that the native launcher runs on older x86_64 CPUs (without AVX/AVX2/FMA).
5+ # Uses QEMU user-mode emulation with a Westmere CPU model (2010, SSE4.2 but no AVX).
6+
7+ LAUNCHER_GZ=" ${1:? Usage: $0 <launcher.gz>} "
8+
9+ sudo apt-get update -qq && sudo apt-get install -y -qq qemu-user > /dev/null
10+
11+ LAUNCHER=" /tmp/scala-cli-compat-test"
12+ gunzip -c " $LAUNCHER_GZ " > " $LAUNCHER "
13+ chmod +x " $LAUNCHER "
14+
15+ echo " Running native launcher under QEMU with Westmere CPU (no AVX/AVX2/FMA)..."
16+ qemu-x86_64 -cpu Westmere " $LAUNCHER " version
17+ echo " CPU compatibility check passed."
Original file line number Diff line number Diff line change @@ -269,6 +269,8 @@ jobs:
269269 run : .github/scripts/generate-os-packages.sh
270270 - name : Copy artifacts
271271 run : ./mill -i copyDefaultLauncher --directory artifacts/
272+ - name : Verify native launcher CPU compatibility
273+ run : .github/scripts/verify_old_cpus.sh artifacts/scala-cli-x86_64-pc-linux.gz
272274 - uses : actions/upload-artifact@v6
273275 with :
274276 name : linux-launchers
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ trait CliLaunchers extends SbtModule { self =>
172172 else staticLibDir().path.toString
173173 super.nativeImageOptions() ++ Seq(
174174 "--no-fallback",
175+ "-march=compatibility",
175176 s"-H:IncludeResources=$localRepoResourcePath",
176177 s"-H:IncludeResources=$launcherTypeResourcePath",
177178 s"-H:IncludeResources=$defaultFilesResourcePath/.*",
You can’t perform that action at this time.
0 commit comments