feat(versions): on a processor without AVX2, offer only builds from source and say why once #375
No reviewers
Labels
No labels
area/build
area/install
area/mods
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!375
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:feat/old-cpu-source-builds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Longshot's prebuilt versions now need an x86-64-v3 processor (AVX2), and the builder refuses a release build on an older one (Longshot #2833, the builder side). Players with an older processor can still build from source, so the launcher should lead them there instead of to a build that fails.
Summary
src/cpu.rs, new):cpuidreads AVX2, FMA, BMI1, BMI2, MOVBE, LZCNT and F16C, and OSXSAVE plus XGETBV for the OS's AVX state. The launcher is still built for plain x86-64 (notarget-cpuanywhere), so the check runs at run time on any PC.Featuresis a plain struct, so the tests check it with fake feature sets.LONGSHOT_LAUNCHER_FAKE_OLD_CPU=1makes the launcher act as if the processor had no AVX2, FMA or BMI2.ui/old-cpu-dialog.slint): on the first start on such a processor it says what is missing, that main or a pull request still works, that the first build takes longer and that these are not tested releases. "Got it" (or a click outside) setsoldCpuNoticeSeenin the launcher's settings, so it shows once.docs/pull-requests.md, and a pointer to it in the README.How main and pull request builds work: the launcher downloads the newest signed nightly builder and runs
from-sourcewith it (releases.rsinstall_builder). Per #2833, that builder is plain x86-64,from-sourcenever refuses, and the builder it compiles builds everything at-march=nativeon an older processor. The source tags the launcher passes as--namearemain-<8 hex>andpr-<N>-<8 hex>, never release-shaped (vX.Y.Z,nightly-N-…), so the builder never takes them for a release.Screenshots
With
LONGSHOT_LAUNCHER_FAKE_OLD_CPU=1:The notice on the first start:
Add version: the three release rows are greyed out with the hint:
The build page's channel list, with Main and Pull request only:
Testing
Tested:
scripts/ci-test.sh: fmt and clippy (-D warnings) clean, translations validated,LAUNCHER=… test_release.pypasses (46 tests).cargo test: 277 passed, including the newcpu::tests. 2 failed only because another session had alongshot/longshot-builderprocess running on this PC: "Close longshot (PID …) before continuing". Neither test touches this change.LONGSHOT_LAUNCHER_FAKE_OLD_CPU=1and throwaway folders. The PR was opened with--forcefor the game-run requirement only, which the person I work for approved for this CPU work.Still to test: on a processor without AVX2 (or with
LONGSHOT_LAUNCHER_FAKE_OLD_CPU=1): the notice shows once, Add version greys out the three release rows with the hint, and a main build completes.Risks
A processor with AVX2 whose OS has AVX turned off now counts as old, as intended: the prebuilt game could not run there either. Builds already installed from a release on such a PC are not changed. Rebuilding them stops with the builder's own
cpu_too_oldmessage, which points to building from source.🤖 Generated with Claude Code
WIP: feat(versions): on a processor without AVX2, offer only builds from source and say why onceto feat(versions): on a processor without AVX2, offer only builds from source and say why once32911b7c42c23db86a8fJiro113 referenced this pull request2026-11-30 00:11:22 +00:00