From c0b4a54146e23e0600f43c1a39af956edf62ab54 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 25 May 2023 19:26:11 -0700 Subject: [PATCH] release/dist/cli: correctly handle absolute build outputs in manifest Some builders return absolute paths to build products already. When that happens, the manifest writing logic shouldn't tack on another absolute prefix. Signed-off-by: David Anderson --- release/dist/cli/cli.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/release/dist/cli/cli.go b/release/dist/cli/cli.go index 8c43ee0d5..bd1ecf856 100644 --- a/release/dist/cli/cli.go +++ b/release/dist/cli/cli.go @@ -124,10 +124,11 @@ func runBuild(ctx context.Context, filters []string, targets []dist.Target) erro if err != nil { return fmt.Errorf("getting absolute path of manifest: %w", err) } - fmt.Println(manifest) - fmt.Println(filepath.Join(b.Out, out[0])) for i := range out { - rel, err := filepath.Rel(filepath.Dir(manifest), filepath.Join(b.Out, out[i])) + if !filepath.IsAbs(out[i]) { + out[i] = filepath.Join(b.Out, out[i]) + } + rel, err := filepath.Rel(filepath.Dir(manifest), out[i]) if err != nil { return fmt.Errorf("making path relative: %w", err) }