Skip to content

Commit

Permalink
Don't substitute when setting up the default profile / self-testing (#…
Browse files Browse the repository at this point in the history
…1101)

* setup_default_profile: don't substitute

We already have everything we need, so substitution is not necessary
(and makes it slower in our VM tests without networking).

* self_test: don't substitute

This should always be a local build.
  • Loading branch information
cole-h authored Aug 19, 2024
1 parent 6d0bd3e commit f94502d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/action/base/setup_default_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ impl Action for SetupDefaultProfile {
execute_command(
Command::new(nix_pkg.join("bin/nix-env"))
.process_group(0)
.args(["--option", "substitute", "false"])
.arg("-i")
.arg(&nix_pkg)
.stdin(std::process::Stdio::null())
Expand All @@ -138,6 +139,7 @@ impl Action for SetupDefaultProfile {
execute_command(
Command::new(nix_pkg.join("bin/nix-env"))
.process_group(0)
.args(["--option", "substitute", "false"])
.arg("-i")
.arg(&nss_ca_cert_pkg)
.stdin(std::process::Stdio::null())
Expand Down
2 changes: 1 addition & 1 deletion src/self_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl Shell {
.as_millis();

command.arg(format!(
r#"nix build --no-link --expr 'derivation {{ name = "self-test-{executable}-{timestamp_millis}"; system = "{SYSTEM}"; builder = "/bin/sh"; args = ["-c" "echo hello > \$out"]; }}'"#
r#"nix build --option substitute false --no-link --expr 'derivation {{ name = "self-test-{executable}-{timestamp_millis}"; system = "{SYSTEM}"; builder = "/bin/sh"; args = ["-c" "echo hello > \$out"]; }}'"#
));
let command_str = format!("{:?}", command.as_std());

Expand Down

0 comments on commit f94502d

Please sign in to comment.