From 7e414951031f6772b3ec6d6e4b238d9fa660d3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 11 Nov 2023 12:34:28 +0100 Subject: [PATCH] Revert "bazel: use bash with fallback $PATH consisting of basic shell utils" This reverts commit 3576806d7edc615b2e89ee4f845d67c5b6c7ecc1. It broke python311.pkgs.jaxlib, see https://github.com/NixOS/nixpkgs/pull/265041#issuecomment-1806784693. --- .../build-managers/bazel/bazel_6/default.nix | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix index de82eb54eb9d..8fb37a9f666f 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix @@ -22,7 +22,6 @@ , file , substituteAll , writeTextFile -, writeShellApplication }: let @@ -129,16 +128,6 @@ let defaultShellPath = lib.makeBinPath defaultShellUtils; - bashWithDefaultShellUtils = writeShellApplication { - name = "bash"; - text = '' - if [[ "$PATH" == "/no-such-path" ]]; then - export PATH=${defaultShellPath} - fi - exec ${bash}/bin/bash "$@" - ''; - }; - platforms = lib.platforms.linux ++ lib.platforms.darwin; system = if stdenv.hostPlatform.isDarwin then "darwin" else "linux"; @@ -431,8 +420,8 @@ stdenv.mkDerivation rec { # If you add more replacements here, you must change the grep above! # Only files containing /bin are taken into account. substituteInPlace "$path" \ - --replace /bin/bash ${bashWithDefaultShellUtils}/bin/bash \ - --replace "/usr/bin/env bash" ${bashWithDefaultShellUtils}/bin/bash \ + --replace /bin/bash ${bash}/bin/bash \ + --replace "/usr/bin/env bash" ${bash}/bin/bash \ --replace "/usr/bin/env python" ${python3}/bin/python \ --replace /usr/bin/env ${coreutils}/bin/env \ --replace /bin/true ${coreutils}/bin/true @@ -447,17 +436,17 @@ stdenv.mkDerivation rec { # bazel test runner include references to /bin/bash substituteInPlace tools/build_rules/test_rules.bzl \ - --replace /bin/bash ${bashWithDefaultShellUtils}/bin/bash + --replace /bin/bash ${bash}/bin/bash for i in $(find tools/cpp/ -type f) do substituteInPlace $i \ - --replace /bin/bash ${bashWithDefaultShellUtils}/bin/bash + --replace /bin/bash ${bash}/bin/bash done # Fixup scripts that generate scripts. Not fixed up by patchShebangs below. substituteInPlace scripts/bootstrap/compile.sh \ - --replace /bin/bash ${bashWithDefaultShellUtils}/bin/bash + --replace /bin/bash ${bash}/bin/bash # add nix environment vars to .bazelrc cat >> .bazelrc <