From 9dfdf16a8d5ff3107c4163ac585ec9be3a2abddb Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 20 May 2020 23:31:50 +0100 Subject: fix(3p/nix): Fix build of derivation if cmake is present cmake automatically runs a configure hook which breaks the build, since this isn't actually a cmake project. This hook is now disabled. Additionally Abseil's sources are linked to an absolute derivation path when the build launches, as opposed to the relative path used for development builds. --- third_party/nix/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'third_party') diff --git a/third_party/nix/default.nix b/third_party/nix/default.nix index 288ac60a106b..6a05135f63c1 100644 --- a/third_party/nix/default.nix +++ b/third_party/nix/default.nix @@ -18,6 +18,11 @@ in stdenv.mkDerivation { version = "2.3.4"; src = ./.; + # Abseil's sources need to be linked into a subproject. + postUnpack = '' + ln -fs ${pkgs.abseil_cpp.src} nix/subprojects/abseil_cpp + ''; + nativeBuildInputs = with pkgs; [ bison clang-tools @@ -51,6 +56,9 @@ in stdenv.mkDerivation { "-Dsandbox_shell=${pkgs.busybox-sandbox-shell}/bin/busybox" ]; + # cmake is only included to build Abseil and its hook should not run + dontUseCmakeConfigure = true; + # Install the various symlinks to the Nix binary which users expect # to exist. postInstall = '' -- cgit 1.4.1