From d4c4cbfc436c50b1e909e8ac8091424ab64649c1 Mon Sep 17 00:00:00 2001 From: Andre Brisco Date: Sat, 2 Mar 2024 15:41:44 -0800 Subject: [PATCH] Added incompatibility flag to prepare for flip in future Bazel versions --- .bazelrc | 7 +++++++ .../org_gnu_bison/bison_empty_glob.patch | 13 +++++++++++++ dependency_support/org_gnu_bison/org_gnu_bison.bzl | 5 +++++ 3 files changed, 25 insertions(+) create mode 100644 dependency_support/org_gnu_bison/bison_empty_glob.patch diff --git a/.bazelrc b/.bazelrc index f104dd20..7b5a438b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -38,6 +38,13 @@ test:ciremotebuild --tls_client_key=/root/.ssh/buildbuddy-key.pem test:ciremotebuild --build_metadata=VISIBILITY=PUBLIC test:ciremotebuild --remote_timeout=3600 +############################################################################### +## Incompatibility flags +############################################################################### + +# https://github.com/bazelbuild/bazel/issues/8195 +build --incompatible_disallow_empty_glob=true + ############################################################################### ## User flags ############################################################################### diff --git a/dependency_support/org_gnu_bison/bison_empty_glob.patch b/dependency_support/org_gnu_bison/bison_empty_glob.patch new file mode 100644 index 00000000..a6f191d9 --- /dev/null +++ b/dependency_support/org_gnu_bison/bison_empty_glob.patch @@ -0,0 +1,13 @@ +diff --git a/bison/internal/gnulib/gnulib.BUILD b/bison/internal/gnulib/gnulib.BUILD +index 9ee0b51..84fcf5e 100644 +--- a/bison/internal/gnulib/gnulib.BUILD ++++ b/bison/internal/gnulib/gnulib.BUILD +@@ -118,7 +118,7 @@ _GNULIB_SRCS = glob([ + "lib/xmalloc.c", + "lib/xmemdup0.c", + "lib/xstrndup.c", +-]) ++], allow_empty = True) + + _GNULIB_DARWIN_SRCS = [] + diff --git a/dependency_support/org_gnu_bison/org_gnu_bison.bzl b/dependency_support/org_gnu_bison/org_gnu_bison.bzl index 4722e24f..ef478454 100644 --- a/dependency_support/org_gnu_bison/org_gnu_bison.bzl +++ b/dependency_support/org_gnu_bison/org_gnu_bison.bzl @@ -30,4 +30,9 @@ def org_gnu_bison(): name = "rules_bison", sha256 = "2279183430e438b2dc77cacd7b1dbb63438971b2411406570f1ddd920b7c9145", urls = ["https://github.com/jmillikin/rules_bison/releases/download/v0.2.2/rules_bison-v0.2.2.tar.xz"], + patch_args = ["-p1"], + patches = [ + # TODO(https://github.com/jmillikin/rules_bison/pull/14): Delete after this PR is merged + Label("//dependency_support/org_gnu_bison:bison_empty_glob.patch"), + ], )