Skip to content

cmd/loopvec-toolexec: require the toolchain's exact Go version - #7

Open
thesyncim wants to merge 1 commit into
mauri870:masterfrom
thesyncim:toolexec-exact-version
Open

thesyncim wants to merge 1 commit into
mauri870:masterfrom
thesyncim:toolexec-exact-version

Conversation

@thesyncim

@thesyncim thesyncim commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

I tried the wrapper on goav1, which was still on go1.27.0, with a wrapper built by 1.27.1, and the build failed instead of falling back:

internal/av1/transform/fdct.go:80:48: cannot use uint64(31) (constant 31 of type uint64) as uint8 value in argument to _v1.ShiftAllRight

go1.27.0's simd stubs declare ShiftAllRight(uint64), but the compiler implements it with a uint8 (1.27.1 fixed that). go/types only sees the stubs, so the rewritten package type-checks in the wrapper and then fails in the compiler. The release check compared go1.27 to go1.27, so nothing stopped it.

This compares the whole version word instead: go1.27.3, go1.28rc1, tip's go1.28-<hash>, or a vendor build such as go1.27.3-acme. Experiments are left out, and the two sides spell them differently: the compiler says go1.27.3 X:simd, while a wrapper built with GOEXPERIMENT=simd reports go1.27.3-X:simd. A version it can't find never matches. toolexec.md already says to build the wrapper with the toolchain that runs the build; now a mismatch leaves packages unchanged with the existing debug message.

toolexec_toolchain_mismatch.txt gets a same-release, different-patch case, and a unit test covers the version strings (releases, prereleases, tip, vendor builds, with and without experiments). The scripts build the wrapper without GOEXPERIMENT, so I also checked by hand that a wrapper built with GOEXPERIMENT=simd rewrites under go1.27.3 and skips under go1.27.1.

@thesyncim
thesyncim force-pushed the toolexec-exact-version branch from fb09951 to d79033b Compare November 1, 2026 13:36
The wrapper rewrites a package only when it was built with the same Go
release as the toolchain running the build, and compared releases as
go1.27. But the simd package can change in a patch release without
go/types seeing it: go1.27.0 declares ShiftAllRight(uint64) in its stubs
and compiles it as taking a uint8, go1.27.1 takes a uint64. A wrapper
built with go1.27.1 or later rewrote a go1.27.0 build into code that
type-checked here and then failed to compile, so the build failed:

  cannot use uint64(31) (constant 31 of type uint64) as uint8 value in
  argument to _v1.ShiftAllRight

The wrapper now compares the whole version word (go1.27.3, go1.28rc1, a
development build's go1.28-6ae0b1f8a9, or a vendor's go1.27.3-acme), as
toolexec.md already asks: build loopvec-toolexec with the same Go
toolchain that runs the build. Experiments are left out of it: the
compiler reports go1.27.3 X:simd, while a wrapper built with
GOEXPERIMENT=simd reports go1.27.3-X:simd. A version it cannot find
never matches.
@thesyncim
thesyncim force-pushed the toolexec-exact-version branch from d79033b to f541db8 Compare November 4, 2026 15:33
mauri870 pushed a commit that referenced this pull request Nov 4, 2026
The runners have moved to ubuntu-26.04, so this is the qemu part of #1
you said you'd take when that happened. `qemu-user-static` has no
installation candidate there, so every PR now fails at that step and the
arm64 runs, the golden check, fmt and lint get skipped. You can see it
on #7, #9 and #19, where Build, Test and the amd64 tsvc run all pass
first. master's last run predates the move, so the next push will hit it
too.

`qemu-user` has the static emulators on 26.04, just without the
`-static` names, so this installs that and links `qemu-aarch64-static`
when it's missing, since the Makefile runs that name. It's been passing
on my fork's ubuntu-26.04 runners, and this PR's own CI runs it too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant