Skip to content

Commit 5f9a5d5

Browse files
oharboeclaude
andcommitted
bazel: bison patch resolves repo name with repo_name(), not hardcoded
Gemini flagged the hardcoded `external/bison+/lib` canonical repo name as non-portable (Bazel 7 uses `~`, Bazel 8 `+`). Correct in principle — this repo pins Bazel 8.6.0 so `+` is right for what ships, but the patch is headed upstream (bison@3.8.2.bcr.8) where it must survive both. Gemini's suggested `native.repo_name()` does NOT work here: `native` is undefined at BUILD-file top level (verified: "name 'native' is not defined"), and BISON_COPTS is a top-level assignment. The bare builtin `repo_name()` is the one callable there — verified in a scratch Bazel 8.6.0 module that it returns the canonical name with the separator (`depb+`), so bison resolves to `bison+`, byte-identical to the previous hardcoding on Bazel 8 and correct on Bazel 7.1+. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 3d795c8 commit 5f9a5d5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bazel/bison-patches/0001-gnulib-wrapper-headers-use-I-not-isystem.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ diff --git a/BUILD.bazel b/BUILD.bazel
3737
+# listed as both -I and -isystem stays -isystem, so the -isystem form must
3838
+# go entirely). This restores autotools' AM_CPPFLAGS = -I./lib ordering.
3939
+BISON_COPTS = [
40-
+ "-Iexternal/bison+/lib",
41-
+ "-I$(BINDIR)/external/bison+/lib",
40+
+ "-Iexternal/" + repo_name() + "/lib",
41+
+ "-I$(BINDIR)/external/" + repo_name() + "/lib",
4242
+] + select({
4343
"@rules_cc//cc/compiler:clang": [
4444
"-w",

0 commit comments

Comments
 (0)