Commit Graph

124 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
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
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
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
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
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
136a286d1b fix: buildifier lint and regenerate MODULE.bazel.lock
Add missing buildifier disable comment for fix_lint sh_binary and
regenerate lockfile after dev_dependency and rules_chisel patch changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-23 23:25:13 +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
2c3bba93b1 update MODULE.bazel.lock
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
2026-03-21 01:59:49 +00: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
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
8d12ad6983 bazel-orfs: bump
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-17 19:09:55 +01:00
Henner Zeller
5fa0e4d0c2 Up to the latest of the bazel 8.x line
Current is 8.6.0

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-03-16 12:00:57 -07:00
Matt Liberty
97b7ad21d1 fix MODULE.bazel.lock
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
2026-03-13 14:29:00 +00: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
Øyvind Harboe
ae23a06731 ci: check MODULE.bazel.lock is up to date
Prevents stale MODULE.bazel.lock from being used, as in #9692.

Co-Authored-By: Henner Zeller <h.zeller@acm.org>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-10 11:49:50 +01:00
Ø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
Ø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
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
Øyvind Harboe
e822ddafd8 bazel-orfs: bump
pick up rules_python fix

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-03 06:54:52 +01:00
Henner Zeller
b02bdbf6e3 Use swig from BCR, allowing to remove last dep on WORKSPACE
Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-03-02 19:08:42 +01:00
Øyvind Harboe
ea00f3291e bazel-orfs: bump
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-03-01 10:19:06 +01:00
Matt Liberty
d6b90eb5a1 Revert "Merge pull request #9537 from The-OpenROAD-Project-staging/9490-revert"
This reverts commit d7b40432ab, reversing
changes made to 186c695e9b.
2026-02-25 21:33:34 +00:00
Matt Liberty
1a60d75625 Revert "Merge pull request #9490 from fredowski/bazel-tcl"
This reverts commit c0199c49bf, reversing
changes made to f6fd0d645f.
2026-02-24 21:18:10 +00:00
Matt Liberty
c0199c49bf Merge pull request #9490 from fredowski/bazel-tcl
bazel/tcl: Replace the rules_hdl tcl version with the bcr tcl version
2026-02-23 04:53:45 +00:00
Friedrich Beckmann
5aea98243b bazel/tcl: migrate tcl library from rules_hdl to bazel repository
Use the tcl library from bazel central repository (BCR)
instead of the version from rules_hdl. The bcr version
is compatible with MacOS and is managed via
MODULE.bazel instead of WORKSPACE.

Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
2026-02-22 22:20:21 +01:00
Øyvind Harboe
9cd5263e90 bazel-orfs: bump
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-02-22 19:21:19 +01:00
Henner Zeller
d2f667b83c Use lemon from BCR
It has been added in:
https://github.com/bazelbuild/bazel-central-registry/pull/7609

... one less `WORKSPACE` dependency to worry about.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-02-19 02:12:57 -08:00
Matt Liberty
9979948dde Merge pull request #9474 from hzeller/feature-20260212-use-abc-from-bcr
Some checks failed
Automatically sync branch from upstream. / Automatic sync 'master' from The-OpenROAD-Project/OpenROAD (push) Has been cancelled
Lint Python / Black (push) Has been cancelled
Lint Bazel / Buildifier format (push) Has been cancelled
Lint Bazel / Buildifier lint (push) Has been cancelled
Check That ODB Files Are Generated / Are-Odb-Files-Generated (push) Has been cancelled
Format Code with pre commit trigger / Clang-Format (push) Has been cancelled
Lint Tcl code / Tclint (push) Has been cancelled
Scan Code with pre commit trigger / Security-Scan (push) Has been cancelled
Run Repo stats / repostats-for-nice-project (push) Has been cancelled
Use abc from BCR instead of third-party/
2026-02-16 17:09:59 +00:00
Henner Zeller
a357a2f4b4 Use abc from BCR instead of third-party/
BCR version is a fairly recent implementation from the
actively maintained Yosys branch. It comes with its
own BUILD file that we don't have to maintain here.

Putting third-party/abc into bazelignore so that we don't
process that part anymore.

With that, we now can also get rid of the very outdated
`readline` and `ncurses` dependencies in `WORKSPACE`,
as they now all come (much newer) from BCR.
(both of them I updated recently upstream in BCR)

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-02-16 01:44:54 -08:00
Henner Zeller
50fbd9ab4e Update version of qt prebuilt to latest.
The qt library was using xcb headers, but they were not
declared in the dependencies
(fixed in
https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts/pull/6 )

