Skip to content

Conversation

@dsplaisted
Copy link
Member

Fixes #408

The issue was that if the ProjectName.deps.json file was up to date, then the GenerateDepsFile target would be skipped and the deps.json file would not be included in the FileWrites item group, causing it to get deleted by IncrementalClean. This change adds a separate target which always runs which adds the deps.json file to the FileWrites group even if GenerateDepsFile isn't run.

@dsplaisted
Copy link
Member Author

@nguerrera @srivatsn for review

@AndyGerlicher @rainersigwald, Does this look like the right way to correctly handle IncrementalClean?

BeforeTargets="_CheckForCompileOutputs"
Condition=" '$(GenerateDependencyFile)' == 'true'">
<ItemGroup>
<FileWrites Include="$(ProjectDepsFilePath)" Condition="Exists('$(ProjectDepsFilePath)')"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't put this in a separate target, add it to GenerateBuildDependencyFile.

MSBuild will manipulate items that it can statically understand even when it skips a target for being up to date. It wasn't doing that before because it can't predict what the task would have output.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rainersigwald Thanks for clarifying, I've updated the PR accordingly.

@dsplaisted dsplaisted force-pushed the deps-json-incremental-408 branch from 2bdf2c9 to c2b8803 Compare November 29, 2016 06:29
@srivatsn
Copy link
Contributor

@dsplaisted can you fill out the escrow template and tag Matt.

@nguerrera
Copy link
Contributor

I feel like I've seen this output-to-file-writes pattern all over the place (or was it really just here or just impactful here?). Do we need to scrub?

@dsplaisted
Copy link
Member Author

@nguerrera

I feel like I've seen this output-to-file-writes pattern all over the place (or was it really just here or just impactful here?). Do we need to scrub?

I originally added to the FileWrites item to fix #305, where cleaning a project would leave some files in the output folder. Along with that, I added a The_clean_target_removes_all_files_from_the_output_folder test, which I think should catch anything that is missing from FileWrites.

@dsplaisted
Copy link
Member Author

@MattGertz for approval

Scenario

Incremental build (building twice in a row) shouldn't delete files from output directory.

Bug

#408

Workarounds

Rebuild instead of build. The unit testing team is saying this blocks their scenarios too.

Risk

Low - Tests should cover any impacted scenarios

Performance Impact

Low - the change is only writing 3 additional lines to a file that is already written during build, and deleting 3 files during clean

Regression Analysis

This was a regression introduced in #381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants