Commit Graph

176 Commits

Author SHA1 Message Date
Matt Liberty
d43d716d9b Merge pull request #9811 from alokkumardalei-wq/feature/bazelisk-run-tidy
Bazel: Add unified hermetic:tidy target for workspace formatting
2026-04-15 15:23:46 +00:00
alokkumardalei-wq
8d652ae302 bazel: add buildifier lint/fmt/tidy targets for .bazel files
Implements #9858 (#8495). Adds three new targets mirroring the TCL
lint pattern:

  //:lint_bzl_test  - buildifier -mode=check -lint=warn  (lint check)
  //:fmt_bzl_test   - buildifier -mode=check -lint=off   (format check)
  //:tidy_bzl       - buildifier -mode=fix -lint=fix     (auto-fix)

Wires lint_bzl_test and fmt_bzl_test into //:lint_test, and
bzl_tidy.sh + bzl_lint_test.sh into //:fix_lint. Adds
buildifier_prebuilt 6.4.0 as a dev_dependency in MODULE.bazel.

Uses git ls-files for file discovery, which automatically skips
submodule paths (src/sta, third-party/abc). Explicit -mode=check
flags override the repo-root .buildifier.json default (mode: fix),
ensuring test targets remain read-only.

Updates docs/contrib/LintTargets.md: moves buildifier from "Planned
additions" to "Available targets".

Signed-off-by: alokkumardalei-wq <alokkumardalei2@gmail.com>
2026-04-14 11:30:47 +05:30
Øyvind Harboe
5afdec3838 bazel: make toolchains_llvm a dev_dependency
The bazel_dep was non-dev, forcing downstream Bazel consumers to
inherit OpenROAD's pinned LLVM toolchain. This conflicts when
consumers configure their own C++ toolchain.

The extension and toolchain registration were already dev_dependency.
Making the bazel_dep dev_dependency too keeps it consistent and
invisible to downstream modules. The llvm_prebuilt build_file
reference works because dev deps are still resolved for the
declaring module's own build.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-04-11 16:16:20 +02:00
Øyvind Harboe
28f4a3ae96 bazel: make npm/node a dev_dependency, invisible to downstream
The aspect_rules_js, rules_nodejs, and their use_extension calls
(node toolchain, npm translate_lock) exist solely for JavaScript
unit tests in src/web/test/. No production cc_library target
depends on npm packages — the JS files are served from disk by
the C++ web server.

Changes:
- Mark bazel_dep entries for aspect_rules_js and rules_nodejs as
  dev_dependency = True in MODULE.bazel
- Mark node and npm use_extension calls as dev_dependency = True
- Remove isolate = True from npm extension (unnecessary when
  dev_dependency, and it required --experimental_isolated_extension_usages
  in downstream consumers)
- Move package.json and pnpm-lock.yaml from src/web/ to src/web/test/
- Move npm_link_all_packages from src/web/BUILD to src/web/test/BUILD
- Replace js_library with a plain filegroup for cross-package JS
  file references (no @aspect_rules_js dependency in production BUILD)

Downstream Bazel consumers no longer inherit npm/node infrastructure,
eliminating the need for patches like openroad-remove-isolate.patch.

Tested:
- All 10 js_test targets in //src/web/test pass
- Downstream consumer builds without any npm-related patches

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-04-10 10:52:26 +02:00
Henner Zeller
5af56087d8 Bazel tcl initialization: use zipfs on Tcl9 and runfiles on Tcl8
* For Tcl9, all relevant system tcl files, the tcl library and
   readline library, are packed in a zip file, compiled into the
   binary mounted on the virtual filesystem //zipfs:/
 * On Tcl 8, which does not allow to do that quite yet, we
   take the same directory structure (unpacked), and use them
   via runfiles as before; however, since this is now a single
   directory the runfile symbolic links are reduced to one.

Default for now is to use the runfile method, as we're still on
Tcl8; The code is prepared for Tcl9, awaiting some changes in
STA to be merged, then we can change the default.

Fixes: #9962 #9980

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-04-03 14:07:48 +02:00
Øyvind Harboe
3cca0e92bf bazel-orfs: remove stale patchelf use_repo
The bazel-orfs extension no longer generates the
com_github_nixos_patchelf_download repository.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-04-01 00:21:40 +02:00
Øyvind Harboe
bdb8201ac6 bazel-orfs: bump
The bazelisk run @bazel-orfs//:bump script now supports the
google code pattern too.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-31 23:43:20 +02:00
Øyvind Harboe
4bdc4a7ea4 bazel-orfs: should be docker-less
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-31 20:26:30 +02:00
Øyvind Harboe
8320037fc3 bazel-orfs: bump
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-28 16:21:03 +01:00
Matt Liberty
f6a7165e9d Merge pull request #9977 from hzeller/feature-20260327-openmp-bcr
Use openmp from BCR
2026-03-27 23:11:48 +00:00
Matt Liberty
d8041c92a1 Merge pull request #9952 from hzeller/feature-20260325-rules-shell
sh_test and sh_binary are used in BUILD.bazel. Import.
2026-03-27 23:08:02 +00:00
Henner Zeller
c711c030f0 Use openmp from BCR
It has been added in
https://github.com/bazelbuild/bazel-central-registry/pull/8152

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-03-27 11:38:29 -07:00
Henner Zeller
d5e930f0c3 sh_test and sh_binary are used in BUILD.bazel. Import.
That means, that rules_shell is indeed not a dev_dependency
anymore, but a real one.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-03-25 22:17:18 +01:00
Henner Zeller
60657bf985 Update or-tools dependency.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-03-25 12:01:24 -07:00
Matt Liberty
50bb0081d8 Merge pull request #9827 from Pinata-Consulting/dev-dependency-cleanup-v2
build: dev_dependency cleanup, visibility, and downstream test
2026-03-25 11:33:58 +00:00
Øyvind Harboe
4097815291 bazel-orfs: bump
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-24 16:35:15 +01:00
Øyvind Harboe
2688ec8f3a style: fix buildifier formatting in MODULE.bazel
Remove extra blank line flagged by buildifier -mode=check.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-24 15:48:25 +01:00
Øyvind Harboe
8b75614c92 bazel: group dev deps, combine register_toolchains, docs split required vs suggested
Address PR #9827 review feedback:
- Group all dev_dependency bazel_dep entries into a separate section
  in MODULE.bazel for easier reasoning (hzeller)
- Combine two register_toolchains calls into one (gemini-code-assist)
- Split downstream MODULE.bazel docs into required and suggested
  sections, making toolchains_llvm optional (hzeller)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-24 11:44:34 +01:00
Øyvind Harboe
3ca22372a6 fix: make aspect_rules_js and rules_nodejs non-dev dependencies
src/web uses @npm for bundled assets, so aspect_rules_js, rules_nodejs,
and their extensions (node, npm) must be non-dev for downstream consumers.
Add .bazelrc to test/downstream for --experimental_isolated_extension_usages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-24 00:39:45 +01:00
Øyvind Harboe
0818868bfb Merge remote-tracking branch 'origin/master' into HEAD
# Conflicts:
#	MODULE.bazel.lock
2026-03-23 23:21:46 +01:00
Øyvind Harboe
c4669659b3 Deduplicate bazel-orfs commit and remote in MODULE.bazel
Extract the shared commit hash and remote URL into BAZEL_ORFS_COMMIT
and BAZEL_ORFS_REMOTE variables so the two git_override blocks stay
in sync automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-23 15:26:51 +01:00
Øyvind Harboe
bc1df04560 Bump bazel-orfs to 272cc07, add bazel-orfs-verilog dep
bazel-orfs moved generate.bzl and verilog.bzl into the
bazel-orfs-verilog submodule.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-23 15:13:55 +01:00
Matt Liberty
2710cc2db3 Merge remote-tracking branch 'origin/master' into web
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
2026-03-21 01:59:06 +00:00
Øyvind Harboe
3bddd0c189 bazel: lint
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-21 00:06:18 +01:00
Øyvind Harboe
bfbb640cf2 fix: downstream visibility test, buildifier warnings, and lockfile
- Add buildifier disable comments for native sh_test/sh_binary in root
  BUILD.bazel (rules_shell is a dev_dependency, cannot be loaded by
  downstream consumers)
- Patch rules_chisel to handle dev_dependency in extension_metadata,
  fixing "root_module_direct_deps must be empty" error