Also, update harfbuzz and glib dependencies that I've fixed
upstream and work better with with Nix (glib) and don't have
missing symbols (harfbuzz).

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-02-16 01:27:16 -08:00
Henner Zeller
ad4805ec0c IWYU fixes: include some missing dpl and drt headers.
Breakdown

```
src/dpl/src/graphics/Graphics.h:         #include "dpl/Opendp.h" for dpl::GridX
src/dpl/src/infrastructure/architecture.cxx: #include "dpl/Opendp.h" for dpl::GridX
src/dpl/src/infrastructure/Grid.cpp:     #include "infrastructure/Coordinates.h" for dpl::GridRect
src/dpl/src/infrastructure/network.cxx:  #include "infrastructure/architecture.h" for dpl::Architecture
src/dpl/src/objective/detailed_abu.cxx:  #include "objective/detailed_objective.h" for dpl::DetailedObjective
src/dpl/src/objective/detailed_abu.cxx:  #include "util/journal.h" for dpl::Journal
src/dpl/src/objective/detailed_abu.h:    #include "infrastructure/architecture.h" for dpl::Architecture
src/dpl/src/objective/detailed_abu.h:    #include "infrastructure/network.h" for dpl::Network
src/dpl/src/objective/detailed_abu.h:    #include "infrastructure/Objects.h" for dpl::Node
src/dpl/src/objective/detailed_abu.h:    #include "optimization/detailed_manager.h" for dpl::DetailedMgr
src/dpl/src/objective/detailed_displacement.cxx: #include "objective/detailed_objective.h" for dpl::DetailedObjective
src/dpl/src/objective/detailed_displacement.h: #include "dpl/Opendp.h" for dpl::DbuY
src/dpl/src/objective/detailed_displacement.h: #include "infrastructure/architecture.h" for dpl::Architecture
src/dpl/src/objective/detailed_hpwl.cxx: #include "infrastructure/Objects.h" for dpl::Edge
src/dpl/src/objective/detailed_hpwl.cxx: #include "objective/detailed_objective.h" for dpl::DetailedObjective
src/dpl/src/objective/detailed_hpwl.cxx: #include "util/journal.h" for dpl::Journal
src/dpl/src/objective/detailed_hpwl.h:   #include "infrastructure/network.h" for dpl::Network
src/dpl/src/optimization/detailed_global.cxx: #include "optimization/detailed_generator.h" for dpl::DetailedGenerator
src/dpl/src/optimization/detailed_global.cxx: #include "util/utility.h" for dpl::Utility
src/dpl/src/optimization/detailed_mis.cxx: #include "util/utility.h" for dpl::Utility
src/dpl/src/optimization/detailed_orient.cxx: #include "infrastructure/Objects.h" for dpl::Pin
src/dpl/src/optimization/detailed_reorder.cxx: #include "infrastructure/Objects.h" for dpl::Pin
src/dpl/src/optimization/detailed_vertical.cxx: #include "infrastructure/Objects.h" for dpl::Pin
src/dpl/src/optimization/detailed_vertical.cxx: #include "optimization/detailed_generator.h" for dpl::DetailedGenerator
src/drt/src/db/infra/frTime.cpp:         #include "frBaseTypes.h" for drt::DRT
src/drt/src/distributed/drUpdate.cpp:    #include "frBaseTypes.h" for drt::frcMarker
src/drt/src/global.cpp:                  #include "frBaseTypes.h" for drt::drcPatchWire
src/drt/src/pa/FlexPA.cpp:               #include "frBaseTypes.h" for drt::DRT
src/drt/src/ta/FlexTA.cpp:               #include "frBaseTypes.h" for drt::DRT
src/drt/src/ta/FlexTA_end.cpp:           #include "frBaseTypes.h" for drt::tacPathSeg
```

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-02-07 04:18:51 -08:00
Matt Liberty
0f99689f45 Merge pull request #9122 from hzeller/feature-20251222-add-compdb
Provide a way to create a compilation DB in the bazel project
2026-01-21 04:01:50 +00:00
Øyvind Harboe
d0d1e35e07 bazel-orfs: bump
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-01-20 15:57:09 +01:00
Matt Liberty
58dbe80258 Update to boost 1.89.0.bcr.2 and or-tools 9.14.bcr.1
This gets the "compatibility_level = 0" fix discussed in bazelbuild#6511.

This should enable us to sync up the cmake versions in another PR.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
2026-01-15 11:08:52 +00:00
Øyvind Harboe
bc5ec1b593 orfs: bump on the books
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2026-01-12 15:51:41 +01:00
Arthur Koucher
e9330531d5 bazel-orfs: bump
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
2026-01-08 18:58:52 -03:00