Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 36 additions & 9 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bazel_dep(name = "rules_nodejs", version = "6.7.3", dev_dependency = True)
bazel_dep(name = "qt-bazel")
git_override(
module_name = "qt-bazel",
commit = "df022f4ebaa4130713692fffd2f519d49e9d0b97",
commit = "886104974c2fd72439f2c33b5deebf0fe4649df7",
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
)

Expand Down Expand Up @@ -110,8 +110,9 @@ single_version_override(
bazel_dep(name = "rules_scala", version = "7.1.5", dev_dependency = True)
bazel_dep(name = "bazel-orfs", dev_dependency = True)
bazel_dep(name = "bazel-orfs-verilog", dev_dependency = True)
bazel_dep(name = "orfs", dev_dependency = True)

BAZEL_ORFS_COMMIT = "f5e20547f93729a4f67929902aaa3386d933bad0"
BAZEL_ORFS_COMMIT = "6226c2e8f66b51013df7d0df709518f85df9b63c"

BAZEL_ORFS_REMOTE = "https://github.com/The-OpenROAD-Project/bazel-orfs.git"

Expand All @@ -129,6 +130,37 @@ git_override(
strip_prefix = "verilog",
)

# Mirrors the override in bazel-orfs/MODULE.bazel. Needed at root because
# overrides declared in non-root modules are ignored by Bazel. Patches are
# copied from bazel-orfs/patches/ because git_override only accepts patches
# from the main repository.
git_override(
module_name = "orfs",
commit = "bdb262792fef3797730e1b8341b946426272dcdc",
patch_strip = 1,
patches = [
"//bazel/orfs-patches:0035-fix-remove-non-root-overrides-from-MODULE.bazel.patch",
"//bazel/orfs-patches:orfs-preserve-tool-exe-env.patch",
],
remote = "https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git",
)

# Mirrors the single_version_override in bazel-orfs/MODULE.bazel: non-root
# overrides are ignored so apply at root. Gives bazel-orfs rules access to
# @yosys//:yosys_share and exposes the Yosys headers it needs.
single_version_override(
module_name = "yosys",
patch_strip = 1,
patches = [
"//bazel/orfs-patches:yosys-visibility.patch",
"//bazel/orfs-patches:yosys-hdrs.patch",
# BCR yosys 0.62 ships backends/aiger2/aiger.cc but doesn't compile
# it, so yosys aborts on the internal write_xaiger2 call from
# abc_new.cc. Wire it into the binary via BUILD.bazel.
"//bazel/orfs-patches:yosys-backend-aiger2.patch",
],
)

# --- Extensions ---

llvm = use_extension(
Expand Down Expand Up @@ -183,16 +215,11 @@ npm.npm_translate_lock(
use_repo(npm, "npm")

orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories", dev_dependency = True)

# To bump version, run: bazelisk run @bazel-orfs//:bump
orfs.default(
# Official image https://hub.docker.com/r/openroad/orfs/tags
image = "docker.io/openroad/orfs:26Q1-816-gf40d2f346",
# Use OpenROAD of this repo instead of from the docker image
# Use OpenROAD of this repo instead of from @openroad
openroad = "//:openroad",
sha256 = "2b05a14ae8062b4af82b245d648e95fa0293e09b61b57468518b66578744afb8",
opensta = "//src/sta:opensta",
)
use_repo(orfs, "docker_orfs")

SCALA_VERSION = "2.13.17"

Expand Down
87 changes: 52 additions & 35 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98yvind=20Harboe?= <oyvind.harboe@zylin.com>
Date: Wed, 2 Apr 2026 22:00:00 +0200
Subject: [PATCH] fix: remove non-root overrides from MODULE.bazel

When ORFS is fetched as a non-root dependency, git_override and
orfs.default() directives are ignored/illegal. Remove them so
the module can be used as a dependency without errors.

Signed-off-by: =?UTF-8?q?=C3=98yvind=20Harboe?= <oyvind.harboe@zylin.com>
---
MODULE.bazel | 19 -------------------
1 file changed, 19 deletions(-)

diff --git a/MODULE.bazel b/MODULE.bazel
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -8,13 +8,6 @@

bazel_dep(name = "bazel-orfs")

-# To bump version, run: bazelisk run @bazel-orfs//:bump
-git_override(
- module_name = "bazel-orfs",
- commit = "f8a4b694b37c8f5322323eba9a9ae37f9541ee17",
- remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
-)
-
bazel_dep(name = "rules_python", version = "1.8.5")
bazel_dep(name = "rules_shell", version = "0.6.1")

@@ -36,15 +29,3 @@
use_repo(pip, "orfs-pip")

orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
-
-# To bump version, run: bazelisk run @bazel-orfs//:bump
-orfs.default(
- image = "docker.io/openroad/orfs:v3.0-3273-gedf3d6bf",
- # Use local files instead of docker image
- makefile = "//flow:makefile",
- makefile_yosys = "//flow:makefile_yosys",
- pdk = "//flow:asap7",
- sha256 = "f5692c6325ebcf27cc348e033355ec95c82c35ace1af7e72a0d352624ada143e",
-)
-use_repo(orfs, "com_github_nixos_patchelf_download")
-use_repo(orfs, "docker_orfs")
--
2.51.0

1 change: 1 addition & 0 deletions bazel/orfs-patches/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports_files(glob(["*.patch"]))
12 changes: 12 additions & 0 deletions bazel/orfs-patches/orfs-preserve-tool-exe-env.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/flow/scripts/variables.mk b/flow/scripts/variables.mk
--- a/flow/scripts/variables.mk
+++ b/flow/scripts/variables.mk
@@ -188,7 +188,7 @@ export RESULTS_V = $(notdir $(sort $(wildcard $(RESULTS_DIR)/*.v)))
export GDS_MERGED_FILE = $(RESULTS_DIR)/6_1_merged.$(STREAM_SYSTEM_EXT)

define get_variables
-$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% KLAYOUT% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ )))
+$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% KLAYOUT% OPENROAD% OPENSTA% YOSYS% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ )))
endef

export UNSET_VARIABLES_NAMES := $(call get_variables,command% line environment% default automatic)
Loading
Loading