Skip to content
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

[experiment] Migrate to bzlmod #24216

Closed
wants to merge 56 commits into from
Closed

[experiment] Migrate to bzlmod #24216

wants to merge 56 commits into from

Conversation

jwnrt
Copy link
Contributor

@jwnrt jwnrt commented Aug 5, 2024

Expecting tonnes of failures here but wanted to see what breaks in CI while it's quiet. I know of a few breakages already around airgapped builds, the bitstream cache, and the C toolchain.

This will be broken into a few PRs later, but it includes:

  • Updating Bazel to 7.1.1.
  • Updating most dependencies.
  • Changing how airgapped builds work (due to changes in 7.1.1).
  • Changing how Rust dependencies work (due to changes in rules_rust).
  • Changing how Python dependencies work (due to changes in rules_python).
  • Migrating WORKSPACE to MODULE.bazel.

The lowrisc toolchain and closed-source manufacturing hooks are not yet migrated.

Problems found so far by this PR:

@jwnrt jwnrt force-pushed the bzlmod branch 5 times, most recently from 2e61bc2 to 936f9e5 Compare August 9, 2024 08:57
@jwnrt jwnrt force-pushed the bzlmod branch 2 times, most recently from 55bb362 to 2caa217 Compare August 20, 2024 09:30
@jwnrt jwnrt mentioned this pull request Aug 20, 2024
17 tasks
jwnrt added 20 commits August 21, 2024 11:40
Previously we were on a very old commit (not a release) from 2020.

Signed-off-by: James Wainwright <[email protected]>
We use this in OpenTitan so we should explicitly depend on it.

Signed-off-by: James Wainwright <[email protected]>
There is a complicated dependency cycle here if we don't separate them.

Signed-off-by: James Wainwright <[email protected]>
These dependencies are mostly important toolchain rules:

* `rules_python`
* `rules_cc`
* `rules_foreign_cc`

We need to load these right at the start of `WORKSPACE` to avoid our
other dependencies (e.g. CRT) from installing different versions first.
Bazel will stick with the first version installed even if we explicitly
ask for another later.

Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Our patch has been upstreamed here:
bazelbuild/buildtools@762712d

Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
We were previously taking these from the Bazel repository at the version
we were using. This has broken, but Bazel has a documented way of doing
this now independent of version:

https://bazel.build/run/build#repository_cache_with_bazel_7_or_later

Signed-off-by: James Wainwright <[email protected]>
Drops the `system_includes` feature of `bindgen_toolchain`. Need to
check for breakages.

Signed-off-by: James Wainwright <[email protected]>
This change has been upstreamed, just waiting for it to merge.

Signed-off-by: James Wainwright <[email protected]>
`rules_rust` has changed the layout of the Bazel files it outputs when
repinning dependencies.

The actual dependencies have not changed.

Signed-off-by: James Wainwright <[email protected]>
jwnrt added 26 commits August 21, 2024 16:50
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
Signed-off-by: James Wainwright <[email protected]>
@jwnrt
Copy link
Contributor Author

jwnrt commented Jan 8, 2025

Everything experimented on here has been merged!

@jwnrt jwnrt closed this Jan 8, 2025
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