mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
Merge pull request #30 from railwayapp/jr/copy-outputs-directly-to-state
copy the outputs directly to the base state
This commit is contained in:
@@ -260,12 +260,11 @@ func (g *BuildGraph) convertNodeToLLB(node *StepNode, baseState *llb.State) (*ll
|
||||
}
|
||||
|
||||
if len(node.Step.Outputs) > 0 {
|
||||
// For multiple outputs, copy them sequentially to maintain efficiency
|
||||
result := llb.Scratch()
|
||||
newState := *baseState
|
||||
|
||||
// Copy each output path individually
|
||||
// Copy the outputs directly to the new state
|
||||
for _, output := range node.Step.Outputs {
|
||||
result = result.File(llb.Copy(state, output, output, &llb.CopyInfo{
|
||||
newState = newState.File(llb.Copy(state, output, output, &llb.CopyInfo{
|
||||
CreateDestPath: true,
|
||||
AllowWildcard: true,
|
||||
AllowEmptyWildcard: true,
|
||||
@@ -273,12 +272,7 @@ func (g *BuildGraph) convertNodeToLLB(node *StepNode, baseState *llb.State) (*ll
|
||||
}), llb.WithCustomNamef("copying %s", output))
|
||||
}
|
||||
|
||||
// Apply to base state
|
||||
state = baseState.File(llb.Copy(result, "/", "/", &llb.CopyInfo{
|
||||
CreateDestPath: true,
|
||||
FollowSymlinks: true,
|
||||
AllowWildcard: true,
|
||||
}), llb.WithCustomNamef("combined outputs: %s", node.Step.Name))
|
||||
state = newState
|
||||
}
|
||||
|
||||
return &state, nil
|
||||
|
||||
Reference in New Issue
Block a user