Skip to content

bazel: expose fix_lint and lint_test targets with public visibility - #11057

Open
oharboe wants to merge 4 commits into
The-OpenROAD-Project:masterfrom
oharboe:expose-fix-lint
Open

bazel: expose fix_lint and lint_test targets with public visibility#11057
oharboe wants to merge 4 commits into
The-OpenROAD-Project:masterfrom
oharboe:expose-fix-lint

Conversation

@oharboe

@oharboe oharboe commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Exposes fix_lint and lint_test targets in BUILD.bazel with visibility = ["//visibility:public"].

Downstream Usage

This allows downstream Bazel workspaces (such as OpenROAD-flow-scripts) to run OpenROAD's version-pinned linter toolchain (tclint, tclfmt, buildifier) directly from their workspace root without requiring local patches or aliases:

# From OpenROAD-flow-scripts repo root:
bazelisk run //tools/OpenROAD:fix_lint

Because Bazel automatically sets BUILD_WORKSPACE_DIRECTORY to whichever workspace invoked bazel run, file discovery in fix_lint.sh automatically targets ORFS files when run in ORFS.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe requested a review from a team as a code owner August 4, 2026 05:23
@oharboe
oharboe requested a review from precisionmoon August 4, 2026 05:23

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the BUILD.bazel file to expose the test_suite and sh_binary targets with public visibility. The reviewer correctly pointed out that exposing the test_suite target without also exposing its constituent test targets will result in Bazel visibility errors for downstream consumers.

Comment thread BUILD.bazel
oharboe added 2 commits August 4, 2026 07:25
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe

oharboe commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Added visibility = ["//visibility:public"] to all constituent test targets (lint_tcl_test, fmt_tcl_test, tidy_tcl, lint_bzl_test, fmt_bzl_test, tidy_bzl) in BUILD.bazel so test_suite(name = "lint_test") resolves cleanly for downstream workspaces.

@maliberty

Copy link
Copy Markdown
Member

Why make the tests public?

@oharboe

oharboe commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Why make the tests public?

Then I can test if ORFS is formatted correctly.

@oharboe

oharboe commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

I don't want to duplicate the policies of OpenROAD w.r.t. coding of scripts and the infrastructure for linting and checking, I want OpenROAD to set them and ORFS to follow them.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants