diff --git a/client/build_test.go b/client/build_test.go index 4c82fab46b8c..3732434c8d8a 100644 --- a/client/build_test.go +++ b/client/build_test.go @@ -1135,7 +1135,7 @@ func testClientGatewayExecError(t *testing.T, sb integration.Sandbox) { var se *errdefs.SolveError require.True(t, errors.As(solveErr, &se)) require.Len(t, se.InputIDs, tt.NumMounts) - require.Len(t, se.OutputIDs, tt.NumMounts) + require.Len(t, se.MountIDs, tt.NumMounts) op := se.Solve.Op require.NotNil(t, op) @@ -1151,7 +1151,7 @@ func testClientGatewayExecError(t *testing.T, sb integration.Sandbox) { mounts = append(mounts, client.Mount{ Selector: mnt.Selector, Dest: mnt.Dest, - ResultID: se.Solve.OutputIDs[i], + ResultID: se.Solve.MountIDs[i], Readonly: mnt.Readonly, MountType: mnt.MountType, CacheOpt: mnt.CacheOpt, @@ -1262,7 +1262,7 @@ func testClientGatewaySlowCacheExecError(t *testing.T, sb integration.Sandbox) { require.True(t, ok) // Slow cache errors should only have exactly one input and no outputs. require.Len(t, se.Solve.InputIDs, 1) - require.Len(t, se.Solve.OutputIDs, 0) + require.Len(t, se.Solve.MountIDs, 0) st := llb.Image("busybox:latest") def, err := st.Marshal(ctx) @@ -1390,7 +1390,7 @@ func testClientGatewayExecFileActionError(t *testing.T, sb integration.Sandbox) require.Len(t, se.Solve.InputIDs, tt.NumInputs) // There is one output for every action in the fileop that failed. - require.Len(t, se.Solve.OutputIDs, tt.NumOutputs) + require.Len(t, se.Solve.MountIDs, tt.NumOutputs) op, ok := se.Solve.Op.Op.(*pb.Op_File) require.True(t, ok) @@ -1404,7 +1404,7 @@ func testClientGatewayExecFileActionError(t *testing.T, sb integration.Sandbox) action := op.File.Actions[idx] // The output for a file action is mapped by its index. - inputID := se.OutputIDs[idx] + inputID := se.MountIDs[idx] var secondaryID string if action.SecondaryInput != -1 { @@ -1414,7 +1414,7 @@ func testClientGatewayExecFileActionError(t *testing.T, sb integration.Sandbox) if int(action.SecondaryInput) < len(se.InputIDs) { secondaryID = se.InputIDs[action.SecondaryInput] } else { - secondaryID = se.OutputIDs[int(action.SecondaryInput)-len(se.InputIDs)] + secondaryID = se.MountIDs[int(action.SecondaryInput)-len(se.InputIDs)] } } diff --git a/frontend/gateway/forwarder/forward.go b/frontend/gateway/forwarder/forward.go index c79379b15b0a..4e9221c2b434 100644 --- a/frontend/gateway/forwarder/forward.go +++ b/frontend/gateway/forwarder/forward.go @@ -119,12 +119,12 @@ func (c *bridgeClient) Inputs(ctx context.Context) (map[string]llb.State, error) func (c *bridgeClient) wrapSolveError(solveErr error) error { var ( - ee *llberrdefs.ExecError - fae *llberrdefs.FileActionError - sce *solver.SlowCacheError - inputIDs []string - outputIDs []string - subject errdefs.IsSolve_Subject + ee *llberrdefs.ExecError + fae *llberrdefs.FileActionError + sce *solver.SlowCacheError + inputIDs []string + mountIDs []string + subject errdefs.IsSolve_Subject ) if errors.As(solveErr, &ee) { var err error @@ -132,7 +132,7 @@ func (c *bridgeClient) wrapSolveError(solveErr error) error { if err != nil { return err } - outputIDs, err = c.registerResultIDs(ee.Outputs...) + mountIDs, err = c.registerResultIDs(ee.Outputs...) if err != nil { return err } @@ -148,7 +148,7 @@ func (c *bridgeClient) wrapSolveError(solveErr error) error { } subject = sce.ToSubject() } - return errdefs.WithSolveError(solveErr, subject, inputIDs, outputIDs) + return errdefs.WithSolveError(solveErr, subject, inputIDs, mountIDs) } func (c *bridgeClient) registerResultIDs(results ...solver.Result) (ids []string, err error) { diff --git a/frontend/gateway/gateway.go b/frontend/gateway/gateway.go index 62017981e546..9a7429b9820a 100644 --- a/frontend/gateway/gateway.go +++ b/frontend/gateway/gateway.go @@ -500,12 +500,12 @@ func translateLegacySolveRequest(req *pb.SolveRequest) error { func (lbf *llbBridgeForwarder) wrapSolveError(solveErr error) error { var ( - ee *llberrdefs.ExecError - fae *llberrdefs.FileActionError - sce *solver.SlowCacheError - inputIDs []string - outputIDs []string - subject errdefs.IsSolve_Subject + ee *llberrdefs.ExecError + fae *llberrdefs.FileActionError + sce *solver.SlowCacheError + inputIDs []string + mountIDs []string + subject errdefs.IsSolve_Subject ) if errors.As(solveErr, &ee) { var err error @@ -513,7 +513,7 @@ func (lbf *llbBridgeForwarder) wrapSolveError(solveErr error) error { if err != nil { return err } - outputIDs, err = lbf.registerResultIDs(ee.Outputs...) + mountIDs, err = lbf.registerResultIDs(ee.Outputs...) if err != nil { return err } @@ -529,7 +529,7 @@ func (lbf *llbBridgeForwarder) wrapSolveError(solveErr error) error { } subject = sce.ToSubject() } - return errdefs.WithSolveError(solveErr, subject, inputIDs, outputIDs) + return errdefs.WithSolveError(solveErr, subject, inputIDs, mountIDs) } func (lbf *llbBridgeForwarder) registerResultIDs(results ...solver.Result) (ids []string, err error) { diff --git a/solver/errdefs/errdefs.pb.go b/solver/errdefs/errdefs.pb.go index ea89b906d64b..5da34b6e591b 100644 --- a/solver/errdefs/errdefs.pb.go +++ b/solver/errdefs/errdefs.pb.go @@ -182,9 +182,9 @@ func (m *Subrequest) GetName() string { } type Solve struct { - InputIDs []string `protobuf:"bytes,1,rep,name=inputIDs,proto3" json:"inputIDs,omitempty"` - OutputIDs []string `protobuf:"bytes,2,rep,name=outputIDs,proto3" json:"outputIDs,omitempty"` - Op *pb.Op `protobuf:"bytes,3,opt,name=op,proto3" json:"op,omitempty"` + InputIDs []string `protobuf:"bytes,1,rep,name=inputIDs,proto3" json:"inputIDs,omitempty"` + MountIDs []string `protobuf:"bytes,2,rep,name=mountIDs,proto3" json:"mountIDs,omitempty"` + Op *pb.Op `protobuf:"bytes,3,opt,name=op,proto3" json:"op,omitempty"` // Types that are valid to be assigned to Subject: // *Solve_File // *Solve_Cache @@ -246,9 +246,9 @@ func (m *Solve) GetInputIDs() []string { return nil } -func (m *Solve) GetOutputIDs() []string { +func (m *Solve) GetMountIDs() []string { if m != nil { - return m.OutputIDs + return m.MountIDs } return nil } @@ -373,27 +373,27 @@ func init() { func init() { proto.RegisterFile("errdefs.proto", fileDescriptor_689dc58a5060aff5) } var fileDescriptor_689dc58a5060aff5 = []byte{ - // 349 bytes of a gzipped FileDescriptorProto + // 348 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcd, 0x8e, 0xd3, 0x30, - 0x14, 0x85, 0x27, 0xbf, 0x43, 0x6e, 0x81, 0x85, 0x81, 0x51, 0x34, 0x62, 0x91, 0xb1, 0x58, 0x14, - 0x09, 0x12, 0xa9, 0x3c, 0x01, 0x14, 0x55, 0xed, 0xaa, 0x92, 0x2b, 0xb1, 0x8f, 0x93, 0x9b, 0xd6, - 0x90, 0xda, 0xc6, 0xb1, 0x51, 0x79, 0x39, 0x9e, 0x0d, 0xc5, 0x0d, 0x2d, 0x8b, 0xee, 0x72, 0xee, - 0xf7, 0xe5, 0x26, 0xc7, 0x86, 0x17, 0x68, 0x4c, 0x8b, 0xdd, 0x50, 0x6a, 0xa3, 0xac, 0x22, 0xf7, - 0x53, 0x7c, 0xfc, 0xb0, 0x17, 0xf6, 0xe0, 0x78, 0xd9, 0xa8, 0x63, 0x75, 0x54, 0xfc, 0x77, 0xc5, - 0x9d, 0xe8, 0xdb, 0x1f, 0xc2, 0x56, 0x83, 0xea, 0x7f, 0xa1, 0xa9, 0x34, 0xaf, 0x94, 0x9e, 0x5e, - 0xa3, 0x05, 0xa4, 0xdf, 0xd0, 0x58, 0x3c, 0x91, 0x07, 0x48, 0x5b, 0xb1, 0xc7, 0xc1, 0xe6, 0x41, - 0x11, 0xcc, 0x33, 0x36, 0x25, 0xba, 0x85, 0x74, 0xa7, 0x9c, 0x69, 0x90, 0x50, 0x88, 0x85, 0xec, - 0x94, 0xe7, 0xb3, 0xc5, 0xcb, 0x52, 0xf3, 0xf2, 0x4c, 0x36, 0xb2, 0x53, 0xcc, 0x33, 0xf2, 0x04, - 0xa9, 0xa9, 0xe5, 0x1e, 0x87, 0x3c, 0x2c, 0xa2, 0xf9, 0x6c, 0x91, 0x8d, 0x16, 0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xbf, 0x1c, 0x8e, 0xf6, 0xa2, 0xf1, + 0x37, 0x80, 0x64, 0x37, 0xf5, 0x21, 0xb7, 0xf0, 0x42, 0x48, 0xed, 0xec, 0xd3, 0xb7, 0x31, 0x0f, + 0x8a, 0x68, 0x9d, 0xb1, 0x73, 0x9e, 0xd8, 0xa0, 0x9c, 0xf4, 0x2c, 0x9c, 0xd9, 0x29, 0x93, 0x1b, + 0x08, 0x95, 0xce, 0x23, 0xdf, 0x25, 0x9d, 0x4e, 0xb9, 0xd5, 0x2c, 0x54, 0x9a, 0x7c, 0x80, 0xb8, + 0x13, 0x3d, 0xe6, 0xb1, 0x27, 0x6f, 0xca, 0xd3, 0x35, 0x3f, 0x88, 0x1e, 0xbf, 0x34, 0x56, 0x28, + 0xf9, 0x78, 0xc5, 0xbc, 0x42, 0x3e, 0x41, 0xd2, 0xd4, 0xcd, 0x01, 0xf3, 0xc4, 0xbb, 0xef, 0xce, + 0xee, 0xc6, 0xd7, 0xb3, 0x9b, 0x09, 0x3e, 0x5e, 0xb1, 0xd9, 0xfa, 0x9a, 0xc1, 0xf5, 0xe8, 0xf8, + 0x0f, 0x6c, 0x2c, 0xa5, 0x00, 0xff, 0xe7, 0x91, 0xb7, 0x90, 0x08, 0xd9, 0xe2, 0xd1, 0x37, 0x8c, + 0xd8, 0x1c, 0xe8, 0x7b, 0x78, 0xf9, 0x7c, 0xce, 0x65, 0x8b, 0xa7, 0xfe, 0x1d, 0x3f, 0xff, 0x0b, + 0x00, 0x00, 0xff, 0xff, 0x1e, 0xfa, 0x9c, 0x6f, 0x0f, 0x02, 0x00, 0x00, } diff --git a/solver/errdefs/errdefs.proto b/solver/errdefs/errdefs.proto index 67e0fd43f9d4..d4b9177540b7 100644 --- a/solver/errdefs/errdefs.proto +++ b/solver/errdefs/errdefs.proto @@ -23,7 +23,7 @@ message Subrequest { message Solve { repeated string inputIDs = 1; - repeated string outputIDs = 2; + repeated string mountIDs = 2; pb.Op op = 3; oneof subject { diff --git a/solver/errdefs/solve.go b/solver/errdefs/solve.go index 7d6e459b5403..97ce5a3f92a1 100644 --- a/solver/errdefs/solve.go +++ b/solver/errdefs/solve.go @@ -36,7 +36,7 @@ func (e *SolveError) ToProto() grpcerrors.TypedErrorProto { return &e.Solve } -func WithSolveError(err error, subject IsSolve_Subject, inputIDs, outputIDs []string) error { +func WithSolveError(err error, subject IsSolve_Subject, inputIDs, mountIDs []string) error { if err == nil { return nil } @@ -50,10 +50,10 @@ func WithSolveError(err error, subject IsSolve_Subject, inputIDs, outputIDs []st return &SolveError{ Err: err, Solve: Solve{ - InputIDs: inputIDs, - OutputIDs: outputIDs, - Op: op, - Subject: subject, + InputIDs: inputIDs, + MountIDs: mountIDs, + Op: op, + Subject: subject, }, } } diff --git a/solver/llbsolver/ops/exec.go b/solver/llbsolver/ops/exec.go index 052721a69e32..9b5355ed7c74 100644 --- a/solver/llbsolver/ops/exec.go +++ b/solver/llbsolver/ops/exec.go @@ -245,11 +245,11 @@ func (e *execOp) Exec(ctx context.Context, g session.Group, inputs []solver.Resu } execInputs[i] = inputs[m.Input] } - execOutputs := make([]solver.Result, len(e.op.Mounts)) + execMounts := make([]solver.Result, len(e.op.Mounts)) for i, res := range results { - execOutputs[p.OutputRefs[i].MountIndex] = res + execMounts[p.OutputRefs[i].MountIndex] = res } - err = errdefs.WithExecError(err, execInputs, execOutputs) + err = errdefs.WithExecError(err, execInputs, execMounts) } }() if err != nil {