-
Notifications
You must be signed in to change notification settings - Fork 441
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
Advertise CcInfo provider on rules #2126
Conversation
The aspect used in the `cc_shared_library` implementation in bazel 6.3 and 7 only traverses attributes that advertise the `CcInfo` provider via the `provides` attribute. This means in these versions of bazel, rust libraries are currently omitted from libraries built with `cc_shared_library`.
18fe608
to
e9139bf
Compare
It seems that the |
Looks like the issue with wasm not emitting CcInfo is fixed by #1979 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think this looks fine but I had one question.
|
||
# Tests that cc_shared_library correctly traverses into | ||
# `rust_static_library` when linking. | ||
cc_shared_library( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this lead to the same issue as #2359 if experimental_cc_shared_library
is not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean if people are querying it as an external repository, where the root workspace does not have this set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it will, although in 7.0.0 this is enabled by default so it shouldn't be an issue with the latest version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@illicitonion given that the issue was referring to a cquery within the rules_rust
repo, do you think this is an acceptable change? I do like the procides
changes and love the test. I just don't wanna immediately regress something here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sent out #2398 which add tests for what I think we should be aiming to support (i.e. bazel query ...
and bazel cquery ...
from inside the rules_rust
repo) - if we have more things we want to support (e.g. bazel query @rules_rust//...
from a repo that depends on rules_rust
) , we should add tests to CI for them.
This PR passes the tests I sent out, so I'm happy :)
Sounds good. Just needs a rebase! |
The aspect used in the
cc_shared_library
implementation in bazel 6.3 and 7 only traverses attributes that advertise theCcInfo
provider via theprovides
attribute. This means in these versions of bazel, rust libraries are currently omitted from libraries built withcc_shared_library
.Fixes #2101.