MetanoKid / MetanoKid/msbuild-flame-graph

Correctly process single-threaded compilations

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
42
Forks
0
PR merge metrics
No merged PRs in 30d

Description

To tell single-threaded compilations from multi-threaded compilations (those that have `/MP` enabled) we're parsing messages until we find these texts:
* `Generating Code...`
* `Compiling...`

MSBuild seems to use the language of the *context* that executed the tool: either Visual Studio's or system language (when executed via `.exe`).

# Proposed solutions
* Ensure tool forces MSBuild to use some english encoding (i.e. `en-US`). If it's not installed in the system, we can't do anything. Check `Compilation.cs`, `Start` method: it should be using that encoding?
* Build a *database* of these messages per language and use it to detect which language it's using. Useful when other parsing happens (if any).
* Find another heuristic (i.e. if we see blocks of front-end followed by blocks of back-end in reverse order).

This is the wrong result:
![This one is wrong](https://user-images.githubusercontent.com/3693388/77932010-36a65300-72ad-11ea-9b77-e885efcae499.png "This one is wrong")

This is the expected result:
![This one is right](https://user-images.githubusercontent.com/3693388/77932515-ef6c9200-72ad-11ea-8c70-5e25527f46cb.png "This one is right")

# Reproduction steps
* Execute tool via `.exe` file in a system whose language isn't english.
* Load C++ solution.
* Tick `/Bt+` option and set `1` for the `Max parallel CL per project` option.
* When the build is finished, convert it into a trace with `File > Create timeline from events file...`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with Compilation.cs and its Start method, then reproduce the non-English .exe build using /Bt+ and one parallel compiler. Compare the parsed messages with the expected timeline and evaluate which proposed detection approach fits the existing processing; done means single-threaded and multi-threaded compilations are classified correctly in the reproduced trace.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.