diff --git a/.vsts-dotnet-ci.yml b/.vsts-dotnet-ci.yml index ee746763650..87e34ce0927 100644 --- a/.vsts-dotnet-ci.yml +++ b/.vsts-dotnet-ci.yml @@ -89,6 +89,8 @@ jobs: inputs: filename: 'eng/cibuild_bootstrapped_msbuild.cmd' arguments: -onlyDocChanged $(onlyDocChanged) + env: + ForceUseXCopyMSBuild: 1 - task: PublishTestResults@2 displayName: Publish .NET Framework Test Results inputs: diff --git a/eng/Versions.props b/eng/Versions.props index 3424cc64d13..09f2d992bf8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 17.10.35 + 17.10.36 release 17.8.3 15.1.0.0 diff --git a/eng/cibuild_bootstrapped_msbuild.ps1 b/eng/cibuild_bootstrapped_msbuild.ps1 index d587daad534..71cbf493110 100644 --- a/eng/cibuild_bootstrapped_msbuild.ps1 +++ b/eng/cibuild_bootstrapped_msbuild.ps1 @@ -65,11 +65,65 @@ try { if ($buildStage1) { - & $PSScriptRoot\Common\Build.ps1 -restore -build -test -ci -msbuildEngine $msbuildEngine /p:CreateBootstrap=true @properties + & $PSScriptRoot\Common\Build.ps1 -restore -build -ci -msbuildEngine $msbuildEngine /p:CreateBootstrap=true @properties } KillProcessesFromRepo + $bootstrapRoot = Join-Path $Stage1BinDir "bootstrap" + + # we need to do this to guarantee we have/know where dotnet.exe is installed + $dotnetToolPath = InitializeDotNetCli $true + $dotnetExePath = Join-Path $dotnetToolPath "dotnet.exe" + + if ($msbuildEngine -eq 'vs') + { + $buildToolPath = Join-Path $bootstrapRoot "net472\MSBuild\Current\Bin\MSBuild.exe" + $buildToolCommand = ""; + $buildToolFramework = "net472" + } + else + { + $buildToolPath = $dotnetExePath + $buildToolCommand = Join-Path $bootstrapRoot "net8.0\MSBuild\MSBuild.dll" + $buildToolFramework = "net8.0" + } + + # Use separate artifacts folder for stage 2 + # $env:ArtifactsDir = Join-Path $ArtifactsDir "2\" + + & $dotnetExePath build-server shutdown + + if ($buildStage1) + { + if (Test-Path $Stage1Dir) + { + Remove-Item -Force -Recurse $Stage1Dir + } + + Move-Item -Path $ArtifactsDir -Destination $Stage1Dir -Force + } + + $buildTool = @{ Path = $buildToolPath; Command = $buildToolCommand; Tool = $msbuildEngine; Framework = $buildToolFramework } + $global:_BuildTool = $buildTool + + # Ensure that debug bits fail fast, rather than hanging waiting for a debugger attach. + $env:MSBUILDDONOTLAUNCHDEBUGGER="true" + + # Opt into performance logging. https://github.com/dotnet/msbuild/issues/5900 + $env:DOTNET_PERFLOG_DIR=$PerfLogDir + + # When using bootstrapped MSBuild: + # - Turn off node reuse (so that bootstrapped MSBuild processes don't stay running and lock files) + # - Do run tests + # - Don't try to create a bootstrap deployment + if ($onlyDocChanged) { + & $PSScriptRoot\Common\Build.ps1 -restore -build -ci /p:CreateBootstrap=false /nr:false @properties + } + else { + & $PSScriptRoot\Common\Build.ps1 -restore -build -test -ci /p:CreateBootstrap=false /nr:false @properties + } + exit $lastExitCode } catch { diff --git a/eng/cibuild_bootstrapped_msbuild.sh b/eng/cibuild_bootstrapped_msbuild.sh index 37683f4fb1a..06d4ba46e21 100755 --- a/eng/cibuild_bootstrapped_msbuild.sh +++ b/eng/cibuild_bootstrapped_msbuild.sh @@ -51,7 +51,7 @@ InitializeDotNetCli true if [[ $build_stage1 == true ]]; then - /bin/bash "$ScriptRoot/common/build.sh" --restore --build --ci --test --configuration $configuration /p:CreateBootstrap=false $properties $extra_properties || exit $? + /bin/bash "$ScriptRoot/common/build.sh" --restore --build --ci --configuration $configuration /p:CreateBootstrap=true $properties $extra_properties || exit $? fi bootstrapRoot="$Stage1Dir/bin/bootstrap" @@ -77,3 +77,15 @@ export DOTNET_PERFLOG_DIR=$PerfLogDir # Prior to 3.0, the Csc task uses this environment variable to decide whether to run # a CLI host or directly execute the compiler. export DOTNET_HOST_PATH="$_InitializeDotNetCli/dotnet" + +# When using bootstrapped MSBuild: +# - Turn off node reuse (so that bootstrapped MSBuild processes don't stay running and lock files) +# - Do run tests +# - Don't try to create a bootstrap deployment +if [ $onlyDocChanged = 0 ] +then + . "$ScriptRoot/common/build.sh" --restore --build --test --ci --nodereuse false --configuration $configuration /p:CreateBootstrap=false $properties $extra_properties + +else + . "$ScriptRoot/common/build.sh" --restore --build --ci --nodereuse false --configuration $configuration /p:CreateBootstrap=false $properties $extra_properties +fi diff --git a/src/Build.UnitTests/BackEnd/MSBuild_Tests.cs b/src/Build.UnitTests/BackEnd/MSBuild_Tests.cs index 16a963128d0..003bf735988 100644 --- a/src/Build.UnitTests/BackEnd/MSBuild_Tests.cs +++ b/src/Build.UnitTests/BackEnd/MSBuild_Tests.cs @@ -412,7 +412,7 @@ public void LogErrorWhenBuildingVCProj() /// However, it's a situation where the project author doesn't have control over the /// property value and so he can't escape it himself. /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void PropertyOverridesContainSemicolon() { ObjectModelHelpers.DeleteTempProjectDirectory(); diff --git a/src/Build.UnitTests/EscapingInProjects_Tests.cs b/src/Build.UnitTests/EscapingInProjects_Tests.cs index cd7406fa9e3..3df737c387a 100644 --- a/src/Build.UnitTests/EscapingInProjects_Tests.cs +++ b/src/Build.UnitTests/EscapingInProjects_Tests.cs @@ -957,7 +957,7 @@ public FullProjectsUsingMicrosoftCommonTargets(ITestOutputHelper output) /// /// ESCAPING: Escaping in conditionals is broken. /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void SemicolonInConfiguration() { ObjectModelHelpers.DeleteTempProjectDirectory(); @@ -1017,7 +1017,7 @@ public class Class1 /// /// ESCAPING: Escaping in conditionals is broken. /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void SemicolonInConfiguration_UsingTaskHost() { string originalOverrideTaskHostVariable = Environment.GetEnvironmentVariable("MSBUILDFORCEALLTASKSOUTOFPROC"); @@ -1087,7 +1087,7 @@ public class Class1 /// /// ESCAPING: CopyBuildTarget target fails if the output assembly name contains a semicolon or single-quote /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void SemicolonInAssemblyName() { ObjectModelHelpers.DeleteTempProjectDirectory(); @@ -1142,7 +1142,7 @@ public class Class1 /// /// ESCAPING: CopyBuildTarget target fails if the output assembly name contains a semicolon or single-quote /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void SemicolonInAssemblyName_UsingTaskHost() { string originalOverrideTaskHostVariable = Environment.GetEnvironmentVariable("MSBUILDFORCEALLTASKSOUTOFPROC"); @@ -1207,7 +1207,7 @@ public class Class1 /// /// ESCAPING: Conversion Issue: Properties with $(xxx) as literals are not being converted correctly /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void DollarSignInAssemblyName() { ObjectModelHelpers.DeleteTempProjectDirectory(); @@ -1262,7 +1262,7 @@ public class Class1 /// /// ESCAPING: Conversion Issue: Properties with $(xxx) as literals are not being converted correctly /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void DollarSignInAssemblyName_UsingTaskHost() { string originalOverrideTaskHostVariable = Environment.GetEnvironmentVariable("MSBUILDFORCEALLTASKSOUTOFPROC"); @@ -1327,7 +1327,7 @@ public class Class1 /// /// This is the case when one of the source code files in the project has a filename containing a semicolon. /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void SemicolonInSourceCodeFilename() { ObjectModelHelpers.DeleteTempProjectDirectory(); @@ -1382,7 +1382,7 @@ public class Class1 /// /// This is the case when one of the source code files in the project has a filename containing a semicolon. /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void SemicolonInSourceCodeFilename_UsingTaskHost() { string originalOverrideTaskHostVariable = Environment.GetEnvironmentVariable("MSBUILDFORCEALLTASKSOUTOFPROC"); diff --git a/src/Tasks.UnitTests/MSBuild_Tests.cs b/src/Tasks.UnitTests/MSBuild_Tests.cs index 4e4c0a0ef81..ad1ab81787a 100644 --- a/src/Tasks.UnitTests/MSBuild_Tests.cs +++ b/src/Tasks.UnitTests/MSBuild_Tests.cs @@ -389,7 +389,7 @@ public void LogErrorWhenBuildingVCProj() #if RUNTIME_TYPE_NETCORE [Fact(Skip = "https://github.com/dotnet/msbuild/issues/259")] #else - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] #endif public void PropertyOverridesContainSemicolon() { diff --git a/src/Tasks.UnitTests/ResourceHandling/GenerateResourceOutOfProc_Tests.cs b/src/Tasks.UnitTests/ResourceHandling/GenerateResourceOutOfProc_Tests.cs index 8f5a1bcd6bc..472d732a973 100644 --- a/src/Tasks.UnitTests/ResourceHandling/GenerateResourceOutOfProc_Tests.cs +++ b/src/Tasks.UnitTests/ResourceHandling/GenerateResourceOutOfProc_Tests.cs @@ -2566,7 +2566,7 @@ public References(ITestOutputHelper output) _output = output; } - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void DontLockP2PReferenceWhenResolvingSystemTypes() { // This WriteLine is a hack. On a slow machine, the Tasks unittest fails because remoting @@ -2741,7 +2741,7 @@ public class Class1 /// Assembly.LoadFile on that relative path, which fails (LoadFile requires an /// absolute path). The fix was to use Assembly.LoadFrom instead. /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [Fact] public void ReferencedAssemblySpecifiedUsingRelativePath() { // This WriteLine is a hack. On a slow machine, the Tasks unittest fails because remoting diff --git a/src/Tasks.UnitTests/ResourceHandling/GenerateResource_Tests.cs b/src/Tasks.UnitTests/ResourceHandling/GenerateResource_Tests.cs index ba93bb422e4..a38fd0f4bbd 100644 --- a/src/Tasks.UnitTests/ResourceHandling/GenerateResource_Tests.cs +++ b/src/Tasks.UnitTests/ResourceHandling/GenerateResource_Tests.cs @@ -3064,7 +3064,7 @@ public References(ITestOutputHelper output) _output = output; } - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [WindowsFullFrameworkOnlyFact(additionalMessage: "Linked resources not supported on Core: https://github.com/dotnet/msbuild/issues/4094")] public void DontLockP2PReferenceWhenResolvingSystemTypes() { // This WriteLine is a hack. On a slow machine, the Tasks unittest fails because remoting @@ -3240,7 +3240,7 @@ public class Class1 /// which fails (LoadFile requires an absolute path). The fix was to use /// Assembly.LoadFrom instead. /// - [Fact(Skip = "https://github.com/dotnet/msbuild/issues/11888")] + [WindowsFullFrameworkOnlyFact(additionalMessage: "Linked resources not supported on Core: https://github.com/dotnet/msbuild/issues/4094")] public void ReferencedAssemblySpecifiedUsingRelativePath() { // This WriteLine is a hack. On a slow machine, the Tasks unittest fails because remoting