-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Convert --toolchain_resolution_debug to take a regex of toolchain typ… #13207
Conversation
…es to debug Work towards bazelbuild#12110. Fixes bazelbuild#7713.
* types. | ||
*/ | ||
public boolean debugToolchainResolution(Collection<Label> toolchainTypes) { | ||
if (toolchainTypes.isEmpty()) { |
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.
If this is empty, is there any actual information to debug? i..e what gets printed when this returns true and the input is empty?
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.
Even targets with no toolchains will have an execution platform selected (and this is used in some tests).
Ideally we could instead do --toolchain_resolution_debug=//some/configured:target
, but that would require ConfiguredTargetFunction to make the check and pass a debug flag, thus complicating the ToolchainContextKey even more.
public boolean debugToolchainResolution(Collection<Label> toolchainTypes) { | ||
if (toolchainTypes.isEmpty()) { | ||
// Check an empty string, in case the filter is .* | ||
return this.toolchainResolutionDebugRegexFilter.test(""); |
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.
Does plain old --toolchain_resolution_debug
still work? (as an alias for .*
)?
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.
No, the argument is required (and if it is skipped an error will be printed). I couldn't figure out a way to distinguish between no flag being passed, and a base --toolchain_resolution_debug
with no argument in order to keep the current behavior unchanged.
…es to debug
Work towards #12110.
Fixes #7713.
RELNOTES: The flag
--toolchain_resolution_debug
now takes a regex argument, which is used to check which toolchain types should have debug info printed. You may use.*
as an argument to keep the current behavior of debugging every toolchain type.