Skip to content

Correctly process single-threaded compilations #1

@MetanoKid

Description

@MetanoKid

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

This is the expected result:
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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions