diff --git a/src/remote/action.go b/src/remote/action.go index 0b0daa59d..010421611 100644 --- a/src/remote/action.go +++ b/src/remote/action.go @@ -470,7 +470,19 @@ func (c *Client) verifyActionResult(target *core.BuildTarget, command *pb.Comman } for ep, out := range target.EntryPoints { - if _, ok := flatOuts[out]; !ok { + ok := false + // Single output file + if _, ok = flatOuts[out]; ok { + continue + } + // Multiple output files or directories + for _, outputPath := range command.OutputPaths { + entryPointFullPath := fmt.Sprintf("%s/%s", outputPath, out) + if _, ok = flatOuts[entryPointFullPath]; ok { + break + } + } + if !ok { return fmt.Errorf("failed to produce output %v for entry point %v", out, ep) } } @@ -508,11 +520,12 @@ func (c *Client) verifyActionResult(target *core.BuildTarget, command *pb.Comman // At this point it's verified all the directories, but not the files themselves. digests := make([]digest.Digest, 0, len(outputs)) for _, output := range outputs { - // FlattenTree doesn't populate the digest in for empty dirs... we don't need to check them anyway - if !output.IsEmptyDirectory { + // FlattenTree doesn't populate the digest in for empty dirs neither symlinks... we don't need to check them anyway + if !output.IsEmptyDirectory && output.SymlinkTarget == "" { digests = append(digests, output.Digest) } } + if missing, err := c.client.MissingBlobs(context.Background(), digests); err != nil { return fmt.Errorf("Failed to verify action result outputs: %s", err) } else if len(missing) != 0 { diff --git a/src/remote/utils.go b/src/remote/utils.go index 690def42e..e80f34b96 100644 --- a/src/remote/utils.go +++ b/src/remote/utils.go @@ -579,11 +579,10 @@ func removeOutputs(target *core.BuildTarget) error { // subresourceIntegrity returns a string corresponding to a target's hashes in the Subresource Integrity format. func subresourceIntegrity(target *core.BuildTarget) string { - ret := make([]string, len(target.Hashes)) - for i, h := range target.Hashes { - ret[i] = reencodeSRI(target, h) + if len(target.Hashes) == 1 { + return reencodeSRI(target, target.Hashes[0]) } - return strings.Join(ret, " ") + return "" } // reencodeSRI re-encodes a hash from the hex format we use to base64-encoded.