mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 06:14:26 +03:00
bazel: bazelRC path set by a patch
In bazel source code change in the future, patch will fail and we'll detect the regression sooner.
This commit is contained in:
parent
1ce0375b2f
commit
4fdea7312e
13
pkgs/development/tools/build-managers/bazel/bazel_rc.patch
Normal file
13
pkgs/development/tools/build-managers/bazel/bazel_rc.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/src/main/cpp/option_processor.cc b/src/main/cpp/option_processor.cc
|
||||
index 8f8f15685f..a7ae52d1e4 100644
|
||||
--- a/src/main/cpp/option_processor.cc
|
||||
+++ b/src/main/cpp/option_processor.cc
|
||||
@@ -56,7 +56,7 @@ OptionProcessor::OptionProcessor(
|
||||
: workspace_layout_(workspace_layout),
|
||||
startup_options_(std::move(default_startup_options)),
|
||||
parse_options_called_(false),
|
||||
- system_bazelrc_path_(BAZEL_SYSTEM_BAZELRC_PATH) {}
|
||||
+ system_bazelrc_path_("@bazelSystemBazelRCPath@") {}
|
||||
|
||||
OptionProcessor::OptionProcessor(
|
||||
const WorkspaceLayout* workspace_layout,
|
@ -171,6 +171,13 @@ stdenv.mkDerivation rec {
|
||||
src = ./strict_action_env.patch;
|
||||
strictActionEnvPatch = defaultShellPath;
|
||||
})
|
||||
|
||||
# bazel reads its system bazelrc in /etc
|
||||
# override this path to a builtin one
|
||||
(substituteAll {
|
||||
src = ./bazel_rc.patch;
|
||||
bazelSystemBazelRCPath = bazelRC;
|
||||
})
|
||||
] ++ lib.optional enableNixHacks ./nix-hacks.patch;
|
||||
|
||||
|
||||
@ -431,12 +438,6 @@ stdenv.mkDerivation rec {
|
||||
mv runfiles.bash.tmp tools/bash/runfiles/runfiles.bash
|
||||
|
||||
patchShebangs .
|
||||
|
||||
# bazel reads its system bazelrc in /etc
|
||||
# override this path to a builtin one
|
||||
substituteInPlace \
|
||||
src/main/cpp/option_processor.cc \
|
||||
--replace BAZEL_SYSTEM_BAZELRC_PATH "\"${bazelRC}\""
|
||||
'';
|
||||
in lib.optionalString stdenv.hostPlatform.isDarwin darwinPatches
|
||||
+ genericPatches;
|
||||
|
Loading…
Reference in New Issue
Block a user