Skip to content

Commit c99df9b

Browse files
committed
MODULE.bazel: keep bazel_dep(bazel-orfs) non-dev for load() visibility
flow/BUILD has \`load(\"@bazel-orfs//:openroad.bzl\", \"orfs_pdk\")\`, which requires @bazel-orfs to be a visible bazel_dep of @orfs even when @orfs is consumed as a non-root module (e.g. by tools/OpenROAD). With dev_dependency = True the bazel_dep is a no-op at non-root consumption and the load() fails. The companion git_override(bazel-orfs, …) is implicitly root-only by Bazel semantics — non-root modules' override directives are silently ignored — so dropping dev_dependency = True does not leak our local pin into downstream consumers; their own bazel-orfs pin still wins. Other dev_dependency = True bazel_deps (openroad, qt-bazel, yosys-slang, bazel-orfs-verilog, toolchains_llvm) are unaffected — none of @orfs's own BUILD files load() from them; the existing load() callers (tools/OpenROAD/src/gui/BUILD, etc.) live in downstream packages that bring their own bazel_deps. Mirrors bazel-orfs's patches/0036-fix-bazel-orfs-bazel_dep-non-dev-for-load-visibility.patch into ORFS directly so bazel-orfs no longer needs to carry it. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 378a3b3 commit c99df9b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎MODULE.bazel‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ bazel_dep(name = "rules_shell", version = "0.6.1")
1818
# dev_dependency = True makes those declarations no-ops in that case, so
1919
# our MODULE.bazel doesn't need to be patched at non-root consumption
2020
# time.
21+
#
22+
# Exception: bazel_dep(name = "bazel-orfs") is intentionally NOT dev-only,
23+
# because flow/BUILD has `load("@bazel-orfs//:openroad.bzl", "orfs_pdk")`
24+
# and load-visibility requires the bazel_dep to be honoured at non-root
25+
# consumption time too. The companion git_override below is silently
26+
# ignored by Bazel when @orfs is non-root, so the downstream module's
27+
# own bazel-orfs pin still wins.
2128

2229
bazel_dep(name = "toolchains_llvm", version = "1.5.0", dev_dependency = True)
2330
bazel_dep(name = "openroad", dev_dependency = True)
@@ -33,7 +40,8 @@ git_override(
3340
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
3441
)
3542

36-
bazel_dep(name = "bazel-orfs", dev_dependency = True)
43+
bazel_dep(name = "bazel-orfs")
44+
3745
bazel_dep(name = "bazel-orfs-verilog", dev_dependency = True)
3846

3947
BAZEL_ORFS_COMMIT = "c000cb3fa5c756841de0411f848a211c360468c2"

0 commit comments

Comments
 (0)