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

[bazel] Migrate rules_python and dependents to bzlmod #25650

Merged
merged 7 commits into from
Dec 17, 2024

Conversation

jwnrt
Copy link
Contributor

@jwnrt jwnrt commented Dec 13, 2024

This PR migrates rules_python and the modules that depend on it to bzlmod.

These depending modules use python interpreters in their actual rule implementations, so they have to be migrated at the same time. The first commits add bzlmod support for each module before they're all switched over in the second-to-last commit.

bazel_skylib must also be migrated as it's needed for the Tock repositories (via bare_repository).

There is also a fix for the INCLUDE paths of linker scripts inside the external directory which is unstable and has to have its paths generated by Bazel.

The modules migrated are:

  • bazel_skylib.
  • lowrisc_misc_linters (license checker).
  • rules_fuzzing.
  • rules_python.

third_party/tock/repos.bzl Outdated Show resolved Hide resolved
@jwnrt jwnrt force-pushed the rules-python-bzlmod branch 4 times, most recently from 293cec3 to 97a5734 Compare December 14, 2024 08:50
@jwnrt jwnrt marked this pull request as ready for review December 14, 2024 10:35
@jwnrt jwnrt requested a review from cfrantz as a code owner December 14, 2024 10:35
@jwnrt jwnrt requested review from pamaury and nbdd0121 December 14, 2024 10:36
@jwnrt jwnrt force-pushed the rules-python-bzlmod branch from 97a5734 to efbd579 Compare December 16, 2024 10:34
pamaury and others added 7 commits December 16, 2024 17:09
Signed-off-by: Amaury Pouly <[email protected]>
Co-authored-by: James Wainwright <[email protected]>
These `external` paths hardcoded into linker scripts are not stable and
in fact change when bzlmod is enabled.

This commit adds the `-Wl,-L` flag to the linker for each included file,
causing the linker to search the correct external directory for it.

Signed-off-by: James Wainwright <[email protected]>
@jwnrt jwnrt force-pushed the rules-python-bzlmod branch from efbd579 to 8ad4435 Compare December 16, 2024 17:09
@jwnrt jwnrt mentioned this pull request Dec 17, 2024
16 tasks
Copy link
Contributor

@pamaury pamaury left a comment

Choose a reason for hiding this comment

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

This looks great. One small nit but I'll leave it up to you: would it make sense to split [bazel] Fix external includes in linker scripts into two: the bazel change, and the use of this change to fix linker scripts?

@jwnrt
Copy link
Contributor Author

jwnrt commented Dec 17, 2024

Yeah they could be split. I think it's unlikely I'll need to revert just one so I'm fine with leaving it as one

@jwnrt jwnrt merged commit bd78983 into lowRISC:master Dec 17, 2024
38 checks passed
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.

2 participants