Skip to content

Commit

Permalink
Patch rules_android_ndk to add allow_empty (google#1152)
Browse files Browse the repository at this point in the history
There was an attempt to make 'rules_android_ndk' compatible with
'--incompatible_disallow_empty_glob' [1], but it seems that it was not
complete.

To unblock Mozc to enable '--incompatible_disallow_empty_glob' (google#1150),
let's work around this in the Mozc side for now.

There must be no behavior change in the final artifacts.

  [1]: bazelbuild/rules_android_ndk#37

PiperOrigin-RevId: 709015396
  • Loading branch information
yukawa authored Dec 24, 2024
1 parent 81d9aa7 commit 990c417
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,17 @@ bazel_dep(
)
single_version_override(
module_name = "rules_android_ndk",
patches = ["bazel/rules_android_ndk.patch"],
# Bazel's built-in patch engine cannot deal with a patch file that affects
# multiple files. This is why we have two separate patch files here.
# https://github.com/bazelbuild/bazel/issues/10267
patches = [
# Look like this should have been included in the following PR.
# https://github.com/bazelbuild/rules_android_ndk/pull/37
"bazel/rules_android_ndk.allow_empty_glob.patch",
# Might be removed after the folloing PR.
# https://github.com/bazelbuild/rules_android_ndk/pull/63
"bazel/rules_android_ndk.patch",
],
version = "0.1.2",
)

Expand Down
11 changes: 11 additions & 0 deletions src/bazel/rules_android_ndk.allow_empty_glob.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- BUILD.ndk_clang.tpl
+++ BUILD.ndk_clang.tpl
@@ -49,7 +49,7 @@
"bin/*",
"lib64/**/*",
"lib/**/*",
- ]),
+ ], allow_empty = True),
)

filegroup(

0 comments on commit 990c417

Please sign in to comment.