Closed rwgk closed 7 months ago
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 transition_rule_test
as you're doing is the final output may no longer appear under bazel-bin
. That's arguably not important if we're just running a test. See for example https://github.com/bazelbuild/bazel/pull/18854.
Who produces new arg
in your example?
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.
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
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)