Skip to content

[Feature Request] Add an option to error out when not incremental #7348

@yuehuang010

Description

@yuehuang010

Feature Request

Add an option to MSBuild.exe:

  1. [Discussion] Add an option to MSBuild to enable this mode. It can either warn or error. In the case to warn, only issue one warning per (? project or node). ie. msbuild.exe -i:error
  2. Error out once a <Target> with Inputs and Output detects files are out of date.
  3. Error out in ToolTask when SkipTaskExecution returns false.
  4. Error out in WriteLinesToFile task when WriteOnlyWhenDifferent is true and write is engaged.
  5. Error out in Copy task when SkipUnchangedFiles is true and copy operation is engaged.
  6. ... other task ... ? Other task could be added later.
  7. Expose this property that is accessible from 3rd task.

Reason

The two use case that comes to mind is testing and investigation. At the moment, its very hard to test if the build is incremental. At status quo, the incremental build is just a shorter build. Its hard prove that the shorter build is truly incremental. A test can parse the log but that is not consistent and requires a custom tests for each target/task.
When there is an incremental issue, investigation is slow because parsing the log is hard as Task and Targets print different messages and its difficult to determine which was the first item that broke incremental. Adding a universal message can help but it might not suit all use cases. Another benefit of an error is the shorter rerun time.

I scoped the feature down to minimal and non-breaking. Other solution exists and open for discussion.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions