No runnable build on the review box: target-cpu=x86-64-v3 crashes build scripts on pre-AVX2 CPUs, and CC=clang is absent #16
Labels
No Label
blocked
bounced
in-progress
in-review
manual-only
needs-guidance
netplay
p1
p2
p3
rust
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: pbwraith/gopher64-netplay#16
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
gopher64-netplay cannot be built on the review box — 7 open PRs are ungateable
All seven open PRs (!9, !10, !11, !12, !13, !14, !15) are currently
unverifiable, because
cargo checkfails onmainbefore compiling any ofthis repo's own code. This is not a defect in any PR — it reproduces on a clean
origin/maincheckout — but it means no PR here can be honestly reviewed ormerged, so it is worth fixing as a cause rather than re-discovering per PR.
Two independent blockers, both measured today.
Blocker 1 —
target-cpu=x86-64-v3makes the build crash on pre-2013 CPUs.cargo/config.toml:x86-64-v3requires AVX2/BMI2, i.e. Intel Haswell (2013) or newer. The reviewbox is an Intel i7-2600K (Sandy Bridge, 2011), which is
x86-64-v2.Observed on
origin/main, identically with-j 1and with default parallelism:Minimal reproduction, outside this repo entirely —
cargo new+ a singlenum-traits = "0.2.19"dependency:Byte-for-byte the same bogus allocation size, so this is the cause and not a
coincidence. The 648518346341351440 figure is
0x0900000000000010— garbagefrom executing AVX2 instructions on a CPU that does not implement them, not a
genuine out-of-memory condition (the box had 3.5 GB free).
The subtle part, and the reason this is worth fixing rather than documenting:
this breaks build scripts, not just the shipped binary. For a native build
(host == target) cargo applies
[target.<cfg>] rustflagsto build scripts andproc macros as well, so the flag miscompiles
num-traits's build script andthe failure happens at dependency-compile time. The project is therefore
unbuildable on such a host — you cannot even get far enough to produce a binary
you would then decline to run.
Verified workaround for the flag (an explicit
RUSTFLAGSenv var replaces theconfig's
rustflagsrather than merging with it — remember to carry the stackflag across):
That gets past
num-traitsand every other dependency, straight to blocker 2.Blocker 2 —
[env] CC = "clang"with no clang on the box.cargo/config.tomlsetsCC = "clang",CXX = "clang++",AR = "llvm-ar"unconditionally. With the v3 flag overridden, the build then fails at:
clangandcmakeare both absent (which clang/which cmake-> notfound).
cmakeis very likely needed too —sdl3-srcandbindgenarebuild-dependencies — but I did not get far enough to confirm that, and say so
explicitly rather than guessing.
Scope
Pick whichever is appropriate; this issue is about making the gate runnable, not
about mandating one of them:
target-cpu=x86-64-v3behind anexplicit profile or env opt-in so the default build is portable, keeping the
optimised flags for release builds on capable hardware. This also fixes the
real-world case of a user on an older CPU.
RUSTFLAGSoverride in a documented gate script.If (1) is rejected because this is a fork and every changed line is future
rebase cost against upstream, say so on this issue and do (2) — but then the
override must be written down somewhere a reviewer will find it, because the
failure mode (a bogus multi-petabyte allocation inside an unrelated dependency)
gives no hint whatsoever about its cause.
Acceptance
cargo check --all-targetsexits 0 on a cleanorigin/maincheckout on thereview box, by a documented command.
docs/note or a script), not onlyin this issue.
Out of scope
src/or to the vendoredvendor/ggrstree.x86-64-v2hardware — this issueis only about being able to build and test.
Second finding: the 7 open PRs do not compose — 4 of them independently edit
src/netplay.rsSeparate from the build blocker above, and checkable without a compiler. Every
one of the seven PRs reports
mergeable=true; that flag is measured againstmainin isolation and says nothing about whether they coexist. Merged for realinto throwaway worktrees off
origin/main(00f918e), they do not.Stacking (measured with
git merge-base --is-ancestor)So
!11already contains!9and!10— merging!11lands all three, andreviewing them separately is only worthwhile if they are meant to land
separately.
Best composable set: 3 of 7
Other orders are worse, not better:
issue-8(!12, the UI PR) is clean in every order — it only touchessrc/ui/**plussrc/ui/netplay.rs, so it is order-independent.Recommendation
Land in the order above. After
!14,!15and!12are in,!13and the!9/!10/!11stack need a real rebase onto the newmain, not amergeablerecheck — the conflicts are in the message-dispatch region ofsrc/netplay.rsthatissue-1restructures (+258/-34) and that the resyncwork also edits.
Worth doing in that order specifically because
issue-1is the protocolfoundation (state-message types, chunked codec) that the resync PRs are
layering on top of; rebasing them onto it should remove duplicated
message-plumbing rather than just relocating a conflict.
I am not bouncing any of these — the conflicts are a consequence of seven
branches being cut from the same commit in parallel, not a defect in any one of
them, and until the gate above runs none of them can be verified anyway.
Correction: options 1 and 2 are not alternatives -- option 1 alone does not make the gate runnable
Re-verified both blockers independently today and confirmed them, but the
"Scope" section above says "Pick whichever is appropriate", and that framing is
wrong in a way that would waste an implementation.
Option 1 (make
target-cpu=x86-64-v3opt-in) does not produce a runnablegate on its own. This issue's own text already contains the proof -- the
RUSTFLAGSoverride "gets pastnum-traitsand every other dependency,straight to blocker 2". Blocker 2 is independent of the microarch flag, so
a PR that only makes the flag opt-in leaves
cargo checkstill failing, onring, for a completely different reason. It is a worthwhile portability fixon its own merits; it is not a fix for this issue's acceptance criterion.
Only option 2 (provision the box) actually satisfies the acceptance, because
it carries the
RUSTFLAGSoverride and installs the missing compiler.Sharper finding on blocker 2: it is not merely "clang is absent"
which clang/gcc/cc/clall return nothing, as recorded. But thebox is closer to buildable than that suggests, and the precise state changes
what the cheapest remediation is:
So the MSVC toolset directories exist with the compiler payload never
installed -- a partial BuildTools install. Two rustup MSVC toolchains are
also present (
stable-x86_64-pc-windows-msvc, plus 1.97.1 and 1.98.0), whilethe active toolchain is
stable-x86_64-pc-windows-gnu(rustc -vV->host: x86_64-pc-windows-gnu, rustc 1.85.0).CPU confirmed as stated:
Intel64 Family 6 Model 42= Sandy Bridge, i.e.x86-64-v2, so the AVX2 analysis in this issue holds.Why this sweep did not just provision it
I tried the non-interactive route and it is not available:
LLVM has no user-scope installer, so every remaining path -- LLVM machine-scope,
or completing the BuildTools install with
Microsoft.VisualStudio.Component.VC.Tools.x86.x64, or MSYS2 for a MinGWgccmatching the active
-gnutoolchain -- requires elevation, which would puta UAC dialog on the owner's desktop from an unattended sweep. That is an owner
action, and it is a small one: a single elevated install, once.
cmakeis also absent and will be needed (sdl3-src,bindgen), so whichevercompiler is chosen, install
Kitware.CMakein the same pass.Status of the 7 PRs, unchanged
Still ungateable, and I did not merge or bounce any of them. The composition
analysis in the comment above stands. Recommend this issue keeps its
p1andis treated as the prerequisite for all seven.
Status: the fix in !17 is verified for the specific crash; the gate still cannot complete
Ran
./scripts/gate.shfrom !17 against the merge result on the review box.The blocker this issue documents is fixed.
num-traits v0.2.19compiles,and the signature allocation size
648518346341351440appears zero timesin the log (371 crates processed before any error). That is Blocker 1 closed on
the evidence.
But the gate still does not reach exit 0, for a new and unrelated reason:
the review box's C: drive is full -- 1.13 GB free of 477 GB, hitting zero
mid-build:
A debug
cargo check --all-targetson this dependency graph needs several GBof
target/, so this repo cannot be gated on this box until disk is freed.osrs-farm/as a whole accounts for only ~3 GB, so the consumer is elsewhereon the drive; I have escalated it to the owner rather than deleting anything
outside my scope.
Consequence for this issue: it stays open and correctly describes a real
condition, but its remaining blocker has changed identity -- it is no longer
target-cpu=x86-64-v3, it is free space. The seven PRs it names(!9, !10, !11, !12, !13, !14, !15) remain ungateable, now for that reason.
Note also that
bouncedis not a defined label in this repo, so any attempt tobounce a PR here stores nothing (Gitea labels resolve by id per-repo and
silently drop unknown names). Worth adding if this repo is going to take
sweep review traffic.