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

Declare dependencies in vendored crates #2246

Merged
merged 4 commits into from
Dec 4, 2023
Merged

Conversation

matts1
Copy link
Contributor

@matts1 matts1 commented Nov 9, 2023

Currently, when you run bazel build --enable_bzlmod //crate_universe:bin, you get the error undefined repo @cui.

When you add a dependency on CUI, you get errors like undefined repo @cui__<crate>-<version> (the repo for the third party crate).

This change will allow us to automatically declare dependencies on our third party crates from bzlmod (see https://docs.google.com/document/d/1dj8SN5L6nwhNOufNqjBhYkk5f-BJI_FPYWKxlB3GAmA/edit#heading=h.5mcn15i0e1ch).

@matts1 matts1 force-pushed the declare branch 4 times, most recently from 064306c to 41030ae Compare November 9, 2023 03:06
@matts1 matts1 marked this pull request as ready for review November 9, 2023 04:36
@UebelAndre
Copy link
Collaborator

Do you wanna update the examples in a separate PR as well to reduce the noise?

@matts1
Copy link
Contributor Author

matts1 commented Nov 10, 2023

@UebelAndre I can do so if you prefer, but I'm personally fine with it as is.

Also, do you mean just the examples/sys/complex, which I missed in #2245, or all the examples?

@UebelAndre
Copy link
Collaborator

UebelAndre commented Nov 10, 2023

Just the missed examples.

it would be good to keep this PR limited to only the changes made here. So yeah, anything that needs to be regenerated and includes additional stuff should be a separate change

@matts1
Copy link
Contributor Author

matts1 commented Nov 10, 2023

Ok, I just rebased, diffs look much cleaner now

Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

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

Thanks! I had one more question 😄

@UebelAndre
Copy link
Collaborator

@matts1 I think this is good to go pending a rebase

Change-Id: Ic43373e989807503b4b68c96d9918bffcefa2880
@matts1
Copy link
Contributor Author

matts1 commented Dec 4, 2023

@UebelAndre Fixed the merge conflicts by rebasing and rerunning vendor.

Change-Id: I0047f977b0481a470e95d05d491ad6b52718b279
@UebelAndre UebelAndre merged commit 3fd4987 into bazelbuild:main Dec 4, 2023
2 checks passed
@matts1 matts1 deleted the declare branch December 5, 2023 02:03
illicitonion pushed a commit that referenced this pull request Dec 12, 2023
See #2246 for how we declare dependencies automatically for third party
crates. I'm using the same mechanism for all other repositories.

Note that the MODULE.bazel changes in use_repo are autogenerated, and if
you change the third party crates you depend on, you should get an error
message saying something like "run this command to fix it" on your
bzlmod presubmit environment.
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.

3 participants