about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-06-23T00·11-0400
committerglittershark <grfn@gws.fyi>2020-06-23T14·25+0000
commit368e8d1eddb8cd95ded7b2f78e4805c67d28ff91 (patch)
tree9dda8cf75855c90afbeec5f51f8016e7f30e8d1a
parentb94d9f89dc758560a3d5c6716975e79d56820d9e (diff)
feat(3p/nix): Add installCheckPhase r/1067
Add an installCheckPhase that runs the appropriate substituteAll on
common.sh and runs the lang.sh tests with the build artifacts in the
PATH.

Change-Id: I2df5a93b8f3ffdfdc194a0e7d6b6669ef520c345
Reviewed-on: https://cl.tvl.fyi/c/depot/+/561
Reviewed-by: glittershark <grfn@gws.fyi>
-rw-r--r--third_party/default.nix1
-rw-r--r--third_party/nix/default.nix13
2 files changed, 14 insertions, 0 deletions
diff --git a/third_party/default.nix b/third_party/default.nix
index b4b799e8ee59..993d7db352d7 100644
--- a/third_party/default.nix
+++ b/third_party/default.nix
@@ -126,6 +126,7 @@ let
       texlive
       thttpd
       tree
+      utillinux
       which
       writeShellScript
       writeShellScriptBin
diff --git a/third_party/nix/default.nix b/third_party/nix/default.nix
index e6fa3f1f7d62..1a4e4bae089f 100644
--- a/third_party/nix/default.nix
+++ b/third_party/nix/default.nix
@@ -48,11 +48,24 @@ in pkgs.llvmPackages.libcxxStdenv.mkDerivation {
     xz
   ];
 
+  installCheckInputs = with pkgs; [
+    utillinux
+  ];
+
   propagatedBuildInputs = with pkgs; [
     boost
     largeBoehm
   ];
 
+  doInstallCheck = true;
+
+  installCheckPhase = ''
+    export PATH=$out/bin:$PATH
+    cd ../tests/
+    substituteAll common.sh.in common.sh
+    bash lang.sh
+  '';
+
   # Install the various symlinks to the Nix binary which users expect
   # to exist.
   postInstall = ''