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

[Built-in analyzer] MSBuild task with BuildInParallel is batched #9889

Open
Tracked by #10548 ...
ladipro opened this issue Mar 18, 2024 · 6 comments
Open
Tracked by #10548 ...

[Built-in analyzer] MSBuild task with BuildInParallel is batched #9889

ladipro opened this issue Mar 18, 2024 · 6 comments
Labels
Area: BuildCheck BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck' performance triaged

Comments

@ladipro
Copy link
Member

ladipro commented Mar 18, 2024

Background

This issue tracks one of the BuildCheck analyzers we would like to ship in-box with MSBuild.

Goal

Implement an analyzer with the following rule: The MSBuild task is not executed batched when the BuildInParallel parameter is true.

Notes

The intention of BuildInParallel = true is to run child builds in parallel. Batching the task, on the other hand, makes it run in a loop, one invocation at a time, which is likely not desired.

@rainersigwald
Copy link
Member

Note that this will have to allow some batching, for instance the way RPR does it today (it batches in such a way that each batch could have multiple items in it). The ideal catch would be "the computed batches are one per item" or something. That is, batching on %(Foo.Identity) is bad but other metadata may be ok.

@sharwell
Copy link
Member

I think the first step here is understanding cases in the wild where this would be a "true positive". There are more heuristics involved than I would normally like to see for a deterministic analyzer, so if the number of actual cases where it matters are uncommon, perhaps it would be best to defer this rule?

@yuehuang010
Copy link
Contributor

I would ask a generalize feature. Add feature for task author indicate and error when the Task is batched into two more instances. In C++ case, Link task should have one call. But sometimes, due to bad target authoring with metadata, it is divided and it is hard to detect.

This could also apply to CSC too.

@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented Mar 23, 2024

In C++ case, Link task should have one call.

Don't you need a Link call for each language when building MUI resource DLLs?

@yuehuang010
Copy link
Contributor

C++ Resource tooling would have a separate project for resource dll, then use MSBuild project batching to call each one with a different property for language.

@baronfel baronfel added the BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck' label Jul 10, 2024
@baronfel
Copy link
Member

baronfel commented Sep 9, 2024

related: we should flag when a single item + batching is used (i.e. in this per-TFM-walking Target). The suggestion here should be to move to precomputing the item lists and parallelizing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BuildCheck BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck' performance triaged
Projects
None yet
Development

No branches or pull requests

7 participants