Skip to content

Commit

Permalink
Make CopyOutOfDateMarker an item (expanded later)
Browse files Browse the repository at this point in the history
PR dotnet#2180 caused a performance-test scenario internal to Microsoft to
start failing. The root cause was that the projects in the test
customized $(IntermediateOutputPath) _very_ late, after importing
CSharp.targets (and transitively Common.targets). That meant that the
path stored in $(CopyOutOfDateMarker) was no longer under
$(IntermediateOutputPath), and that the directory wasn't created before
the new code attempted to touch the marker file.

Ideally, projects would set IntermediateOutputPath _before_ importing
common.targets, but that hasn't been strictly required in all cases
before so requiring it now is an unacceptable regression.

The late customization was handled for other intermediate outputs by
defining their paths with items (expanded after all properties are
expanded) rather than properties (expanded in order).

There are other properties defined by using $(IntermediateOutputPath),
$(_GenerateBindingRedirectsIntermediateAppConfig) and
$(WinMDExpOutputPdb). This PR doesn't change those since they weren't
recently regressed.
  • Loading branch information
rainersigwald committed Jun 12, 2017
1 parent 0174f99 commit c61a7a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Tasks/Microsoft.Common.CurrentVersion.targets
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,11 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<PropertyGroup>
<IntermediateOutputPath Condition="!HasTrailingSlash('$(IntermediateOutputPath)')">$(IntermediateOutputPath)\</IntermediateOutputPath>
<_GenerateBindingRedirectsIntermediateAppConfig>$(IntermediateOutputPath)$(MSBuildProjectFile).$(TargetFileName).config</_GenerateBindingRedirectsIntermediateAppConfig>
<CopyUpToDateMarker>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '$(IntermediateOutputPath)', '$(MSBuildProjectFile).CopyComplete'))</CopyUpToDateMarker>
</PropertyGroup>
<ItemGroup>
<IntermediateAssembly Include="$(IntermediateOutputPath)$(TargetName)$(TargetExt)"/>
<FinalDocFile Include="@(DocFileItem->'$(OutDir)%(Filename)%(Extension)')"/>
<CopyUpToDateMarker Include="$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '$(IntermediateOutputPath)', '$(MSBuildProjectFile).CopyComplete'))" />
</ItemGroup>

<ItemGroup Condition="'$(ProduceReferenceAssembly)' == 'true'">
Expand Down Expand Up @@ -1835,7 +1835,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<TargetPlatformMoniker>$(TargetPlatformMoniker)</TargetPlatformMoniker>
<TargetPlatformIdentifier>$(TargetPlatformIdentifier)</TargetPlatformIdentifier>
<ReferenceAssembly Condition="'$(ProduceReferenceAssembly)' == 'true'">$(TargetRefPath)</ReferenceAssembly>
<CopyUpToDateMarker>$(CopyUpToDateMarker)</CopyUpToDateMarker>
<CopyUpToDateMarker>@(CopyUpToDateMarker)</CopyUpToDateMarker>
</TargetPathWithTargetPlatformMoniker>
</ItemGroup>
</Target>
Expand Down Expand Up @@ -4237,7 +4237,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
references on this build, subsequent builds of projects that depend on it must
not be considered up to date, so touch this marker file that is considered an
input to projects that reference this one. -->
<Touch Files="$(CopyUpToDateMarker)"
<Touch Files="@(CopyUpToDateMarker)"
AlwaysCreate="true"
Condition="'@(ReferencesCopiedInThisBuild)' != ''" />

Expand Down

0 comments on commit c61a7a2

Please sign in to comment.