Skip to content

Commit e8ea5ba

Browse files
Merge branch 'master' into feature/bazel-options-dependency-installer
Signed-off-by: Alok Kumar Dalei <alokkumardalei2@gmail.com>
2 parents fce2187 + d43d716 commit e8ea5ba

299 files changed

Lines changed: 13294 additions & 1621 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/buildifier.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Cache buildifier
3131
id: cache-buildifier
32-
uses: actions/cache@v4
32+
uses: actions/cache@v5
3333
with:
3434
path: ./buildifier
3535
key: ${{ runner.os }}-buildifier-${{ env.BUILDIFIER_VERSION }}

‎.github/workflows/github-actions-macos-bazel.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
xcode-version: latest-stable
1818

1919
- name: Check out repository code
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
2121
with:
2222
submodules: 'recursive'
2323

2424
# 1. RESTORE: All jobs (PRs, manual runs, master) get to read the cache
2525
- name: Restore Bazel Disk Cache
26-
uses: actions/cache/restore@v4
26+
uses: actions/cache/restore@v5
2727
with:
2828
path: ~/.cache/bazel-disk-cache
2929
key: ${{ runner.os }}-bazel-${{ github.sha }}
@@ -43,7 +43,7 @@ jobs:
4343
# 2. SAVE: Only executes if this is a push/merge directly to the master branch
4444
- name: Save Bazel Disk Cache
4545
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
46-
uses: actions/cache/save@v4
46+
uses: actions/cache/save@v5
4747
with:
4848
path: ~/.cache/bazel-disk-cache
4949
key: ${{ runner.os }}-bazel-${{ github.sha }}

‎.github/workflows/github-actions-quarterly-tag.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
contents: write
1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
2222

2323
- name: Determine tag name
2424
id: tag

‎.github/workflows/github-actions-update-grammar-railroad-diagrams.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
java-version: "21"
2727

2828
- name: Cache railroad diagram tools
29-
uses: actions/cache@v4
29+
uses: actions/cache@v5
3030
id: cache-tools
3131
with:
3232
path: src/odb/doc/tools

‎BUILD.bazel‎

Lines changed: 71 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,16 @@ OPENROAD_LIBRARY_DEPS = [
138138
},
139139
)
140140

141+
# Flags applied to top-level OpenROAD targets only. Flags that apply
142+
# globally to every cc_* target (-Wall, -Wextra, -Wno-sign-compare,
143+
# -Wno-unused-parameter, etc.) live in .bazelrc — do not repeat them here.
141144
OPENROAD_COPTS = [
142145
"-Wno-error",
143-
"-Wall",
144-
"-Wextra",
145146
"-pedantic",
146147
"-Wno-cast-qual", # typically from TCL swigging
147148
"-Wno-missing-braces", # typically from TCL swigging
148149
"-Wredundant-decls",
149150
"-Wformat-security",
150-
"-Wno-sign-compare",
151-
"-Wno-unused-parameter",
152151
"-Wmismatched-tags",
153152
"-fopenmp",
154153
]
@@ -307,16 +306,14 @@ tcl_wrap_cc(
307306
],
308307
)
309308

