Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pkg/build/gobuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,11 @@ func goversionm(ctx context.Context, file string, appPath string, appFileName st
switch se.(type) {
case oci.SignedImage:
sbom := bytes.NewBuffer(nil)
// seems in go1.24 the -m flag breaks things
// tested with go1.23 and works, but starting with go1.24.0 it breaks
cmd := exec.CommandContext(ctx, gobin, "version", file)
cmd := exec.CommandContext(ctx, gobin, "version", "-m", file)
cmd.Stdout = sbom
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return nil, "", fmt.Errorf("go version %s: %w", file, err)
return nil, "", fmt.Errorf("go version -m %s: %w", file, err)
}

// In order to get deterministics SBOMs replace our randomized
Expand Down
1 change: 1 addition & 0 deletions pkg/build/gobuilds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Test_gobuilds(t *testing.T) {
opts := []Option{
WithBaseImages(func(context.Context, string) (name.Reference, Result, error) { return baseRef, base, nil }),
withBuilder(writeTempFile),
withSBOMber(fauxSBOM),
WithPlatforms("all"),
}

Expand Down