- Regenerate MODULE.bazel.lock

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-20 23:42:00 +01:00
Øyvind Harboe
d74cc57aa1 Mark chisel use_extension as dev_dependency
The rules_chisel bazel_dep is declared as dev_dependency (line 22),
but the corresponding use_extension was not. This caused downstream
consumers to fail with "no repo visible as '@rules_chisel'".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-20 17:46:05 +01:00
Øyvind Harboe
8602ede150 Merge remote-tracking branch 'origin/master' into HEAD
# Conflicts:
#	BUILD.bazel
2026-03-20 16:29:16 +01:00
Øyvind Harboe
215843a74f build: migrate chisel_binary to rules_chisel
The local bazel-orfs moved chisel support from
@bazel-orfs//toolchains/scala:chisel.bzl to the standalone
@rules_chisel//chisel:defs.bzl package. Add rules_chisel as a
dev dependency, configure the chisel extension toolchain, and
update the mock-array BUILD load path accordingly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-19 22:46:27 +01:00
Øyvind Harboe
7e13b33816 build: run buildifier on modified Bazel files
Signed-off-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-19 12:21:33 +01:00
Øyvind Harboe
168f383b40 build: make toolchains_llvm extension and registration dev_dependency
toolchains_llvm enforces root-module-only extension usage, causing
failures when OpenROAD is consumed as a dependency. The bazel_dep
stays non-dev (llvm_prebuilt's build_file references it), but the
use_extension and register_toolchains are now dev_dependency.

Downstream consumers must configure their own C++ toolchain.

Signed-off-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-19 12:12:34 +01:00
Øyvind Harboe
6e686d2de8 build: mark rules_shell, rules_pkg, rules_verilator, verilator as dev_dependency
These deps are only needed for packaging (rules_shell, rules_pkg) and
test/orfs simulation targets (rules_verilator, verilator). They are not
required by the //:openroad binary. Marking them dev_dependency prevents
MVS from forcing their versions on downstream consumers.

Also split register_toolchains so the verilator toolchain registration
is dev_dependency — it only needs to be active when building OpenROAD
directly, not when consuming it as a dependency.

Signed-off-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-19 12:12:34 +01:00
Øyvind Harboe
8d12ad6983 bazel-orfs: bump
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-17 19:09:55 +01:00
Matt Liberty
a506956074 Merge remote-tracking branch 'origin/master' into web
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
2026-03-13 04:59:14 +00:00
Matt Liberty
e61a2c531c Merge pull request #9700 from alokkumardalei-wq/fix-bazel-tclreadline
bazel: enable tclreadline in Bazel
2026-03-12 14:29:08 +00:00
alokkumardalei-wq
4ec0e179c7 chore: make tclreadline bazel build fully hermetic
Signed-off-by: alokkumardalei-wq <alokkumardalei2@gmail.com>
2026-03-12 09:44:46 +05:30
Øyvind Harboe
3955359440 bazel-orfs: bump
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-11 09:16:46 +01:00
alokkumardalei-wq
00c7610706 bazel: enable tclreadline for interactive openroad> prompt
Signed-off-by: alokkumardalei-wq <alokkumardalei2@gmail.com>
2026-03-10 05:20:00 +05:30
Øyvind Harboe
bd5319da04 bazel-orfs: bump
reduces accidental dependencies, such as on javascript.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-08 09:27:50 +01:00
Matt Liberty
03211f80ec web: js testing
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
2026-03-08 06:19:38 +00:00
Matt Liberty
0b9b8b391c Merge pull request #9656 from fredowski/install
bazel: use pkg_tar for the install procedure
2026-03-06 06:56:58 +00:00
Friedrich Beckmann
54a0fe8e24 bazel: use pkg_tar for the install procedure
I updated the install procedure to use the pkg_tar
module. The install works as before, but now you
can also install optionally to another location.

Closes: #9635

Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
2026-03-06 06:54:32 +01:00
Øyvind Harboe
243cb771bf Fix use_repo_rule with unsupported dev_dependency argument
use_repo_rule() does not accept dev_dependency as a keyword argument;
that parameter is only valid for use_extension(). Remove it and
consolidate the duplicate http_archive definition.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-05 06:48:26 +01:00
Øyvind Harboe
3bb3eb1486 Mark bazel-orfs, rules_scala, rules_jvm_external, circt as dev_dependency
These dependencies are only used for OpenROAD's own test infrastructure
(ORFS integration tests, Chisel mock-array, firtool binary) and are not
needed by downstream consumers of the openroad module.

Whittles away at #9629

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-04 21:39:13 +01:00
Matt Liberty
7f425d1af0 Merge pull request #9622 from fredowski/bazel-gui-aarch64
bazel: update qt_bazel_prebuilds for aarch64 gui support
2026-03-04 17:06:00 +00:00
Friedrich Beckmann
3c1bd12e65 bazel: update qt_bazel_prebuilds for aarch64 gui support
With merged PR

https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts/pull/8

qt_bazel supports linux aarch64. This commit updates to that
version such that OpenROAD can be build with gui on aarch64
linux systems. Tested in Debian 13 aarch64 vm on Macbook.

Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
2026-03-04 14:26:38 +01:00
Henner Zeller
f8752fa250 Use same rules_scala version bazel-orfs
That also allows us to not have a git override.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-03-04 01:26:20 -08:00
Henner Zeller
42d8447680 qt_bazel_prebuilts have now refreshed glpk+harfbuzz.
They have been updated in
https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts/pull/9

So we don't need these locally anymore.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-03-03 21:53:48 +01:00
Henner Zeller
aa04d9c27a A newer yaml-cpp does not need our local patch anymore.
While at it, update `rules_cc` as `yaml-cpp` was implicitly
bumping it.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-03-03 19:10:17 +01:00
Øyvind Harboe
ce87d3b3db bazel: remove unused scalatest dep, document rules_scala use
Remove scala_deps.scalatest() as it is not used in any BUILD file.
Add comment documenting that rules_scala is used by chisel_binary
from @bazel-orfs in test/orfs/mock-array.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-03 17:02:19 +01:00
Henner Zeller
dde683ab61 Use @rules_python directly, don't rename.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-03-03 09:31:26 +01:00