310-
# This target compiles the SWIG C++ wrapper into a shared library (.so)
311-
# that Python can load dynamically.
312309
cc_binary(
313310
name = "_openroadpy.so",
314311
srcs = [":openroad_swig-py"],
315312
defines = [PYTHON_STABLE_API_DEFINE],
316313
linkopts = PYTHON_EXTENSION_LINKOPTS,
317314
linkshared = True,
318315
deps = [
319-
":openroad_lib", # Depends on the core odb C++ library
316+
":openroad_lib",
320317
":ord",
321318
"//src/ant",
322319
"//src/cgt",
@@ -344,14 +341,10 @@ cc_binary(
344341
],
345342
)
346343

347-
# This packages the SWIG-generated Python wrapper (odb.py) and the
348-
# compiled C++ extension (_odb.so) together.
349344
py_library(
350345
name = "openroad_py",
351-
srcs = [":openroad_swig-py"], # Use the .py output from the swig-py rule
352-
# The data attribute makes the .so file available at runtime.
346+
srcs = [":openroad_swig-py"],
353347
data = [":_openroadpy.so"],
354-
# This allows imports relative to the workspace root.
355348
imports = ["."],
356349
visibility = ["//visibility:public"],
357350
deps = [
@@ -431,6 +424,25 @@ filegroup(
431424
visibility = ["//:__subpackages__"],
432425
)
433426

427+
# ---------------------------------------------------------------------------
428+
# Packaging aliases
429+
#
430+
# The implementation lives in //packaging/ to isolate @rules_pkg loads from
431+
# downstream consumers, but the user-facing targets stay at the top level.
432+
# ---------------------------------------------------------------------------
433+
434+
alias(
435+
name = "install",
436+
actual = "//packaging:install",
437+
visibility = ["//visibility:public"],
438+
)
439+
440+
alias(
441+
name = "tarfile",
442+
actual = "//packaging:tarfile",
443+
visibility = ["//visibility:public"],
444+
)
445+
434446
# Lightweight test suites that run without building OpenROAD.
435447
# Usage:
436448
# bazelisk test --test_tag_filters=doc_check //src/... # all documentation checks
@@ -492,12 +504,52 @@ sh_binary(
492504
],
493505
)
494506

507+
# --- Bazel linting (buildifier -lint=warn) --------------------------------
508+
509+
# buildifier: disable=native-sh-test
510+
sh_test(
511+
name = "lint_bzl_test",
512+
srcs = ["//bazel:bzl_lint_test.sh"],
513+
args = ["$(rootpath @buildifier_prebuilt//:buildifier)"],
514+
data = [
515+
"@buildifier_prebuilt//:buildifier",
516+
],
517+
tags = ["local"],
518+
)
519+
520+
# --- Bazel formatting check (buildifier -mode=check -lint=off) ------------
521+
522+
# buildifier: disable=native-sh-test
523+
sh_test(
524+
name = "fmt_bzl_test",
525+
srcs = ["//bazel:bzl_fmt_test.sh"],
526+
args = ["$(rootpath @buildifier_prebuilt//:buildifier)"],
527+
data = [
528+
"@buildifier_prebuilt//:buildifier",
529+
],
530+
tags = ["local"],
531+
)
532+
533+
# --- Bazel auto-format only (buildifier -mode=fix) ------------------------
534+
535+
# buildifier: disable=native-sh-binary
536+
sh_binary(
537+
name = "tidy_bzl",
538+
srcs = ["//bazel:bzl_tidy.sh"],
539+
args = ["$(rootpath @buildifier_prebuilt//:buildifier)"],
540+
data = [
541+
"@buildifier_prebuilt//:buildifier",
542+
],
543+
)
544+
495545
# --- Umbrella targets ------------------------------------------------------
496546

497547
test_suite(
498548
name = "lint_test",
499549
tests = [
550+
":fmt_bzl_test",
500551
":fmt_tcl_test",
552+
":lint_bzl_test",
501553
":lint_tcl_test",
502554
],
503555
)
@@ -513,12 +565,19 @@ sh_binary(
513565
"$(rootpath //bazel:tclfmt)",
514566
"$(rootpath //bazel:tcl_lint_test.sh)",
515567
"$(rootpath //bazel:tclint)",
568+
"$(rootpath //bazel:bzl_tidy.sh)",
569+
"$(rootpath @buildifier_prebuilt//:buildifier)",
570+
"$(rootpath //bazel:bzl_lint_test.sh)",
571+
"$(rootpath @buildifier_prebuilt//:buildifier)",
516572
],
517573
data = [
518574
"tclint.toml",
575+
"//bazel:bzl_lint_test.sh",
576+
"//bazel:bzl_tidy.sh",
519577
"//bazel:tcl_lint_test.sh",
520578
"//bazel:tcl_tidy.sh",
521579
"//bazel:tclfmt",
522580
"//bazel:tclint",
581+
"@buildifier_prebuilt//:buildifier",
523582
],
524583
)

‎MODULE.bazel‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ bazel_dep(name = "toolchains_llvm", version = "1.5.0", dev_dependency = True)
9494
# --- Dev dependencies (not propagated to downstream consumers) ---
9595

9696
bazel_dep(name = "bant", version = "0.2.4", dev_dependency = True)
97+
bazel_dep(name = "buildifier_prebuilt", version = "8.5.1.2", dev_dependency = True)
9798
bazel_dep(name = "googletest", version = "1.17.0.bcr.2", dev_dependency = True)
9899
bazel_dep(name = "rules_verilator", version = "0.1.0", dev_dependency = True)
99100
bazel_dep(name = "verilator", version = "5.036.bcr.3", dev_dependency = True)

‎MODULE.bazel.lock‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bazel/BUILD‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ package(features = ["layering_check"])
1212

1313
exports_files(
1414
[
15+
"bzl_fmt_test.sh",
16+
"bzl_lint_test.sh",
17+
"bzl_tidy.sh",
1518
"fix_lint.sh",
1619
"install.sh",
17-
"tcl_lint_test.sh",
1820
"tcl_fmt_test.sh",
21+
"tcl_lint_test.sh",
1922
"tcl_tidy.sh",
2023
],
2124
visibility = ["//visibility:public"],

‎bazel/build_helper.bzl‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎bazel/bzl_fmt_test.sh‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
# Copyright (c) 2025-2026, The OpenROAD Authors
4+
#
5+
# Check that all Bazel files are properly formatted (no lint warnings).
6+
set -euo pipefail
7+
TOOL="$(readlink -f "$1")"
8+
WORKSPACE="$(dirname "$(readlink -f MODULE.bazel)")"
9+
cd "$WORKSPACE"
10+
# `git ls-files` skips submodule contents (src/sta, third-party/abc).
11+
# Explicit -mode=check -lint=off separates format errors from lint warnings,
12+
# and overrides the repo-root .buildifier.json default (mode: fix).
13+
git ls-files '*.bazel' '*.bzl' '**/BUILD' 'BUILD' '**/WORKSPACE' 'WORKSPACE' -z \
14+
| xargs -0 "$TOOL" -mode=check -lint=off

0 commit comments

Comments
 (0)