Skip to content

Commit 0a22667

Browse files
committed
buildClosure: copy drvPath to remote
1 parent 19cad61 commit 0a22667

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/nixbuild.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ func buildClosure(spec JobSpec, builder string) (string, error) {
1515

1616
// Build the closure locally or on the remote builder
1717
if builder != "localhost" {
18+
if _, err := run("nix", "copy", "--to", "ssh-ng://"+builder, spec.DrvPath); err != nil {
19+
return "", fmt.Errorf("failed to copy derivation to %s: %v", builder, err)
20+
}
21+
1822
results, err = runJSON[[]BuildResult]("nix", "build", "--no-link", "--json", "--store", "ssh-ng://"+builder, spec.DrvPath+"^*")
1923
} else {
2024
results, err = runJSON[[]BuildResult]("nix", "build", "--no-link", "--json", spec.DrvPath+"^*")
@@ -30,7 +34,6 @@ func buildClosure(spec JobSpec, builder string) (string, error) {
3034
return "", fmt.Errorf("missing 'out' key in build result for %s", spec.Output)
3135
}
3236

33-
// Step 5: Copy built closure back from builder to local (if needed)
3437
if builder != "localhost" {
3538
if _, err := run("nix", "copy", "--from", "ssh-ng://"+builder, out, "--no-check-sigs"); err != nil {
3639
return "", fmt.Errorf("could not copy from %s: %v", builder, err)

0 commit comments

Comments
 (0)