|
2 | 2 | //
|
3 | 3 | // SPDX-License-Identifier: MPL-2.0
|
4 | 4 |
|
5 |
| -use log::{debug, info}; |
| 5 | +use log::{debug, error, info}; |
6 | 6 | use std::collections::HashMap;
|
7 | 7 | use std::path::Path;
|
8 | 8 | use thiserror::Error;
|
@@ -127,7 +127,7 @@ impl<'a> CopyCommand<'a> {
|
127 | 127 | fn build(self) -> Command {
|
128 | 128 | let mut cmd = Command::new("nix");
|
129 | 129 |
|
130 |
| - cmd.arg("copy"); |
| 130 | + cmd.arg("-L").arg("copy"); |
131 | 131 |
|
132 | 132 | if !self.fast_connection {
|
133 | 133 | cmd.arg("--substitute-on-destination");
|
@@ -174,7 +174,7 @@ impl<'a> BuildCommand<'a> {
|
174 | 174 | };
|
175 | 175 |
|
176 | 176 | if supports_flakes {
|
177 |
| - cmd.arg("build").arg(derivation_name) |
| 177 | + cmd.arg("-L").arg("build").arg(derivation_name) |
178 | 178 | } else {
|
179 | 179 | cmd.arg(derivation_name)
|
180 | 180 | };
|
@@ -238,9 +238,13 @@ pub async fn push_profile(
|
238 | 238 |
|
239 | 239 | let mut build_cmd = build.build(*derivation_name, supports_flakes);
|
240 | 240 |
|
241 |
| - let build_cmd_handle = build_cmd.output().await.map_err(PushProfileError::Build)?; |
| 241 | + let build_cmd_handle = build_cmd |
| 242 | + .spawn() |
| 243 | + .map_err(PushProfileError::Build)? |
| 244 | + .wait() |
| 245 | + .await; |
242 | 246 |
|
243 |
| - match build_cmd_handle.status.code() { |
| 247 | + match build_cmd_handle.map_err(PushProfileError::Build)?.code() { |
244 | 248 | Some(0) => (),
|
245 | 249 | a => return Err(PushProfileError::BuildExit(a)),
|
246 | 250 | };
|
@@ -272,9 +276,13 @@ pub async fn push_profile(
|
272 | 276 |
|
273 | 277 | let mut copy_cmd = copy.build();
|
274 | 278 |
|
275 |
| - let copy_exit_cmd_handle = copy_cmd.status().await.map_err(PushProfileError::Copy)?; |
| 279 | + let copy_exit_cmd_handle = copy_cmd |
| 280 | + .spawn() |
| 281 | + .map_err(PushProfileError::Copy)? |
| 282 | + .wait() |
| 283 | + .await; |
276 | 284 |
|
277 |
| - match copy_exit_cmd_handle.code() { |
| 285 | + match copy_exit_cmd_handle.map_err(PushProfileError::Copy)?.code() { |
278 | 286 | Some(0) => (),
|
279 | 287 | a => return Err(PushProfileError::CopyExit(a)),
|
280 | 288 | };
|
|
0 commit comments