Skip to content

Commit 1853137

Browse files
donislawdevclaude
andcommitted
fix: three guards described a build this project does not ship
Two built cmd/tfg without the build tags, which stopped compiling when the missing tag became a refusal - and one of them reported that as a SKIP rather than as a failure, which is the silent shape this project has paid for before. The third matched the literal text of a workflow line and read an added flag as a job that had disappeared. Measured while fixing them: the tags do NOT change the dependency set of cmd/tfg - go list -deps returns the same packages either way, zero lines differing - so the guards that ask what the binary links were answering correctly. What the tags change is which files are compiled, which is why the analysis jobs needed them and these builds do. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 0a18be2 commit 1853137

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎internal/guard/licencelist_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ func buildCommandLine(t *testing.T) string {
105105
if os.Getenv("GOOS") == "windows" || filepath.Separator == '\\' {
106106
binary += ".exe"
107107
}
108-
build := exec.Command("go", "build", "-trimpath", "-o", binary, "../../cmd/tfg")
108+
// With the tags. Without them this build stopped compiling on 2026-09-06,
109+
// and the failure arrived as a SKIP rather than as a red guard - which is
110+
// the silent shape this project has paid for before.
111+
build := exec.Command("go", "build", "-tags", buildTags(), "-trimpath", "-o", binary, "../../cmd/tfg")
109112
build.Env = append(os.Environ(), "CGO_ENABLED=0")
110113
if out, err := build.CombinedOutput(); err != nil {
111114
t.Skipf("building the command line binary is not possible here: %v\n%s", err, out)

‎internal/guard/sbomgate_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ func TestTheWorkflowScansBothBinariesAndReadsTheReport(t *testing.T) {
149149
for _, want := range []string{
150150
"-trimpath -o dist/tfg ./cmd/tfg",
151151
"-trimpath -o dist/tfg-gui ./cmd/tfg-gui",
152-
"go run ./internal/legal/cmd/sbom",
152+
// The package rather than the whole line: build tags went in front of it
153+
// on 2026-09-06, and a guard reading a literal reports a flag as a missing
154+
// job.
155+
"./internal/legal/cmd/sbom",
153156
"python .github/scripts/sbom_gate.py scan.json ours.spdx.json",
154157
} {
155158
if !strings.Contains(workflow, want) {

‎internal/guard/windowsubsystem_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ func TestTheWindowBinaryStartsWithoutAConsole(t *testing.T) {
8686

8787
built := filepath.Join(t.TempDir(), binary.name)
8888

89-
args := []string{"build"}
89+
// With the tags, because a build without them does not compile at all
90+
// since 2026-09-06 - and because the header this reads belongs to the
91+
// binary this project ships rather than to some other build of it.
92+
args := []string{"build", "-tags", buildTags()}
9093
if binary.ldflags != "" {
9194
args = append(args, "-ldflags="+binary.ldflags)
9295
}

0 commit comments

Comments
 (0)