This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: patch bazel_7 with hardcoded bin paths (#59359)
bazel (and its community of rules) is a bit of a mess when it comes to passing around env values, including $PATH, resulting in some actions not receiving the $PATH value set via `--action_path=PATH=...` that we rely on. Bazel 6 in nixpkgs had [the following patch](https://sourcegraph.com/github.com/NixOS/nixpkgs/-/blob/pkgs/development/tools/build-managers/bazel/bazel_6/actions_path.patch) that hardcodes a set of packages to include in that case, which is currently missing from Bazel 7 in nixpkgs, so we (temporarily, hopefully) reintroduce that patch locally. See: NixOS/nixpkgs#262152 (comment) and NixOS/nixpkgs#94222 for some reading I plan to move more bazel stuff out of shell.nix perhaps, into bazel.nix, as its a tad messy all-in-one ## Test plan `bazel build //client/web/dist` is successful
- Loading branch information
Showing
2 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ nixpkgs | ||
, pkgs | ||
, bazel_7 | ||
, lib | ||
, substituteAll | ||
, bash | ||
, coreutils | ||
, diffutils | ||
, file | ||
, findutils | ||
, gawk | ||
, gnugrep | ||
, gnupatch | ||
, gnused | ||
, gnutar | ||
, gzip | ||
, python3 | ||
, unzip | ||
, which | ||
, zip | ||
}: { | ||
bazel_7 = bazel_7.overrideAttrs (oldAttrs: | ||
let | ||
# yoinked from https://sourcegraph.com/github.com/NixOS/nixpkgs/-/blob/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix?L77-120 | ||
defaultShellUtils = [ | ||
bash | ||
coreutils | ||
diffutils | ||
file | ||
findutils | ||
gawk | ||
gnugrep | ||
gnupatch | ||
gnused | ||
gnutar | ||
gzip | ||
python3 | ||
unzip | ||
which | ||
zip | ||
]; | ||
in | ||
{ | ||
# https://github.com/NixOS/nixpkgs/pull/262152#issuecomment-1879053113 | ||
patches = (oldAttrs.patches or [ ]) ++ [ | ||
(substituteAll { | ||
src = "${nixpkgs}/pkgs/development/tools/build-managers/bazel/bazel_6/actions_path.patch"; | ||
actionsPathPatch = lib.makeBinPath defaultShellUtils; | ||
}) | ||
]; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters