From 1d9c10c8de0634408a4bd3485092932563d3a463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 10 Mar 2020 11:04:32 +0100 Subject: [PATCH] stdenv cc-wrapper: deal with edge-case regressions Regression introduced in PR #81191 80729b6787d. The file does not exist somewhere during bootstrap of pkgsStatic.busybox which is used in nix (by default). I tested the builds. --- pkgs/build-support/cc-wrapper/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index a4370ff6793..7ae1c87e993 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -366,7 +366,9 @@ stdenv.mkDerivation { # There are a few tools (to name one libstdcxx5) which do not work # well with multi line flags, so make the flags single line again + '' - substituteInPlace $out/nix-support/libc-cflags --replace $'\n' ' ' + if [ -e "$out/nix-support/libc-cflags" ]; then + substituteInPlace "$out/nix-support/libc-cflags" --replace $'\n' ' ' + fi substituteAll ${./add-flags.sh} $out/nix-support/add-flags.sh substituteAll ${./add-hardening.sh} $out/nix-support/add-hardening.sh