-
-
Notifications
You must be signed in to change notification settings - Fork 509
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 cfg = _test_arg_transition
in configurations/cc_test/defs.bzl
#367
Conversation
Hi @rwgk . Thanks for your contribution. I agree the existing test is sparse. And adding more examples of using the idea makes the point more clear. So I like what you're doing. The main impact of transitioning directly on the Who produces |
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 think overall this s a nice improvement, and makes the example more complete as you describe.
There are all kinds of subtle implications in transitions that users should be aware of. But this example doesn't have to explore the full space, and a more complete example is better than a less complete one. So I'm strongly inclined to support your improvements without worrying too much.
I'd also update the README.md
to walk through what's going on more cleanly. As written I think it's overly vague.
Done (28024ad). I'm simply showing the bazel command and expected output. Please let me know if you had something else in mind. |
Looks great, thank you. My final nit is I think the md formatting got messed up on the new README? https://github.com/bazelbuild/examples/blob/28024ade6658c129bed244481b119960b0bcff87/configurations/cc_test/README.md |
Thanks for catching this! Fixed: |
Question for the bazel experts: Does configurations/cc_test work as intended without the added
cfg = _test_arg_transition
in defs.bzl?This PR changes mytest.cc to send
argv
to stdout.Without the added
cfg = _test_arg_transition
in defs.bzl,new arg
does not appear in the output. See below.The other changes are optional, they just make this example more complete. Not being very familiar with the bazel mechanisms, it took me a while to figure out the two tricks to 1. ensure that
args
are handled correctly, and 2. the non-transitioned test is not run.WITHOUT the added
cfg = _test_arg_transition
in defs.bzlWITH the added
cfg = _test_arg_transition
in defs.bzl (i.e. this PR as is)