Skip to content

Comments

Clean up and update Bazel build files#1223

Merged
johnbartholomew merged 3 commits intogoogle:masterfrom
johnbartholomew:bazelfixes
Mar 22, 2025
Merged

Clean up and update Bazel build files#1223
johnbartholomew merged 3 commits intogoogle:masterfrom
johnbartholomew:bazelfixes

Conversation

@johnbartholomew
Copy link
Collaborator

Significant changes here:

  • The WORKSPACE file is removed. Bazel disables WORKSPACE by default anyway in Bazel 8, and bzlmod has been available to use for several versions before that.

  • Update rules_python module. Remove the custom Python toolchain infrastructure which is only used to find a Python C header to include, instead use @rules_python//python/cc:current_py_cc_headers.

  • Make build targets private by default. Explicitly make public just the ones that are actually public interface (the jsonnet and jsonnetfmt command line tools, the C, C++ and Python libraries).

  • Don't expose the internal Jsonnet headers publicly. Private headers in a cc_library should not be in hdrs they should be listed in src.

  • Update googletest.

@johnbartholomew johnbartholomew force-pushed the bazelfixes branch 3 times, most recently from 3f710a0 to 5b48ef0 Compare March 16, 2025 13:31
Significant changes here:
- The WORKSPACE file is removed. Bazel disables WORKSPACE by default
  anyway in Bazel 8, and bzlmod has been available to use for several
  versions before that.

- Update rules_python module. Remove the custom Python toolchain
  infrastructure which is only used to find a Python C header to
  include, instead use @rules_python//python/cc:current_py_cc_headers.

- Make build targets private by default. Explicitly make public just
  the ones that are actually public interface (the jsonnet and
  jsonnetfmt command line tools, the C, C++ and Python libraries).

- Keep internal headers private.
This is mostly so that I can set it up to be used in the module registry presubmit,
but it does also act as an example.
@johnbartholomew johnbartholomew merged commit dc52f56 into google:master Mar 22, 2025
9 checks passed
@johnbartholomew johnbartholomew deleted the bazelfixes branch March 22, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant