diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 8773094d3..54bbaa8bb 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -97,6 +97,29 @@ stages: # Never run tests on arm64 _TestArg: '' + - template: /eng/build.yml + parameters: + agentOs: Windows_NT + pool: + ${{ if eq(variables['System.TeamProject'], 'public') }}: + name: NetCorePublic-Pool + queue: buildpool.windows.10.amd64.vs2017.open + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + name: NetCoreInternal-Pool + queue: buildpool.windows.10.amd64.vs2017 + timeoutInMinutes: 180 + strategy: + matrix: + # Always run builds + Build_Release_x64: + _BuildConfig: Release + _BuildArchitecture: x64 + _DOTNET_CLI_UI_LANGUAGE: '' + _AdditionalBuildParameters: '/p:PublishInternalAsset=true' + # Never run tests on PGO bits + _TestArg: '' + pgoInstrument: true + - template: /eng/build.yml parameters: agentOs: Linux @@ -270,7 +293,7 @@ stages: - template: /eng/build.yml parameters: agentOs: Darwin - pool: + pool: vmImage: 'macOS-10.15' timeoutInMinutes: 180 strategy: @@ -291,7 +314,7 @@ stages: # - template: /eng/build.yml # parameters: # agentOs: FreeBSD - # queue: + # queue: # name: dnceng-freebsd-internal # timeoutInMinutes: 180 # matrix: diff --git a/Directory.Build.props b/Directory.Build.props index b020e30cf..db48d7f60 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -12,6 +12,10 @@ $(BuildArchitecture) x64 + + true + -pgo + True diff --git a/eng/build.yml b/eng/build.yml index 6d8cd3ef3..738b205c6 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -20,7 +20,10 @@ parameters: phases: - template: /eng/common/templates/job/job.yml parameters: - name: ${{ parameters.agentOs }} + ${{ if parameters.pgoInstrument }}: + name: PGO_${{ parameters.agentOs }} + ${{ if not(parameters.pgoInstrument) }}: + name: ${{ parameters.agentOs }} timeoutInMinutes: ${{ parameters.timeoutInMinutes }} ${{ if eq(parameters.agentOs, 'Windows_NT') }}: enableMicrobuild: true @@ -37,11 +40,20 @@ phases: workspace: clean: all - variables: + variables: + - _PgoInstrument: '' + - ${{ if eq(parameters.agentOs, 'Windows_NT') }}: + - _PackArg: '-pack' + - ${{ if ne(parameters.agentOs, 'Windows_NT') }}: + - _PackArg: '--pack' + - ${{ if parameters.pgoInstrument }}: + - _PgoInstrument: '/p:PgoInstrument=true' + - _PackArg: '' + - _AgentOSName: ${{ parameters.agentOs }} - _TeamName: Roslyn-Project-System - _SignType: test - - _BuildArgs: '/p:DotNetSignType=$(_SignType)' + - _BuildArgs: '/p:DotNetSignType=$(_SignType) $(_PgoInstrument)' - _DOTNETCLIMSRC_READ_SAS_TOKEN: '' - ${{ if eq(variables['System.TeamProject'], 'internal') }}: @@ -61,6 +73,7 @@ phases: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName) /p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines) + $(_PgoInstrument) steps: - checkout: self @@ -75,8 +88,8 @@ phases: env: Token: $(dn-bot-dnceng-artifact-feeds-rw) - script: build.cmd - $(_TestArg) - -pack -publish -ci -sign + $(_TestArg) $(_PackArg) + -publish -ci -sign -Configuration $(_BuildConfig) -Architecture $(_BuildArchitecture) $(_BuildArgs) @@ -97,8 +110,8 @@ phases: Token: $(dn-bot-dnceng-artifact-feeds-rw) - ${{ if eq(parameters.agentOs, 'Linux') }}: - script: ./build.sh - $(_TestArg) - --pack --publish --ci + $(_TestArg) $(_PackArg) + --publish --ci --noprettyprint --configuration $(_BuildConfig) $(_DockerParameter) @@ -135,32 +148,32 @@ phases: publishFeedCredentials: 'DevDiv - VS package feed' condition: and(succeeded(), eq(variables['_PushToVSFeed'], 'true'), eq(variables['_DotNetPublishToBlobFeed'], 'true'), or(eq(variables['_BuildArchitecture'], 'x64'), eq(variables['_BuildArchitecture'], 'x86'))) - - task: PublishTestResults@2 - displayName: Publish Test Results + - task: PublishTestResults@2 + displayName: Publish Test Results inputs: - testRunner: XUnit - testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml' - testRunTitle: '$(_AgentOSName)_$(Agent.JobName)' - platform: '$(BuildPlatform)' - configuration: '$(_BuildConfig)' + testRunner: XUnit + testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml' + testRunTitle: '$(_AgentOSName)_$(Agent.JobName)' + platform: '$(BuildPlatform)' + configuration: '$(_BuildConfig)' condition: ne(variables['_TestArg'], '') - - task: CopyFiles@2 - displayName: Gather Logs + - task: CopyFiles@2 + displayName: Gather Logs inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts' - Contents: | - log/$(_BuildConfig)/**/* - TestResults/$(_BuildConfig)/**/* - TargetFolder: '$(Build.ArtifactStagingDirectory)' - continueOnError: true + SourceFolder: '$(Build.SourcesDirectory)/artifacts' + Contents: | + log/$(_BuildConfig)/**/* + TestResults/$(_BuildConfig)/**/* + TargetFolder: '$(Build.ArtifactStagingDirectory)' + continueOnError: true condition: always() - - task: PublishBuildArtifacts@1 - displayName: Publish Logs to VSTS + - task: PublishBuildArtifacts@1 + displayName: Publish Logs to VSTS inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)' - publishLocation: Container - continueOnError: true + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)' + publishLocation: Container + continueOnError: true condition: always() diff --git a/run-build.ps1 b/run-build.ps1 index 07db27efd..4f2e1275f 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -8,6 +8,7 @@ param( [string]$Configuration="Debug", [string]$Architecture="x64", [switch]$Sign=$false, + [switch]$PgoInstrument, [bool]$WarnAsError=$true, [Parameter(ValueFromRemainingArguments=$true)][String[]]$ExtraParameters ) @@ -17,6 +18,10 @@ $RepoRoot = "$PSScriptRoot" $Parameters = "/p:Architecture=$Architecture" $Parameters = "$Parameters -configuration $Configuration" +if ($PgoInstrument) { + $Parameters = "$Parameters /p:PgoInstrument=true" +} + if ($Sign) { $Parameters = "$Parameters -sign /p:SignCoreSdk=true" diff --git a/run-build.sh b/run-build.sh index 9807c4a30..7b98aedc0 100755 --- a/run-build.sh +++ b/run-build.sh @@ -42,6 +42,9 @@ while [[ $# > 0 ]]; do --linux-portable) args+=("/p:Rid=linux-x64 /p:OSName=\"linux\" /p:IslinuxPortable=\"true\"") ;; + --pgoInstrument) + args+=("/p:PgoInstrument=true") + ;; --help) echo "Usage: $0 [--configuration ] [--architecture ] [--docker ] [--help]" echo "" diff --git a/src/redist/targets/GenerateBundledVersions.targets b/src/redist/targets/GenerateBundledVersions.targets index b33f44e0c..73e760254 100644 --- a/src/redist/targets/GenerateBundledVersions.targets +++ b/src/redist/targets/GenerateBundledVersions.targets @@ -8,7 +8,7 @@ Lines="$(PackageVersion)" Overwrite="true" Encoding="ASCII" /> - + 3.0.3 <_NETCoreApp30TargetingPackVersion>3.0.0 - + <_NETCoreApp31RuntimePackVersion>3.1.$(VersionFeature31) <_NETCoreApp31TargetingPackVersion>3.1.0 - + <_WindowsDesktop30RuntimePackVersion>3.0.3 <_WindowsDesktop30TargetingPackVersion>3.0.0 - + <_WindowsDesktop31RuntimePackVersion>3.1.$(VersionFeature31) <_WindowsDesktop31TargetingPackVersion>3.1.0 - + <_AspNet30RuntimePackVersion>3.0.3 <_AspNet30TargetingPackVersion>3.0.1 - + <_AspNet31RuntimePackVersion>3.1.$(VersionFeature31) <_AspNet31TargetingPackVersion>3.1.10 @@ -101,7 +101,7 @@ @(NetCore31RuntimePackRids); linux-musl-arm; "/> - + - + - + $(ProductMonikerRid) - + @@ -223,7 +223,7 @@ Copyright (c) .NET Foundation. All rights reserved. %24([MSBuild]::NormalizePath('%24(MSBuildThisFileDirectory)..\..\')) %24([MSBuild]::EnsureTrailingSlash('%24(NetCoreRoot)'))packs - + $(_NETCoreAppTargetFrameworkVersion) $(_NETCoreAppTargetFrameworkVersion) $(_NETCoreAppPackageVersion) @@ -265,7 +265,7 @@ Copyright (c) .NET Foundation. All rights reserved. Crossgen2PackVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)" Crossgen2RuntimeIdentifiers="@(Crossgen2SupportedRids, '%3B')" /> - + - + - + - + - + - + diff --git a/src/redist/targets/GenerateInstallers.targets b/src/redist/targets/GenerateInstallers.targets index a4e008b00..b98fcc9d1 100644 --- a/src/redist/targets/GenerateInstallers.targets +++ b/src/redist/targets/GenerateInstallers.targets @@ -5,6 +5,7 @@ -internal$(PgoTerm) @@ -49,7 +51,7 @@ x86 dotnet-host$(InstallerStartSuffix)-$(SharedHostVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerExtension) dotnet-hostfxr$(InstallerStartSuffix)-$(HostFxrVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerExtension) - dotnet-runtime$(InstallerStartSuffix)-$(MicrosoftNETCoreAppRuntimePackageVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerExtension) + dotnet-runtime$(InstallerStartSuffix)$(PgoArchiveTerm)-$(MicrosoftNETCoreAppRuntimePackageVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerExtension) dotnet-runtime-deps-$(SharedHostVersion)-$(RuntimeDepsInstallerFileRid)$(InstallerExtension) windowsdesktop-runtime-$(MicrosoftWindowsDesktopAppRuntimePackageVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerExtension) dotnet-targeting-pack-$(MicrosoftNETCoreAppRefPackageVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerExtension) @@ -70,7 +72,7 @@ $(CoreSetupRid) $(ProductMonikerRid) linux-$(Architecture) - dotnet-runtime-$(MicrosoftNETCoreAppRuntimePackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension) + dotnet-runtime$(PgoTerm)-$(MicrosoftNETCoreAppRuntimePackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension) windowsdesktop-runtime-$(MicrosoftWindowsDesktopAppRuntimePackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension) $(SharedFrameworkRid) diff --git a/src/redist/targets/GetRuntimeInformation.targets b/src/redist/targets/GetRuntimeInformation.targets index ce6e3b14c..045a5d30a 100644 --- a/src/redist/targets/GetRuntimeInformation.targets +++ b/src/redist/targets/GetRuntimeInformation.targets @@ -12,7 +12,7 @@ $(OSName)-$(Architecture) - + true true @@ -26,13 +26,13 @@ '$(Rid)' == 'linux-musl-x64' ">$(Rid) $(OSName)-$(Architecture) - dotnet-sdk-internal - dotnet-sdk + dotnet-sdk-internal$(PgoTerm) + dotnet-sdk$(PgoTerm) $(ArtifactNameSdk)-$(Version)-$(ProductMonikerRid) dotnet-standard-support-vs2015-$(Version)-$(ProductMonikerRid) $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(Version)-$(ProductMonikerRid) - Dotnet SDK Bundle Installer $(CliProductBandVersion) $(ProductMonikerRid) $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(Version)-$(Architecture)