about summary refs log tree commit diff
path: root/third_party/nix/tests/remote-builds.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-05-18T15·39+0200
committerclbot <clbot@tvl.fyi>2022-05-19T14·08+0000
commitd127f9bd0e7b9b2e0df2de8a2227f77c0907468d (patch)
tree68455040d88b8e0c2817601db88ede450873ff8e /third_party/nix/tests/remote-builds.nix
parentc85291c602ac666421627d6934ebc6d5be1b93e1 (diff)
chore(3p/nix): unvendor tvix 0.1 r/4098
Nothing is using this now, and we'll likely never pick this up again,
but we learned a lot in the process.

Every now and then this breaks in some bizarre way on channel bumps
and it's just a waste of time to maintain that.

Change-Id: Idcf2f5acd4ca7070ce18d7149cbfc0d967dc0a44
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5632
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'third_party/nix/tests/remote-builds.nix')
-rw-r--r--third_party/nix/tests/remote-builds.nix108
1 files changed, 0 insertions, 108 deletions
diff --git a/third_party/nix/tests/remote-builds.nix b/third_party/nix/tests/remote-builds.nix
deleted file mode 100644
index b867f13b4995..000000000000
--- a/third_party/nix/tests/remote-builds.nix
+++ /dev/null
@@ -1,108 +0,0 @@
-# Test Nix's remote build feature.
-
-{ nixpkgs, system, nix }:
-
-with import (nixpkgs + "/nixos/lib/testing.nix") { inherit system; };
-
-makeTest (
-
-let
-
-  # The configuration of the remote builders.
-  builder =
-    { config, pkgs, ... }:
-    { services.openssh.enable = true;
-      virtualisation.writableStore = true;
-      nix.package = nix;
-      nix.useSandbox = true;
-    };
-
-  # Trivial Nix expression to build remotely.
-  expr = config: nr: pkgs.writeText "expr.nix"
-    ''
-      let utils = builtins.storePath ${config.system.build.extraUtils}; in
-      derivation {
-        name = "hello-${toString nr}";
-        system = "i686-linux";
-        PATH = "''${utils}/bin";
-        builder = "''${utils}/bin/sh";
-        args = [ "-c" "if [ ${toString nr} = 5 ]; then echo FAIL; exit 1; fi; echo Hello; mkdir $out $foo; cat /proc/sys/kernel/hostname > $out/host; ln -s $out $foo/bar; sleep 10" ];
-        outputs = [ "out" "foo" ];
-      }
-    '';
-
-in
-
-{
-
-  nodes =
-    { builder1 = builder;
-      builder2 = builder;
-
-      client =
-        { config, pkgs, ... }:
-        { nix.maxJobs = 0; # force remote building
-          nix.distributedBuilds = true;
-          nix.buildMachines =
-            [ { hostName = "builder1";
-                sshUser = "root";
-                sshKey = "/root/.ssh/id_ed25519";
-                system = "i686-linux";
-                maxJobs = 1;
-              }
-              { hostName = "builder2";
-                sshUser = "root";
-                sshKey = "/root/.ssh/id_ed25519";
-                system = "i686-linux";
-                maxJobs = 1;
-              }
-            ];
-          virtualisation.writableStore = true;
-          virtualisation.pathsInNixDB = [ config.system.build.extraUtils ];
-          nix.package = nix;
-          nix.binaryCaches = [ ];
-          programs.ssh.extraConfig = "ConnectTimeout 30";
-        };
-    };
-
-  testScript = { nodes }:
-    ''
-      startAll;
-
-      # Create an SSH key on the client.
-      my $key = `${pkgs.openssh}/bin/ssh-keygen -t ed25519 -f key -N ""`;
-      $client->succeed("mkdir -p -m 700 /root/.ssh");
-      $client->copyFileFromHost("key", "/root/.ssh/id_ed25519");
-      $client->succeed("chmod 600 /root/.ssh/id_ed25519");
-
-      # Install the SSH key on the builders.
-      $client->waitForUnit("network.target");
-      foreach my $builder ($builder1, $builder2) {
-          $builder->succeed("mkdir -p -m 700 /root/.ssh");
-          $builder->copyFileFromHost("key.pub", "/root/.ssh/authorized_keys");
-          $builder->waitForUnit("sshd");
-          $client->succeed("ssh -o StrictHostKeyChecking=no " . $builder->name() . " 'echo hello world'");
-      }
-
-      # Perform a build and check that it was performed on the builder.
-      my $out = $client->succeed(
-        "nix-build ${expr nodes.client.config 1} 2> build-output",
-        "grep -q Hello build-output"
-      );
-      $builder1->succeed("test -e $out");
-
-      # And a parallel build.
-      my ($out1, $out2) = split /\s/,
-          $client->succeed('nix-store -r $(nix-instantiate ${expr nodes.client.config 2})\!out $(nix-instantiate ${expr nodes.client.config 3})\!out');
-      $builder1->succeed("test -e $out1 -o -e $out2");
-      $builder2->succeed("test -e $out1 -o -e $out2");
-
-      # And a failing build.
-      $client->fail("nix-build ${expr nodes.client.config 5}");
-
-      # Test whether the build hook automatically skips unavailable builders.
-      $builder1->block;
-      $client->succeed("nix-build ${expr nodes.client.config 4}");
-    '';
-
-})