Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Hendrix <jhendrix@microsoft.com>2015-06-24 19:31:04 +0300
committerJoel Hendrix <jhendrix@microsoft.com>2015-06-24 19:31:04 +0300
commitcfbc76db4ea86f5e38ff18b9bde067c3bcde97c6 (patch)
tree6520a80eec99a4d727affef91680f313efbb69ea /dir.targets
parentd72d94a28e448a18c11926cac8b77713277382ac (diff)
Tools restore could fail if the binaries/libraries used for tracking Inputs/Outputs were locked. Switch to a semaphore file and allow it to warn in the rare case it fails to touch it successfully.
Merged from CS#1485206. [tfs-changeset: 1493243]
Diffstat (limited to 'dir.targets')
-rw-r--r--dir.targets26
1 files changed, 17 insertions, 9 deletions
diff --git a/dir.targets b/dir.targets
index f99d427a6e..b24dcdffa0 100644
--- a/dir.targets
+++ b/dir.targets
@@ -60,6 +60,13 @@
</UsingTask>
<!--
+ Use a semaphore file to determine the need to restore build tools to avoid conflicts with locked binaries.
+ -->
+ <PropertyGroup>
+ <BuildToolsSemaphore>$(ToolsDir)BuildTools.semaphore</BuildToolsSemaphore>
+ </PropertyGroup>
+
+ <!--
Needed to avoid the IntialTargets from having an Output which ends up getting
added to the output references when you have a project to project reference.
-->
@@ -67,7 +74,7 @@
<Target Name="_RestoreBuildTools"
Inputs="$(MSBuildThisFileDirectory)dir.props;$(SourceDir).nuget/packages.$(OsEnvironment).config"
- Outputs="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll;$(NugetToolPath);$(DnuToolPath)">
+ Outputs="$(BuildToolsSemaphore)">
<Message Importance="High" Text="Restoring build tools..." />
<Copy Condition="Exists('$(NuGetCachedPath)')" SourceFiles="$(NuGetCachedPath)" DestinationFiles="$(NuGetToolPath)" SkipUnchangedFiles="true" />
@@ -95,16 +102,17 @@
<Exec Condition="'$(OsEnvironment)'=='Unix'"
Command="find '$(RoslynPackageDir)tools' -name &quot;*.exe&quot; -exec chmod &quot;+x&quot; '{}' ';'" />
- <Error Condition="'$(ErrorIfBuildToolsRestoredFromIndividualProject)'=='true'"
- Text="The build tools package was just restored and so we cannot continue the build of an individual project because targets from the build tools package were not able to be imported. Please retry the build the individual project again." />
-
<!--
- There are cases where the inputs could be newer than the outputs but the
- download or restore may not need to update. In such cases we need to touch
- these files otherwise we continually run this target over and over for
- every project until these files are cleaned (if the are ever cleaned).
+ Touch our semaphore file to ensure Inputs/Outputs comparison for this target will show that we're up to date.
+ Ignore failures in the unlikely, but possible, event that we hit this from two projects simultaneously.
-->
- <Touch Files="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll;$(NugetToolPath);$(DnuToolPath)" />
+ <Touch Files="$(BuildToolsSemaphore)"
+ ContinueOnError="WarnAndContinue"
+ AlwaysCreate="true"
+ ForceTouch="true" />
+
+ <Error Condition="'$(ErrorIfBuildToolsRestoredFromIndividualProject)'=='true'"
+ Text="The build tools package was just restored and so we cannot continue the build of an individual project because targets from the build tools package were not able to be imported. Please retry the build the individual project again." />
</Target>
<!-- Provide default targets which can be hooked onto or overridden as necessary -->