Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3566179
build: restrict openroad_lib and ord_py visibility
oharboe Mar 19, 2026
8b9469b
build: rename ord_py to openroad_py
oharboe Mar 19, 2026
c75d756
build: move install and tarfile to packaging/
oharboe Mar 19, 2026
6e686d2
build: mark rules_shell, rules_pkg, rules_verilator, verilator as dev…
oharboe Mar 19, 2026
81fb24c
build: fix visibility labels for bzlmod compatibility
oharboe Mar 19, 2026
168f383
build: make toolchains_llvm extension and registration dev_dependency
oharboe Mar 19, 2026
619a182
test: add downstream visibility and dev_dependency test
oharboe Mar 19, 2026
9347333
docs: document using OpenROAD as a dependency from another project
oharboe Mar 19, 2026
fd8e622
build: regenerate MODULE.bazel.lock
oharboe Mar 19, 2026
7e13b33
build: run buildifier on modified Bazel files
oharboe Mar 19, 2026
8602ede
Merge remote-tracking branch 'origin/master' into HEAD
oharboe Mar 20, 2026
d74cc57
Mark chisel use_extension as dev_dependency
oharboe Mar 20, 2026
594a62f
Use native sh_test/sh_binary instead of rules_shell in root BUILD
oharboe Mar 20, 2026
1c8778b
Fix downstream visibility test for Bazel test environment
oharboe Mar 20, 2026
4320403
Merge remote-tracking branch 'origin/master' into HEAD
oharboe Mar 20, 2026
bfbb640
fix: downstream visibility test, buildifier warnings, and lockfile
oharboe Mar 20, 2026
3bddd0c
bazel: lint
oharboe Mar 20, 2026
0818868
Merge remote-tracking branch 'origin/master' into HEAD
oharboe Mar 23, 2026
136a286
fix: buildifier lint and regenerate MODULE.bazel.lock
oharboe Mar 23, 2026
3ca2237
fix: make aspect_rules_js and rules_nodejs non-dev dependencies
oharboe Mar 23, 2026
465f2e9
test: split downstream visibility test into individual sh_tests
oharboe Mar 23, 2026
458efdb
test: replace slow downstream workspace tests with instant py_tests
oharboe Mar 23, 2026
b764cc5
bazel: lint
oharboe Mar 24, 2026
47cb9b0
Merge remote-tracking branch 'origin/master' into HEAD
oharboe Mar 24, 2026
4f6028a
fix: buildifier lint for dup_id_test from master merge
oharboe Mar 24, 2026
8b75614
bazel: group dev deps, combine register_toolchains, docs split requir…
oharboe Mar 24, 2026
930d673
Merge remote-tracking branch 'origin/master' into HEAD
oharboe Mar 24, 2026
2688ec8
style: fix buildifier formatting in MODULE.bazel
oharboe Mar 24, 2026
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
2 changes: 2 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ src/sta/debug/
# we use abc from MODULE.bazel
third-party/abc/
tmp
# standalone workspace for downstream consumer tests
test/downstream/
36 changes: 12 additions & 24 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_python//python:defs.bzl", "py_library")
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
load("@rules_shell//shell:sh_test.bzl", "sh_test")
load("//bazel:notification.bzl", "notification_rule")
load("//bazel:python_wrap_cc.bzl", "PYTHON_EXTENSION_LINKOPTS", "PYTHON_STABLE_API_DEFINE", "python_wrap_cc")
load("//bazel:tcl_encode_or.bzl", "tcl_encode")
Expand Down Expand Up @@ -39,7 +36,9 @@ config_setting(
)

exports_files([
"BUILD.bazel",
"LICENSE",
"MODULE.bazel",
"src/Design.i",
"src/Exception.i",
"src/options.i",
Expand Down Expand Up @@ -218,7 +217,7 @@ cc_library(
includes = [
"include",
],
visibility = ["//visibility:public"],
visibility = ["//:__subpackages__"],
deps = [
"//src/sta:opensta_lib",
"@abseil-cpp//absl/base:core_headers",
Expand Down Expand Up @@ -336,7 +335,7 @@ cc_binary(
# This packages the SWIG-generated Python wrapper (odb.py) and the
# compiled C++ extension (_odb.so) together.
py_library(
name = "ord_py",
name = "openroad_py",
srcs = [":openroad_swig-py"], # Use the .py output from the swig-py rule
# The data attribute makes the .so file available at runtime.
data = [":_openroadpy.so"],
Expand Down Expand Up @@ -392,15 +391,15 @@ filegroup(
srcs = [
"src/Exception.i",
],
visibility = ["@//:__subpackages__"],
visibility = ["//:__subpackages__"],
)

filegroup(
name = "error_swig-py",
srcs = [
"src/Exception-py.i",
],
visibility = ["@//:__subpackages__"],
visibility = ["//:__subpackages__"],
)

filegroup(
Expand All @@ -415,30 +414,15 @@ filegroup(
srcs = [
"src/options.i",
],
visibility = ["@//:__subpackages__"],
)

sh_binary(
name = "install",
srcs = ["//bazel:install.sh"],
args = [],
data = [":tarfile"],
)

pkg_tar(
name = "tarfile",
srcs = [
":openroad",
],
include_runfiles = True,
package_file_name = "openroad.tar",
visibility = ["//:__subpackages__"],
)

# Lightweight test suites that run without building OpenROAD.
# Usage:
# bazelisk test --test_tag_filters=doc_check //src/... # all documentation checks
# bazelisk test //:dup_id_test # duplicate message ID check

# buildifier: disable=native-sh-test
sh_test(
name = "dup_id_test",
srcs = ["//etc:find_dup_ids.sh"],
Expand All @@ -455,6 +439,7 @@ sh_test(

# --- TCL linting (tclint) -------------------------------------------------

# buildifier: disable=native-sh-test
sh_test(
name = "lint_tcl_test",
srcs = ["//bazel:tcl_lint_test.sh"],
Expand All @@ -468,6 +453,7 @@ sh_test(

# --- TCL formatting check (tclfmt --check) --------------------------------

# buildifier: disable=native-sh-test
sh_test(
name = "fmt_tcl_test",
srcs = ["//bazel:tcl_fmt_test.sh"],
Expand All @@ -481,6 +467,7 @@ sh_test(

# --- TCL auto-format only (tclfmt --in-place) -----------------------------

# buildifier: disable=native-sh-binary
sh_binary(
name = "tidy_tcl",
srcs = ["//bazel:tcl_tidy.sh"],
Expand All @@ -503,6 +490,7 @@ test_suite(

# Linting is done here (not just formatting) because not all lint violations
# are auto-fixable — fix_lint fixes what it can, then reports the rest.
# buildifier: disable=native-sh-binary
sh_binary(
name = "fix_lint",
srcs = ["//bazel:fix_lint.sh"],
Expand Down
108 changes: 64 additions & 44 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module(
name = "openroad",
)

# --- Regular dependencies (propagated to downstream consumers via MVS) ---

bazel_dep(name = "abc", version = "0.62-yosyshq")
bazel_dep(name = "abseil-cpp", version = "20260107.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
Expand All @@ -14,17 +16,7 @@ bazel_dep(name = "rules_bison", version = "0.3.1")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "rules_flex", version = "0.3.1")
bazel_dep(name = "rules_python", version = "1.8.5")
bazel_dep(name = "rules_pkg", version = "1.2.0")

# Used by chisel_binary from @bazel-orfs in test/orfs/mock-array
bazel_dep(name = "rules_jvm_external", version = "6.4", dev_dependency = True)
bazel_dep(name = "rules_chisel", version = "0.2.0", dev_dependency = True)
bazel_dep(name = "rules_scala", version = "7.1.5", dev_dependency = True)

bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "rules_verilator", version = "0.1.0")
bazel_dep(name = "swig", version = "4.3.0.bcr.2")
bazel_dep(name = "verilator", version = "5.036.bcr.3")

BOOST_VERSION = "1.89.0.bcr.2"

Expand Down Expand Up @@ -75,13 +67,9 @@ bazel_dep(name = "yaml-cpp", version = "0.9.0")
bazel_dep(name = "tcl_lang", version = "8.6.16.bcr.1")
bazel_dep(name = "readline", version = "8.2.bcr.3")

# Make compilation DB (and possibly build cleaner)
bazel_dep(name = "bant", version = "0.2.4", dev_dependency = True)
bazel_dep(name = "googletest", version = "1.17.0.bcr.2", dev_dependency = True)

# JavaScript unit tests
bazel_dep(name = "aspect_rules_js", version = "3.0.2", dev_dependency = True)
bazel_dep(name = "rules_nodejs", version = "6.7.3", dev_dependency = True)
# JavaScript / web UI (src/web uses @npm for bundled assets)
bazel_dep(name = "aspect_rules_js", version = "3.0.2")
bazel_dep(name = "rules_nodejs", version = "6.7.3")

# A from source build of QT that allows it to link into OpenROAD.
# Building like any other bazel project. scripts in the docker folder
Expand All @@ -95,11 +83,61 @@ git_override(
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
)

## Lock the compiler version and avoid any local compiler
## Lock the compiler version and avoid any local compiler.
## The bazel_dep stays non-dev because llvm_prebuilt's build_file
## references @toolchains_llvm//toolchain:BUILD.llvm_repo.
## The extension and toolchain registration are dev_dependency because
## toolchains_llvm enforces root-module-only extension usage.
## Downstream consumers must configure their own C++ toolchain.
bazel_dep(name = "toolchains_llvm", version = "1.5.0")

# Configure and register the toolchain.
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
# --- Dev dependencies (not propagated to downstream consumers) ---

bazel_dep(name = "bant", version = "0.2.4", dev_dependency = True)
bazel_dep(name = "googletest", version = "1.17.0.bcr.2", dev_dependency = True)
bazel_dep(name = "rules_pkg", version = "1.2.0", dev_dependency = True)
bazel_dep(name = "rules_shell", version = "0.6.1", dev_dependency = True)
bazel_dep(name = "rules_verilator", version = "0.1.0", dev_dependency = True)
bazel_dep(name = "verilator", version = "5.036.bcr.3", dev_dependency = True)

# Used by chisel_binary from @bazel-orfs in test/orfs/mock-array
bazel_dep(name = "rules_jvm_external", version = "6.4", dev_dependency = True)
bazel_dep(name = "rules_chisel", version = "0.2.0", dev_dependency = True)
single_version_override(
module_name = "rules_chisel",
patch_strip = 1,
patches = ["//:rules-chisel-dev-dep.patch"],
)

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_ORFS_COMMIT = "272cc079f25521d19fe25f80e176e29adb40d920"

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

# To bump version, run: bazelisk run @bazel-orfs//:bump
git_override(
module_name = "bazel-orfs",
commit = BAZEL_ORFS_COMMIT,
remote = BAZEL_ORFS_REMOTE,
)

git_override(
module_name = "bazel-orfs-verilog",
commit = BAZEL_ORFS_COMMIT,
remote = BAZEL_ORFS_REMOTE,
strip_prefix = "verilog",
)

# --- Extensions ---

llvm = use_extension(
"@toolchains_llvm//toolchain/extensions:llvm.bzl",
"llvm",
dev_dependency = True,
)
llvm.toolchain(
llvm_version = "20.1.8",
)
Expand All @@ -110,6 +148,7 @@ use_repo(llvm, "llvm_toolchain")
register_toolchains(
"@llvm_toolchain//:all",
"@rules_verilator//verilator:verilator_toolchain",
dev_dependency = True,
)

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
Expand All @@ -130,14 +169,12 @@ use_repo(pip, "openroad-pip")
node = use_extension(
"@rules_nodejs//nodejs:extensions.bzl",
"node",
dev_dependency = True,
)
node.toolchain(node_version = "22.14.0")

npm = use_extension(
"@aspect_rules_js//npm:extensions.bzl",
"npm",
dev_dependency = True,
isolate = True,
)
npm.npm_translate_lock(
Expand All @@ -146,27 +183,6 @@ npm.npm_translate_lock(
)
use_repo(npm, "npm")

bazel_dep(name = "bazel-orfs", dev_dependency = True)
bazel_dep(name = "bazel-orfs-verilog", dev_dependency = True)

BAZEL_ORFS_COMMIT = "272cc079f25521d19fe25f80e176e29adb40d920"

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

# To bump version, run: bazelisk run @bazel-orfs//:bump
git_override(
module_name = "bazel-orfs",
commit = BAZEL_ORFS_COMMIT,
remote = BAZEL_ORFS_REMOTE,
)

git_override(
module_name = "bazel-orfs-verilog",
commit = BAZEL_ORFS_COMMIT,
remote = BAZEL_ORFS_REMOTE,
strip_prefix = "verilog",
)

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

# To bump version, run: bazelisk run @bazel-orfs//:bump
Expand Down Expand Up @@ -206,7 +222,7 @@ scala_deps.settings(
)
scala_deps.scala()

chisel = use_extension("@rules_chisel//chisel:extensions.bzl", "chisel")
chisel = use_extension("@rules_chisel//chisel:extensions.bzl", "chisel", dev_dependency = True)
chisel.toolchain(
chisel_version = CHISEL_VERSION,
firtool_resolver_version = FIRTOOL_RESOLVER_VERSION,
Expand All @@ -229,6 +245,8 @@ maven.install(
)
use_repo(maven, "maven")

# --- External archives ---

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
Expand Down Expand Up @@ -261,6 +279,8 @@ http_archive(
],
)

# --- Overrides ---

single_version_override(
module_name = "boost.context",
patch_strip = 1,
Expand Down
12 changes: 6 additions & 6 deletions MODULE.bazel.lock

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

Loading
Loading