MetanoKid / MetanoKid/msbuild-flame-graph
Correctly process single-threaded compilations
- 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 is the expected result:

# 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