Skip to content

Commit

Permalink
Merge pull request #34093 from jaredpar/fix-sdk
Browse files Browse the repository at this point in the history
Move to .NET Core 3.0 SDK
  • Loading branch information
jaredpar committed Mar 19, 2019
2 parents 063a86d + 23a2bf8 commit 79ce474
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 42 deletions.
Expand Up @@ -18,7 +18,8 @@ The minimal required version of .NET Framework is 4.7.2.
1. [Visual Studio 2019 RC](https://visualstudio.microsoft.com/downloads/#2019rc)
- Ensure C#, VB, MSBuild, .NET Core and Visual Studio Extensibility are included in the selected work loads
- Ensure Visual Studio is on Version "RC1" or greater
1. [.NET Core SDK 2.1.401](https://www.microsoft.com/net/download/core) (the installers are: [Windows x64 installer](https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.1.401/dotnet-sdk-2.1.401-win-x64.exe), [Windows x86 installer](https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.1.401/dotnet-sdk-2.1.401-win-x86.exe))
- Ensure "Use Previews" is checked in Tools -> Options -> Projects and Solutions -> .NET Core
1. [.NET Core SDK 3.0 Preview 3](https://dotnet.microsoft.com/download/dotnet-core/3.0) [Windows x64 installer](https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-3.0.100-preview3-windows-x64-installer)
1. [PowerShell 5.0 or newer](https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell). If you are on Windows 10, you are fine; you'll only need to upgrade if you're on Windows 7. The download link is under the "upgrading existing Windows PowerShell" heading.
1. Run Restore.cmd
1. Open Roslyn.sln
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Expand Up @@ -67,7 +67,7 @@
<MicrosoftInternalVisualStudioShellInterop140DesignTimeVersion>14.3.25407-alpha</MicrosoftInternalVisualStudioShellInterop140DesignTimeVersion>
<MicrosoftMetadataVisualizerVersion>1.0.0-beta1-63011-01</MicrosoftMetadataVisualizerVersion>
<MicrosoftMSXMLVersion>8.0.0.0-alpha</MicrosoftMSXMLVersion>
<MicrosoftNetCompilersToolsetVersion>3.1.0-beta1-19127-06</MicrosoftNetCompilersToolsetVersion>
<MicrosoftNetCompilersToolsetVersion>3.1.0-beta1-19164-01</MicrosoftNetCompilersToolsetVersion>
<MicrosoftNetCoreAnalyzersVersion>$(RoslynDiagnosticsNugetPackageVersion)</MicrosoftNetCoreAnalyzersVersion>
<MicrosoftNetCoreILAsmVersion>2.0.0</MicrosoftNetCoreILAsmVersion>
<MicrosoftNETCorePlatformsVersion>2.1.2</MicrosoftNETCorePlatformsVersion>
Expand Down
84 changes: 54 additions & 30 deletions eng/build.ps1
Expand Up @@ -34,6 +34,7 @@ param (
[switch]$bootstrap,
[string]$bootstrapConfiguration = "Release",
[switch][Alias('bl')]$binaryLog,
[switch]$buildServerLog,
[switch]$ci,
[switch]$procdump,
[switch]$skipAnalyzers,
Expand Down Expand Up @@ -75,6 +76,7 @@ function Print-Usage() {
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"
Write-Host " -deployExtensions Deploy built vsixes (short: -d)"
Write-Host " -binaryLog Create MSBuild binary log (short: -bl)"
Write-Host " -buildServerLog Create Roslyn build server log"
Write-Host ""
Write-Host "Actions:"
Write-Host " -restore Restore packages (short: -r)"
Expand Down Expand Up @@ -163,6 +165,9 @@ function Process-Arguments() {

if ($ci) {
$script:binaryLog = $true
if ($bootstrap) {
$script:buildServerLog = $true
}
}

if ($test32 -and $test64) {
Expand Down Expand Up @@ -205,6 +210,11 @@ function BuildSolution() {
Write-Host "$($solution):"

$bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" }

if ($buildServerLog) {
${env:ROSLYNCOMMANDLINELOGFILE} = Join-Path $LogDir "Build.Server.log"
}

$projects = Join-Path $RepoRoot $solution
$enableAnalyzers = !$skipAnalyzers
$toolsetBuildProj = InitializeToolset
Expand All @@ -223,36 +233,41 @@ function BuildSolution() {
# Workaround for some machines in the AzDO pool not allowing long paths (%5c is msbuild escaped backslash)
$ibcDir = Join-Path $RepoRoot ".o%5c"

# Setting /p:TreatWarningsAsErrors=true is a workaround for https://github.com/Microsoft/msbuild/issues/3062.
# We don't pass /warnaserror to msbuild ($warnAsError is set to $false by default above), but set
# /p:TreatWarningsAsErrors=true so that compiler reported warnings, other than IDE0055 are treated as errors.
# Warnings reported from other msbuild tasks are not treated as errors for now.
MSBuild $toolsetBuildProj `
$bl `
/p:Configuration=$configuration `
/p:Projects=$projects `
/p:RepoRoot=$RepoRoot `
/p:Restore=$restore `
/p:Build=$build `
/p:Test=$testCoreClr `
/p:Rebuild=$rebuild `
/p:Pack=$pack `
/p:Sign=$sign `
/p:Publish=$publish `
/p:ContinuousIntegrationBuild=$ci `
/p:OfficialBuildId=$officialBuildId `
/p:UseRoslynAnalyzers=$enableAnalyzers `
/p:BootstrapBuildPath=$bootstrapDir `
/p:QuietRestore=$quietRestore `
/p:QuietRestoreBinaryLog=$binaryLog `
/p:TestTargetFrameworks=$testTargetFrameworks `
/p:TreatWarningsAsErrors=true `
/p:VisualStudioIbcSourceBranchName=$ibcSourceBranchName `
/p:VisualStudioIbcDropId=$ibcDropId `
/p:EnablePartialNgenOptimization=$applyOptimizationData `
/p:IbcOptimizationDataDir=$ibcDir `
$suppressExtensionDeployment `
@properties
try {
# Setting /p:TreatWarningsAsErrors=true is a workaround for https://github.com/Microsoft/msbuild/issues/3062.
# We don't pass /warnaserror to msbuild ($warnAsError is set to $false by default above), but set
# /p:TreatWarningsAsErrors=true so that compiler reported warnings, other than IDE0055 are treated as errors.
# Warnings reported from other msbuild tasks are not treated as errors for now.
MSBuild $toolsetBuildProj `
$bl `
/p:Configuration=$configuration `
/p:Projects=$projects `
/p:RepoRoot=$RepoRoot `
/p:Restore=$restore `
/p:Build=$build `
/p:Test=$testCoreClr `
/p:Rebuild=$rebuild `
/p:Pack=$pack `
/p:Sign=$sign `
/p:Publish=$publish `
/p:ContinuousIntegrationBuild=$ci `
/p:OfficialBuildId=$officialBuildId `
/p:UseRoslynAnalyzers=$enableAnalyzers `
/p:BootstrapBuildPath=$bootstrapDir `
/p:QuietRestore=$quietRestore `
/p:QuietRestoreBinaryLog=$binaryLog `
/p:TestTargetFrameworks=$testTargetFrameworks `
/p:TreatWarningsAsErrors=true `
/p:VisualStudioIbcSourceBranchName=$ibcSourceBranchName `
/p:VisualStudioIbcDropId=$ibcDropId `
/p:EnablePartialNgenOptimization=$applyOptimizationData `
/p:IbcOptimizationDataDir=$ibcDir `
$suppressExtensionDeployment `
@properties
}
finally {
${env:ROSLYNCOMMANDLINELOGFILE} = $null
}
}


Expand Down Expand Up @@ -566,6 +581,15 @@ try {
}
}

if ($ci) {
$global:_DotNetInstallDir = Join-Path $RepoRoot ".dotnet"
InstallDotNetSdk $global:_DotNetInstallDir $GlobalJson.tools.dotnet

# Make sure a 2.1 runtime is installed so we can run our tests. Most of them still
# target netcoreapp2.1.
InstallDotNetSdk $global:_DotNetInstallDir "2.1.503"
}

if ($bootstrap) {
$bootstrapDir = Make-BootstrapBuild
}
Expand Down
3 changes: 3 additions & 0 deletions eng/build.sh
Expand Up @@ -282,6 +282,9 @@ function BuildSolution {

InitializeDotNetCli $restore

# Make sure we have a 2.1 runtime available for running our tests
InstallDotNetSdk $_InitializeDotNetCli 2.1.503

bootstrap_dir=""
if [[ "$bootstrap" == true ]]; then
MakeBootstrapBuild
Expand Down
2 changes: 1 addition & 1 deletion global.json
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "2.1.503",
"dotnet": "3.0.100-preview3-010431",
"vs": {
"version": "16.0"
},
Expand Down
3 changes: 1 addition & 2 deletions src/Compilers/CSharp/csc/csc.csproj
Expand Up @@ -20,7 +20,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
<PackageReference Include="System.IO.Pipes.AccessControl" Version="$(SystemIOPipesAccessControlVersion)" Condition="'$(TargetFramework)' == 'netcoreapp2.1'" />
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)"/>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Shared\RuntimeHostInfo.cs" />
Expand All @@ -44,4 +43,4 @@
</None>
</ItemGroup>
<Import Project="..\..\Core\CommandLine\CommandLine.projitems" Label="Shared" />
</Project>
</Project>
4 changes: 2 additions & 2 deletions src/Compilers/Server/VBCSCompiler/VBCSCompiler.csproj
Expand Up @@ -21,7 +21,7 @@
<ItemGroup>
<Reference Include="System.Configuration" Condition="'$(TargetFramework)' != 'netcoreapp2.1'" />
<PackageReference Include="System.IO.Pipes.AccessControl" Version="$(SystemIOPipesAccessControlVersion)" Condition="'$(TargetFramework)' == 'netcoreapp2.1'" />
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)"/>
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Shared\RuntimeHostInfo.cs" />
Expand All @@ -43,4 +43,4 @@
<InternalsVisibleTo Include="VBCSCompiler.UnitTests" />
</ItemGroup>
<Import Project="..\..\Core\CommandLine\CommandLine.projitems" Label="Shared" />
</Project>
</Project>
3 changes: 1 addition & 2 deletions src/Compilers/VisualBasic/vbc/vbc.csproj
Expand Up @@ -19,7 +19,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
<PackageReference Include="System.IO.Pipes.AccessControl" Version="$(SystemIOPipesAccessControlVersion)" Condition="'$(TargetFramework)' == 'netcoreapp2.1'" />
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)"/>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Shared\RuntimeHostInfo.cs" />
Expand All @@ -43,4 +42,4 @@
</None>
</ItemGroup>
<Import Project="..\..\Core\CommandLine\CommandLine.projitems" Label="Shared" />
</Project>
</Project>
6 changes: 5 additions & 1 deletion src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs
Expand Up @@ -103,10 +103,13 @@ private bool CheckDesktop(TextWriter textWriter, IEnumerable<string> assetRelati
string.Empty,
assetRelativeNames);

// Temporarily inserting Microsoft.DiaSymReader.Native.arm.dll while SDK team tracks down why
// it's being inserted into destkop builds.
// https://github.com/dotnet/cli/issues/10979
allGood &= VerifyVsix(
textWriter,
FindVsix("Roslyn.Compilers.Extension"),
assetRelativeNames.Concat(new[] { "Roslyn.Compilers.Extension.dll" }));
assetRelativeNames.Concat(new[] { "Roslyn.Compilers.Extension.dll", "Microsoft.DiaSymReader.Native.arm.dll" }));
return allGood;
}

Expand Down Expand Up @@ -172,6 +175,7 @@ private bool GetPackageAssets(TextWriter textWriter, List<PackageAsset> packageA
// root as well. That copy is unnecessary.
coreClrAssets.RemoveAll(asset =>
PathComparer.Equals("Microsoft.DiaSymReader.Native.amd64.dll", asset.FileRelativeName) ||
PathComparer.Equals("Microsoft.DiaSymReader.Native.arm.dll", asset.FileRelativeName) ||
PathComparer.Equals("Microsoft.DiaSymReader.Native.x86.dll", asset.FileRelativeName));

// Move all of the assets into bincore as that is where the non-MSBuild task assets will go
Expand Down
Expand Up @@ -30,7 +30,7 @@ public override void ErrorLevelWarning()
base.ErrorLevelWarning();
}

[WpfFact, Trait(Traits.Feature, Traits.Features.ErrorList)]
[WpfFact(Skip = "https://github.com/dotnet/roslyn/issues/34211"), Trait(Traits.Feature, Traits.Features.ErrorList)]
[Trait(Traits.Feature, Traits.Features.NetCore)]
public override void ErrorsDuringMethodBodyEditing()
{
Expand Down
Expand Up @@ -26,7 +26,7 @@ public override void OpenCSharpThenVBSolution()
base.OpenCSharpThenVBSolution();
}

[WpfFact, Trait(Traits.Feature, Traits.Features.Workspace)]
[WpfFact(Skip = "https://github.com/dotnet/cli/issues/10989"), Trait(Traits.Feature, Traits.Features.Workspace)]
[Trait(Traits.Feature, Traits.Features.NetCore)]
public override void MetadataReference()
{
Expand Down

0 comments on commit 79ce474

Please sign in to comment.