-
Notifications
You must be signed in to change notification settings - Fork 4k
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
No way to run tests in bzlmod dependency if they depend on dev_dependency #22187
Comments
This is WAI; downstream users aren't expected to be able to run your tests. We don't want to let |
I see. Running the tests in BCR is not as critical, but being able to run our tests with the downstream toolchain is quite important for triaging issues. Without this, we'll probably need to establish a policy of not accepting bug reports from bzlmod-based projects until they can reproduce it standalone. |
I suppose the other option is to make Note I am not specifically requesting that |
In principle, googletest is only needed for tests and could be a dev_dependency. But it would then be impossible for downstream modules to run BoringSSL's tests. The downstream module provides the toolchain, so we may need to request they run tests when triaging issues. If bazelbuild/bazel#22187 is ever fixed, we can change this. With this change, the following works: cd util/bazel-example bazelisk test @boringssl//:crypto_test Change-Id: Ied2276047de134883d6b61b0789f3c7bfcaad669 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/68127 Commit-Queue: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com> Auto-Submit: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com>
This seems like a reasonable enough FR. Or maybe a flag |
Description of the bug:
Based on bazelbuild/bazel-central-registry#1833 (comment), I gather best practice for bzlmod is to mark your tests' dependencies as a dev_dependency. We've thus tentatively set googletest as a dev_dependency in BoringSSL.
Now, suppose someone consuming BoringSSL wants to run the tests anyway. For example, they may have some issue and we might ask them to run the tests and confirm it's not a toolchain problem. This then fails because the dependency is missing:
The same error occurs if I explicitly pull in
googletest
from the downstream module. As far as I can tell, there is no way to go back and tellboringssl
that I do indeed have agoogletest
for you.Which category does this issue belong to?
External Dependency
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?release 7.1.1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: