Skip to content

Commit 1944a96

Browse files
authored
build-bazel-package: added rm of extra local folders for toolchain configuration in latest bazel versions. (NixOS#370242)
2 parents ecd810c + 2567fe0 commit 1944a96

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

pkgs/build-support/build-bazel-package/default.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ args@{
3030
# [1]: https://github.com/bazelbuild/rules_cc
3131
, removeRulesCC ? true
3232
, removeLocalConfigCc ? true
33+
, removeLocalConfigSh ? true
3334
, removeLocal ? true
3435

3536
# Use build --nobuild instead of fetch. This allows fetching the dependencies
@@ -154,10 +155,16 @@ stdenv.mkDerivation (fBuildAttrs // {
154155
# Remove all built in external workspaces, Bazel will recreate them when building
155156
rm -rf $bazelOut/external/{bazel_tools,\@bazel_tools.marker}
156157
${lib.optionalString removeRulesCC "rm -rf $bazelOut/external/{rules_cc,\\@rules_cc.marker}"}
158+
157159
rm -rf $bazelOut/external/{embedded_jdk,\@embedded_jdk.marker}
158160
${lib.optionalString removeLocalConfigCc "rm -rf $bazelOut/external/{local_config_cc,\\@local_config_cc.marker}"}
159161
${lib.optionalString removeLocal "rm -rf $bazelOut/external/{local_*,\\@local_*.marker}"}
160162
163+
# For bazel version >= 6 with bzlmod.
164+
${lib.optionalString removeLocalConfigCc "rm -rf $bazelOut/external/*[~+]{local_config_cc,local_config_cc.marker}"}
165+
${lib.optionalString removeLocalConfigSh "rm -rf $bazelOut/external/*[~+]{local_config_sh,local_config_sh.marker}"}
166+
${lib.optionalString removeLocal "rm -rf $bazelOut/external/*[~+]{local_jdk,local_jdk.marker}"}
167+
161168
# Clear markers
162169
find $bazelOut/external -name '@*\.marker' -exec sh -c 'echo > {}' \;
163170

pkgs/by-name/ba/bant/package.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ buildBazelPackage rec {
4040
fetchAttrs = {
4141
hash =
4242
{
43-
aarch64-linux = "sha256-8pLgn67kwVNdqhUXYsdi7OsArCZZmW55UPzUBlIyBbk=";
44-
x86_64-linux = "sha256-dUNdvSJA3SlIIRWmhaq3Hu0+84mBBhxbU/eBDXIv/iI=";
43+
aarch64-linux = "sha256-M6LMaqPli71YvJS/4iwvowCyVaf+qe8WSICR3CgdU34=";
44+
x86_64-linux = "sha256-iBxAzbSriYkkgDDkSjSSSVeWGBygxKAfruh8T5drUFw=";
4545
}
4646
.${system} or (throw "No hash for system: ${system}");
4747
};

pkgs/by-name/pe/perf_data_converter/package.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ buildBazelPackage rec {
3838
fetchAttrs = {
3939
hash =
4040
{
41-
aarch64-linux = "sha256-F4fYZfdCmDzJRR+z1rCLsculP9y9B8H8WHNQbFZEv+s=";
42-
x86_64-linux = "sha256-rjlquK0WcB7Te2uUKKVOrL7+6PtcWQImUWTVafIsbHY=";
41+
aarch64-linux = "sha256-Ksae4VC2FbkW79N5EGn/rTdj+GFKQsZCdi4LPfnzV7Y=";
42+
x86_64-linux = "sha256-TYeS1bax7sA0hJLXqtE8Q5FLnIylcWPZynVE2LhvZKc=";
4343
}
4444
.${system} or (throw "No hash for system: ${system}");
4545
};

0 commit comments

Comments
 (0)