1
0
mirror of https://github.com/ko-build/ko.git synced 2025-11-06 09:19:12 +02:00

Revert "drop -m flag"

This reverts commit 3f2f5a5d2c.
This commit is contained in:
Yuto Iso
2025-05-16 20:40:20 +09:00
committed by Jason Hall
parent b93f07e7b5
commit 46a92ace90

View File

@@ -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