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

Add support for bzlmod #1493

Open
UebelAndre opened this issue Aug 1, 2022 · 13 comments · Fixed by #1528
Open

Add support for bzlmod #1493

UebelAndre opened this issue Aug 1, 2022 · 13 comments · Fixed by #1528

Comments

@UebelAndre
Copy link
Collaborator

It would be nice if rules_rust supported bzlmod workflows. Hopefully someone familiar with that can enable that for this project.

@cameron-martin
Copy link
Contributor

I don't know that much about bzlmod, but have started having a look at this. Initially I would like to simply replace rules_rust_dependencies. However, I'm having some issues. Details in #1528.

@UebelAndre UebelAndre changed the title Add support or bzlmod Add support for bzlmod Feb 11, 2023
scentini pushed a commit that referenced this issue Mar 29, 2023
This makes rules_rust load dependencies via bzlmod. Currently only basic functionality is completed, such as registering rustc toolchains and compiling crates. Note that it cannot interact with cargo, wasm or load any other rust toolchains such as rustfmt.
    
There is one new module, `examples/bzlmod/hello_world`, that depends on the root `rules_rust` module. This example can be built and run using:
    
```
cd examples/bzlmod/hello_world
bazel run //:hello_world
```

To register toolchains in an ergonomic way, it defines a new "hub" repository that contains all the toolchain proxies, so they can all be registered like so:

```
register_toolchains("@rust_toolchains//:all")
```

closes #1493
@hobofan
Copy link
Contributor

hobofan commented Mar 29, 2023

I think it makes sense to reopen this? While the work that has been merged is great, from what I can tell there is still quite a bit of work that needs to happen to "support bzlmod" on a level that it can actually be adopted.

@scentini scentini reopened this Mar 29, 2023
@chrislovecnm
Copy link

Do we have a list of items that are still needed?

@katre
Copy link
Member

katre commented Aug 1, 2023

Are loading crates via bzlmod supported in the current effort?

@opicaud
Copy link

opicaud commented Aug 21, 2023

Hey,
Please check #2021

@csmulhern
Copy link
Contributor

Bazel 7.0 is releasing later this year, with bzlmod becoming on by default. Is anyone working to prioritize this work to align with the release of Bazel 7.0? Looks like there has been some work done in #2021.

@UebelAndre
Copy link
Collaborator Author

It unfortunately seems no maintainer has any experience with bzlmod at all. I've asked other members of the Bazel org to help do reviews but I unfortunately haven't seen any support. The Bzlmod changes could probably be merged as long as there's no change to existing code. For anything that needs to change, the more granular the pull-reqeusts can be the easier the rollout will be. My primary concern is that bzlmod just increases the maintenance burden by introducing a second way to to fetch dependencies. So it'd also be helpful if the changes were setup to maintain a single source of truth.

@scentini
Copy link
Collaborator

I have scheduled some time with Bzlmod experts later this week to peer review this PR with the hope that we can move this PR forward and gain some expertise in the process.

@csmulhern
Copy link
Contributor

Makes sense. Thanks for the update.

I would hope long term, Bzlmod becomes the primarily supported way to fetch dependencies, though that's probably quite far in the future.

Shot in the dark, but I have tried to solicit help in this discussion thread: bazelbuild/bazel#18329.

@csmulhern
Copy link
Contributor

I have scheduled some time with Bzlmod experts later this week to peer review this PR with the hope that we can move this PR forward and gain some expertise in the process.

That sounds great, thanks @scentini. I am happy to dedicate some bandwidth in the coming month to help with contributions (though I also have no prior expertise).

@UebelAndre
Copy link
Collaborator Author

I have scheduled some time with Bzlmod experts later this week to peer review this PR with the hope that we can move this PR forward and gain some expertise in the process.

@scentini any updates from your meeting?

@chrislovecnm
Copy link

Hi all! Any updates? I have some bandwidth to help.

@chrislovecnm
Copy link

This needs some tlc https://bazelbuild.github.io/rules_rust/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants