Skip to content

MSBUILDENABLEBUILDPLAN does not work because of invalid format. #11705

@JanThomas118

Description

@JanThomas118

Issue Description

After reading #11673 i found out about MSBUILDENABLEBUILDPLAN. A feature which is supposed to write a file with the build times of projects to be able to optimize the build order on the next run.

An example of a .buildplan file that is generated.

2 530.2654 /home/user/Projects/ConsoleApp17/ConsoleApp17/ConsoleApp17.csproj
3 130.588 /home/user/Projects/ConsoleApp17/ClassLibrary2/ClassLibrary2.csproj
4 188.4428 /home/user/Projects/ConsoleApp17/ClassLibrary1/ClassLibrary1.csproj

2 3 3 3
3
3 4 4 4
4
4
4
3

Building the project again leads to an error in the log that the buildplan is invalid.

Steps to Reproduce

  • Create any project
  • Set MSBUILDENABLEBUILDPLAN to 1
  • run dotnet msbuild AnyProject -bl:binlog.binlog twice
  • observe error at the end of the binlog that the buildplan is invalid

Expected Behavior

It works

Actual Behavior

It does not work

Analysis

The buildplan is read here
Here it reads the lines and splits based on semicolon. Problem: The file does not contain any semicolons.

After some digging around i think found the commit that introduced the bug:
In PR 4079 new char[] { ' ' } is replaced with MSBuildConstants.SemicolonChar while it should have been MSBuildConstants.SpaceChar

Versions & Configurations

Fedora Linux
dotnet msbuild 17.12.24.6604 (from fedora repos)

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIssues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim.triaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions