Skip to content
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

Minimize output of --toolchain_resolution_debug #7713

Closed
EricBurnett opened this issue Mar 13, 2019 · 2 comments
Closed

Minimize output of --toolchain_resolution_debug #7713

EricBurnett opened this issue Mar 13, 2019 · 2 comments
Assignees
Labels
help wanted Someone outside the Bazel team could own this P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions type: feature request

Comments

@EricBurnett
Copy link

Description of the problem / feature request:

--toolchain_resolution_debug contains useful information for understanding why a toolchain was selected, but it's also very verbose - in an example case involving the Go rules, 1600 lines of output mostly of the form "considering X; constraint doesn't match; rejected X", plus a large number of repeated lines when unspecified actions choose a toolchain ("Selected execution platform //:builder_platform, type @io_bazel_rules_go//go:toolchain -> toolchain @go_sdk//:go_linux_amd64-impl" 800 times)

Feature requests: what underlying problem are you trying to solve with this feature?

It'd be nice if this could be more compacted, and easier to scan. E.g. by collecting up the resolution details first, then producing a compact structured output second -

Toolchain resolution debug info:
    @io_bazel_rules_go//go:toolchain for @bazel_tools//platforms:target_platform
        Matched execution platforms and toolchains: {//:builder_platform -> @go_sdk//:go_linux_amd64-impl, @bazel_tools//platforms:host_platform -> @go_sdk//:go_linux_amd64-impl}
        Rejected toolchains @go_sdk//:go_android_386-impl, @go_sdk//:go_android_amd64-impl, and 20 others for not matching constraint @bazel_tools//platforms:os , value @bazel_tools//platforms:linux
    @io_bazel_rules_go//go:toolchain for @bazel_tools//platforms:host_platform
        Matched execution platforms and toolchains: {//:builder_platform -> @go_sdk//:go_linux_amd64-impl, @bazel_tools//platforms:host_platform -> @go_sdk//:go_linux_amd64-impl}
        Rejected toolchains @go_sdk//:go_android_386-impl, @go_sdk//:go_android_amd64-impl, and 20 others for not matching constraint @bazel_tools//platforms:os , value @bazel_tools//platforms:linux
    @bazel_tools//tools/cpp:toolchain_type for @bazel_tools//platforms:target_platform
    ...

For matching of toolchains against actions themselves, it seems it'd be better to either omit those lines, or to emit the target as well - 800 lines saying the go toolchain was selected but without context don't quite solve that well.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Add --toolchain_resolution_debug to any build including Go.

@EricBurnett EricBurnett changed the title Reduced output variant of --toolchain_resolution_debug Minimize output of --toolchain_resolution_debug Mar 13, 2019
@katre katre self-assigned this Mar 13, 2019
@katre katre added type: feature request P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions labels Mar 13, 2019
@cushon
Copy link
Contributor

cushon commented Mar 13, 2019

see also b/126375095

@katre
Copy link
Member

katre commented May 11, 2020

This is being left open because it's still an issue, but I don't have any good ideas for better ways to report this output.

If anyone does have ideas, I'd welcome comments or PRs.

@katre katre added the help wanted Someone outside the Bazel team could own this label May 11, 2020
bazel-io pushed a commit that referenced this issue Sep 30, 2020
When multiple toolchain types are resolved, skyframe functions run in parallel and the debug output is often hard to follow. Adding type of toolchain to each message makes it possible to analyse the results better.

Also after a execution transition, target changes. Added target label to the message, to be able to tell for which target toolchain was selected.

Removing initial messages "Looking for toolchain of type...", "Considering toolchain...". With additional fields displayed they become obsolete.

Condensing 'rejection explanation', i.e. which values are mismatched, into a single line.

#7713, b/126375095: there is still some duplications in ToolchainResolutionFunction:125, which I didn't remove because some tests depend on it (when specifying extra_toolchains)

b/117279695 is fixed with this

Closes #12196.

PiperOrigin-RevId: 334613787
Yannic pushed a commit to Yannic/bazel that referenced this issue Oct 5, 2020
When multiple toolchain types are resolved, skyframe functions run in parallel and the debug output is often hard to follow. Adding type of toolchain to each message makes it possible to analyse the results better.

Also after a execution transition, target changes. Added target label to the message, to be able to tell for which target toolchain was selected.

Removing initial messages "Looking for toolchain of type...", "Considering toolchain...". With additional fields displayed they become obsolete.

Condensing 'rejection explanation', i.e. which values are mismatched, into a single line.

bazelbuild#7713, b/126375095: there is still some duplications in ToolchainResolutionFunction:125, which I didn't remove because some tests depend on it (when specifying extra_toolchains)

b/117279695 is fixed with this

Closes bazelbuild#12196.

PiperOrigin-RevId: 334613787
katre added a commit to katre/bazel that referenced this issue Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Someone outside the Bazel team could own this P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants