-
Notifications
You must be signed in to change notification settings - Fork 877
Update Bazel to v8 on earlgrey_1.0.0
#27433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98abba6
to
b7f8d65
Compare
b7f8d65
to
3fc587d
Compare
same here, can you rebase on |
83066a7
to
08d6bd4
Compare
cfrantz
approved these changes
Jul 14, 2025
These are now handled by the `bazel sync` further above. They are different under bzlmod, so we remove them here. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 52877a2)
This commit adds a `MODULE.bazel` file and enables the bzlmod feature, but actually continues to use the existing `WORKSPACE` dependency management by moving to `WORKSPACE.bzlmod`. Dependencies can be gradually migrated from `WORKSPACE` to `MODULE.bazel`. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 21d4988)
Required for some dependencies (such as Python and Git dependencies) which are not downloaded by `bazel fetch` when using Bzlmod. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
08d6bd4
to
afa2519
Compare
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit dfaf5ba)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit f89ff56)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 8f9da38)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit ccf5884)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 0b75593)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit bf632c9)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 06341f4)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 87121de)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit fe148bb)
`BUILD` files should now be using `defs.bzl` for these, so we don't need to export them from other files too. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit ea4702e)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit c04dbf5)
Deduplicates the implementation. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit a329756)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 0e24bd6)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 5ea5f04)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit afbee40)
No longer used. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 316cb43)
All features are now moved to the `rules/opentitan` directory. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 90c1f02)
Previously we were accessing the lowRISC toolchain indirectly via CRT, but this isn't possible with Bzlmod. We need to pull the repo in directly. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit bdc9c37)
Bazel is moving towards deprecating the `tool_path` style of CC toolchain which allowed executables to be taken using the `*_executable` parameters. The new method is `cc_common.get_tool_for_action` which works with both the old and new toolchain style. This commit changes all usages except for `objdump` which has no associated action. A future commit will create a custom objdump action for our toolchain and change this usage then. The OTBN toolchain actually needs exact tools. Instead of pulling these from the `cc_toolchain` it makes more sense to access the binaries directly from our toolchain repo. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 12c7abd)
Matches the arguments used in `//third_party/coremark/top_earlgrey`. Allows the feature-per-warning method from CRT to be replaced with one set of warnings which is easier to manage. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 9466eb5)
This uses the new rules-based toolchain feature of `rules_cc` to define the lowRISC toolchain with the same flags that the CRT toolchain had. There are two differences: 1. The CRT toolchain does not have the `guards` feature enabled by default, we enable it in `.bazelrc`. This new one is enabled automatically. 2. The CRT toolchain has `-Wpedantic` enabled by default, but we disable it in `.bazelrc`. This new one has it disabled by default. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit af8209d)
This removes the dependency on CRT and registers the new rules-based toolchain instead. Since `guards` is now enabled by default and `pedantic` is now disabled by default, we can remove those configurations from `.bazelrc`. The configuration to disable `guards` is still present. Without CRT, we also don't need to manually load the following repos into the airgapped environment: * `@python3_toolchains` * `@ninja_1.11.0_linux` * `@cmake-3.23.2-linux-x86_64` We also now need to switch how we access objdump in our disassembly rule to use the actions-based method. See previous commits. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit af824b6)
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit c145262)
These rules still use `workspace` as their parameters but they accept any file marking the root of the repository. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 17f7877)
For whatever reason they've changed `sync` to `fetch` with Bzlmod and `sync` fully crashes Bazel when hybrid mode is disabled rather than giving an error. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit c323ef3)
This command has been deprecated when using Bzlmod. It only works with `WORKSPACE` and hybrid mode. For some reason Bazel completely crashes with a JVM exception when you try to use it rather than printing a nice warning. This commit prints a warning that `sync` is deprecated and swaps the command for `fetch` which has almost identical arguments. This is a temporary measure to prevent breaking contributors who have git post-checkout hooks installed which run `bazel sync --configure`. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 654a23f)
No longer needed now that all external dependencies are managed by Bzlmod and downloaded using `bazel vendor`. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
With this change the repository fully supports Bzlmod and is no longer in hybrid mode. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 4d99670)
Prevents this from being re-enabled by accident. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 7c906d6)
Future versions of Bazel will enable the `--incompatible_disallow_empty_glob` flag by default. Globs which return zero results must have the `allow_empty = True` parameter. The file export in `hw/top_earlgrey/data` for `autogen/` was invalid: `autogen` is now a package itself and the parent cannot export files from it. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 677c57d)
For some reason the method of finding Python using `current_toolchain` stopped working with Bazel 8. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
The `rules_python` version is corrected to `0.40` which Bazel pulls in. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (cherry picked from commit 1b69573)
afa2519
to
f8345e8
Compare
Rebased and run the change blocker script manually again:
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on (and includes commits from) #27425. Only the last commit is new.
This PR bumps the Bazel version from 7.3.1 to 8.0.1, matching
master
.