Skip to content

Commit f52045f

Browse files
donislawdevclaude
andcommitted
guard: skip the subsystem check where there is no toolchain
This one reads a header out of a binary, so it has to build one. The Linux runner cross compiles the guard suite outside and carries the test binary into a bare container on purpose, so there is no Go in there to build with - and this failed the whole Linux run rather than saying so, in words that read like a defect in the tree. The three other guards that shell out to the toolchain already say it out loud when they cannot reach it. A build that runs and fails is still fatal. Only the absence of the toolchain is a skip, because a guard that could not be run is not a guard that passed. With this, the whole suite passes in a Linux container again for the first time since the guard was added, and it repaid that immediately: the first complete run caught an emoji in a comment in this package, which ships, and breaks the punctuation rule. The Windows suite had not shown it because a single test had been run rather than all of them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 55b52ab commit f52045f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎internal/guard/windowsubsystem_test.go‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ func TestTheWindowBinaryStartsWithoutAConsole(t *testing.T) {
6969
},
7070
} {
7171
t.Run(binary.name, func(t *testing.T) {
72+
// This one has to build something, which the three other guards
73+
// that shell out to the toolchain already say out loud when they
74+
// cannot. tools/linux-check.py cross compiles the test binary here
75+
// and carries it into a container that deliberately has no Go, so
76+
// without this the whole Linux run failed on a missing toolchain
77+
// rather than on anything about this tree - and said so in words
78+
// that read like a defect in the product.
79+
//
80+
// A build that runs and fails is still fatal below. Only the
81+
// absence of the toolchain is a skip, because a guard that cannot
82+
// be run is not a guard that passed.
83+
if _, err := exec.LookPath("go"); err != nil {
84+
t.Skipf("no Go toolchain here, so nothing can be built to read a header from: %v", err)
85+
}
86+
7287
built := filepath.Join(t.TempDir(), binary.name)
7388

7489
args := []string{"build"}

0 commit comments

Comments
 (0)