Skip to content

Commit ed659d7

Browse files
wtgodbegithub-actions[bot]BrennanConroymthalman
authored
[release/8.0] Use MacOS-13 in CI (#58549)
* Fix conflict * Use native tools on machine * Fix SignalR Java POM to include description * Try stream8 * New pool * No git * Maybe change the order * Add newline at end of global.json file --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Brennan <[email protected]> Co-authored-by: Matt Thalman <[email protected]>
1 parent e387348 commit ed659d7

File tree

16 files changed

+260
-186
lines changed

16 files changed

+260
-186
lines changed

.azure/pipelines/ci-public.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ stages:
116116
# The sign settings have been configured to
117117
- script: ./eng/build.cmd
118118
-ci
119+
-nativeToolsOnMachine
119120
-arch x64
120121
-pack
121122
-all
@@ -588,11 +589,11 @@ stages:
588589
timeoutInMinutes: 240
589590
steps:
590591
# Build the shared framework
591-
- script: ./eng/build.cmd -ci -nobl -all -pack -arch x64
592+
- script: ./eng/build.cmd -ci -nativeToolsOnMachine -nobl -all -pack -arch x64
592593
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
593594
displayName: Build shared fx
594595
# -noBuildRepoTasks -noBuildNative -noBuild to avoid repeating work done in the previous step.
595-
- script: ./eng/build.cmd -ci -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test
596+
- script: ./eng/build.cmd -ci -nativeToolsOnMachine -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test
596597
-projects eng\helix\helix.proj /p:IsHelixPRCheck=true /p:IsHelixJob=true
597598
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
598599
displayName: Run build.cmd helix target
@@ -611,7 +612,7 @@ stages:
611612
parameters:
612613
platform:
613614
name: 'Managed'
614-
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9'
615+
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8'
615616
buildScript: './eng/build.sh $(_PublishArgs) --no-build-nodejs --no-build-repo-tasks $(_InternalRuntimeDownloadArgs)'
616617
skipPublishValidation: true
617618
jobProperties:

.azure/pipelines/ci.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ extends:
187187
# The sign settings have been configured to
188188
- script: ./eng/build.cmd
189189
-ci
190+
-nativeToolsOnMachine
190191
-arch x64
191192
-pack
192193
-all
@@ -657,11 +658,11 @@ extends:
657658
timeoutInMinutes: 240
658659
steps:
659660
# Build the shared framework
660-
- script: ./eng/build.cmd -ci -nobl -all -pack -arch x64
661+
- script: ./eng/build.cmd -ci -nativeToolsOnMachine -nobl -all -pack -arch x64
661662
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
662663
displayName: Build shared fx
663664
# -noBuildRepoTasks -noBuildNative -noBuild to avoid repeating work done in the previous step.
664-
- script: ./eng/build.cmd -ci -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test
665+
- script: ./eng/build.cmd -ci -nativeToolsOnMachine -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test
665666
-projects eng\helix\helix.proj /p:IsHelixPRCheck=true /p:IsHelixJob=true
666667
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
667668
displayName: Run build.cmd helix target
@@ -681,7 +682,7 @@ extends:
681682
enableInternalSources: true
682683
platform:
683684
name: 'Managed'
684-
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9'
685+
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8'
685686
buildScript: './eng/build.sh $(_PublishArgs) --no-build-nodejs --no-build-repo-tasks $(_InternalRuntimeDownloadArgs)'
686687
skipPublishValidation: true
687688
jobProperties:

.azure/pipelines/jobs/codesign-xplat.yml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
jobDisplayName: "Code-sign ${{ parameters.inputName }} packages"
1414
agentOs: Windows
1515
installNodeJs: false
16-
installJdk: false
1716
steps:
1817
- task: DownloadPipelineArtifact@2
1918
displayName: Download ${{ parameters.inputName }} artifacts

.azure/pipelines/jobs/default-build.yml

+20-31
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ parameters:
6868
container: ''
6969
enableRichCodeNavigation: ''
7070
installNodeJs: true
71-
installJdk: true # Ignored unless agentOs == Windows.
7271
timeoutInMinutes: 180
7372
testRunTitle: $(AgentOsName)-$(BuildConfiguration)
7473
useHostedUbuntu: true
@@ -107,7 +106,7 @@ jobs:
107106
# See https://github.com/dotnet/arcade/blob/master/Documentation/ChoosingAMachinePool.md
108107
pool:
109108
${{ if eq(parameters.agentOs, 'macOS') }}:
110-
vmImage: macOS-12
109+
vmImage: macOS-13
111110
${{ if eq(parameters.agentOs, 'Linux') }}:
112111
${{ if eq(parameters.useHostedUbuntu, true) }}:
113112
vmImage: ubuntu-20.04
@@ -116,7 +115,7 @@ jobs:
116115
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64.Open
117116
${{ if eq(parameters.agentOs, 'Windows') }}:
118117
name: $(DncEngPublicBuildPool)
119-
demands: ImageOverride -equals 1es-windows-2022-open
118+
demands: ImageOverride -equals windows.vs2022preview.amd64.open
120119
${{ if ne(parameters.container, '') }}:
121120
container: ${{ parameters.container }}
122121
${{ if ne(parameters.disableComponentGovernance, '') }}:
@@ -131,8 +130,6 @@ jobs:
131130
- DOTNET_CLI_HOME: $(System.DefaultWorkingDirectory)
132131
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
133132
- TeamName: AspNetCore
134-
- ${{ if and(eq(parameters.installJdk, 'true'), eq(parameters.agentOs, 'Windows')) }}:
135-
- JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk\win-x64
136133
- ${{ if ne(parameters.codeSign, true) }}:
137134
- _SignType: ''
138135
- LC_ALL: 'en_US.UTF-8'
@@ -167,8 +164,8 @@ jobs:
167164
- script: df -h
168165
displayName: Disk size
169166
- ${{ if eq(parameters.agentOs, 'macOS') }}:
170-
- script: sudo xcode-select -s /Applications/Xcode_14.2.0.app/Contents/Developer
171-
displayName: Use XCode 14.2.0
167+
- script: sudo xcode-select -s /Applications/Xcode_15.2.0.app/Contents/Developer
168+
displayName: Use XCode 15.2.0
172169
- checkout: self
173170
clean: true
174171
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
@@ -181,14 +178,11 @@ jobs:
181178
displayName: Install Node 18.x
182179
inputs:
183180
versionSpec: 18.x
184-
- ${{ if and(eq(parameters.installJdk, 'true'), eq(parameters.agentOs, 'Windows')) }}:
185-
- powershell: ./eng/scripts/InstallJdk.ps1
186-
displayName: Install JDK 11
187-
- ${{ if eq(parameters.isAzDOTestingJob, true) }}:
188-
- powershell: |
189-
Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(Build.SourcesDirectory)\artifacts\tmp\selenium\"
190-
./eng/scripts/InstallGoogleChrome.ps1
191-
displayName: Install Chrome
181+
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
182+
- powershell: |
183+
Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(Build.SourcesDirectory)\artifacts\tmp\selenium\"
184+
./eng/scripts/InstallGoogleChrome.ps1
185+
displayName: Install Chrome
192186
- ${{ if eq(parameters.agentOs, 'Windows') }}:
193187
- powershell: Write-Host "##vso[task.prependpath]$(DOTNET_CLI_HOME)\.dotnet\tools"
194188
displayName: Add dotnet tools to path
@@ -215,7 +209,7 @@ jobs:
215209
${{ step.env }}
216210
- ${{ if eq(parameters.steps, '')}}:
217211
- ${{ if eq(parameters.agentOs, 'Windows') }}:
218-
- script: $(BuildDirectory)\build.cmd -ci -nobl -Configuration $(BuildConfiguration) $(BuildScriptArgs)
212+
- script: $(BuildDirectory)\build.cmd -ci -nativeToolsOnMachine -nobl -Configuration $(BuildConfiguration) $(BuildScriptArgs)
219213
/p:DotNetSignType=$(_SignType)
220214
displayName: Run build.cmd
221215
env:
@@ -326,7 +320,7 @@ jobs:
326320
pool:
327321
${{ if eq(parameters.agentOs, 'macOS') }}:
328322
name: Azure Pipelines
329-
image: macOS-12
323+
image: macOS-13
330324
os: macOS
331325
${{ if eq(parameters.agentOs, 'Linux') }}:
332326
name: $(DncEngInternalBuildPool)
@@ -335,7 +329,7 @@ jobs:
335329
${{ if eq(parameters.agentOs, 'Windows') }}:
336330
name: $(DncEngInternalBuildPool)
337331
# Visual Studio Enterprise - contains some stuff, like SQL Server and IIS Express, that we use for testing
338-
image: 1es-windows-2022
332+
image: windows.vs2022preview.amd64
339333
os: windows
340334
${{ if ne(parameters.container, '') }}:
341335
container: ${{ parameters.container }}
@@ -351,8 +345,6 @@ jobs:
351345
- DOTNET_CLI_HOME: $(System.DefaultWorkingDirectory)
352346
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
353347
- TeamName: AspNetCore
354-
- ${{ if and(eq(parameters.installJdk, 'true'), eq(parameters.agentOs, 'Windows')) }}:
355-
- JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk\win-x64
356348
- ${{ if eq(parameters.codeSign, true) }}:
357349
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
358350
- _SignType: real
@@ -390,8 +382,8 @@ jobs:
390382
- script: df -h
391383
displayName: Disk size
392384
- ${{ if eq(parameters.agentOs, 'macOS') }}:
393-
- script: sudo xcode-select -s /Applications/Xcode_14.2.0.app/Contents/Developer
394-
displayName: Use XCode 14.2.0
385+
- script: sudo xcode-select -s /Applications/Xcode_15.2.0.app/Contents/Developer
386+
displayName: Use XCode 15.2.0
395387
- checkout: self
396388
clean: true
397389
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
@@ -404,14 +396,11 @@ jobs:
404396
displayName: Install Node 18.x
405397
inputs:
406398
versionSpec: 18.x
407-
- ${{ if and(eq(parameters.installJdk, 'true'), eq(parameters.agentOs, 'Windows')) }}:
408-
- powershell: ./eng/scripts/InstallJdk.ps1
409-
displayName: Install JDK 11
410-
- ${{ if eq(parameters.isAzDOTestingJob, true) }}:
411-
- powershell: |
412-
Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(Build.SourcesDirectory)\artifacts\tmp\selenium\"
413-
./eng/scripts/InstallGoogleChrome.ps1
414-
displayName: Install Chrome
399+
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.isAzDOTestingJob, true)) }}:
400+
- powershell: |
401+
Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(Build.SourcesDirectory)\artifacts\tmp\selenium\"
402+
./eng/scripts/InstallGoogleChrome.ps1
403+
displayName: Install Chrome
415404
- ${{ if eq(parameters.agentOs, 'Windows') }}:
416405
- powershell: Write-Host "##vso[task.prependpath]$(DOTNET_CLI_HOME)\.dotnet\tools"
417406
displayName: Add dotnet tools to path
@@ -472,7 +461,7 @@ jobs:
472461
${{ step.env }}
473462
- ${{ if eq(parameters.steps, '')}}:
474463
- ${{ if eq(parameters.agentOs, 'Windows') }}:
475-
- script: $(BuildDirectory)\build.cmd -ci -nobl -Configuration $(BuildConfiguration) $(BuildScriptArgs)
464+
- script: $(BuildDirectory)\build.cmd -ci -nativeToolsOnMachine -nobl -Configuration $(BuildConfiguration) $(BuildScriptArgs)
476465
/p:DotNetSignType=$(_SignType)
477466
displayName: Run build.cmd
478467
env:

eng/build.ps1

+70-52
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ build projects, run tests, and generate code.
1212
.PARAMETER CI
1313
Sets up CI specific settings and variables.
1414
15+
.PARAMETER NativeToolsOnMachine
16+
Turns on native tooling handling. On CI machines, promotes native tools listed in global.json to the path.
17+
1518
.PARAMETER Restore
1619
Run restore.
1720
@@ -121,6 +124,7 @@ Online version: https://github.com/dotnet/aspnetcore/blob/main/docs/BuildFromSou
121124
[CmdletBinding(PositionalBinding = $false, DefaultParameterSetName='Groups')]
122125
param(
123126
[switch]$CI,
127+
[switch]$NativeToolsOnMachine,
124128

125129
# Build lifecycle options
126130
[switch]$Restore,
@@ -304,58 +308,6 @@ $performDesktopBuild = ($BuildInstallers -and $Architecture -ne "arm") -or `
304308
$performDotnetBuild = $BuildJava -or $BuildManaged -or $BuildNodeJS -or `
305309
($All -and -not ($NoBuildJava -and $NoBuildManaged -and $NoBuildNodeJS)) -or `
306310
($Projects -and -not ($BuildInstallers -or $specifiedBuildNative))
307-
$foundJdk = $false
308-
$javac = Get-Command javac -ErrorAction Ignore -CommandType Application
309-
$localJdkPath = "$PSScriptRoot\..\.tools\jdk\win-x64\"
310-
if (Test-Path "$localJdkPath\bin\javac.exe") {
311-
$foundJdk = $true
312-
Write-Host -f Magenta "Detected JDK in $localJdkPath (via local repo convention)"
313-
$env:JAVA_HOME = $localJdkPath
314-
}
315-
elseif ($env:JAVA_HOME) {
316-
if (-not (Test-Path "${env:JAVA_HOME}\bin\javac.exe")) {
317-
Write-Error "The environment variable JAVA_HOME was set, but ${env:JAVA_HOME}\bin\javac.exe does not exist. Remove JAVA_HOME or update it to the correct location for the JDK. See https://www.bing.com/search?q=java_home for details."
318-
}
319-
else {
320-
Write-Host -f Magenta "Detected JDK in ${env:JAVA_HOME} (via JAVA_HOME)"
321-
$foundJdk = $true
322-
}
323-
}
324-
elseif ($javac) {
325-
$foundJdk = $true
326-
$javaHome = Split-Path -Parent (Split-Path -Parent $javac.Path)
327-
$env:JAVA_HOME = $javaHome
328-
Write-Host -f Magenta "Detected JDK in $javaHome (via PATH)"
329-
}
330-
else {
331-
try {
332-
$jdkRegistryKeys = @(
333-
"HKLM:\SOFTWARE\JavaSoft\JDK", # for JDK 10+
334-
"HKLM:\SOFTWARE\JavaSoft\Java Development Kit" # fallback for JDK 8
335-
)
336-
$jdkRegistryKey = $jdkRegistryKeys | Where-Object { Test-Path $_ } | Select-Object -First 1
337-
if ($jdkRegistryKey) {
338-
$jdkVersion = (Get-Item $jdkRegistryKey | Get-ItemProperty -name CurrentVersion).CurrentVersion
339-
$javaHome = (Get-Item $jdkRegistryKey\$jdkVersion | Get-ItemProperty -Name JavaHome).JavaHome
340-
if (Test-Path "${javaHome}\bin\javac.exe") {
341-
$env:JAVA_HOME = $javaHome
342-
Write-Host -f Magenta "Detected JDK $jdkVersion in $env:JAVA_HOME (via registry)"
343-
$foundJdk = $true
344-
}
345-
}
346-
}
347-
catch {
348-
Write-Verbose "Failed to detect Java: $_"
349-
}
350-
}
351-
352-
if ($env:PATH -notlike "*${env:JAVA_HOME}*") {
353-
$env:PATH = "$(Join-Path $env:JAVA_HOME bin);${env:PATH}"
354-
}
355-
356-
if (-not $foundJdk -and $RunBuild -and ($All -or $BuildJava) -and -not $NoBuildJava) {
357-
Write-Error "Could not find the JDK. Either run $PSScriptRoot\scripts\InstallJdk.ps1 to install for this repo, or install the JDK globally on your machine (see $PSScriptRoot\..\docs\BuildFromSource.md for details)."
358-
}
359311

360312
# Initialize global variables need to be set before the import of Arcade is imported
361313
$restore = $RunRestore
@@ -384,6 +336,61 @@ Remove-Item variable:global:_MSBuildExe -ea Ignore
384336
# Import Arcade
385337
. "$PSScriptRoot/common/tools.ps1"
386338

339+
function LocateJava {
340+
$foundJdk = $false
341+
$javac = Get-Command javac -ErrorAction Ignore -CommandType Application
342+
$localJdkPath = "$PSScriptRoot\..\.tools\jdk\win-x64\"
343+
if (Test-Path "$localJdkPath\bin\javac.exe") {
344+
$foundJdk = $true
345+
Write-Host -f Magenta "Detected JDK in $localJdkPath (via local repo convention)"
346+
$env:JAVA_HOME = $localJdkPath
347+
}
348+
elseif ($env:JAVA_HOME) {
349+
if (-not (Test-Path "${env:JAVA_HOME}\bin\javac.exe")) {
350+
Write-Error "The environment variable JAVA_HOME was set, but ${env:JAVA_HOME}\bin\javac.exe does not exist. Remove JAVA_HOME or update it to the correct location for the JDK. See https://www.bing.com/search?q=java_home for details."
351+
}
352+
else {
353+
Write-Host -f Magenta "Detected JDK in ${env:JAVA_HOME} (via JAVA_HOME)"
354+
$foundJdk = $true
355+
}
356+
}
357+
elseif ($javac) {
358+
$foundJdk = $true
359+
$javaHome = Split-Path -Parent (Split-Path -Parent $javac.Path)
360+
$env:JAVA_HOME = $javaHome
361+
Write-Host -f Magenta "Detected JDK in $javaHome (via PATH)"
362+
}
363+
else {
364+
try {
365+
$jdkRegistryKeys = @(
366+
"HKLM:\SOFTWARE\JavaSoft\JDK", # for JDK 10+
367+
"HKLM:\SOFTWARE\JavaSoft\Java Development Kit" # fallback for JDK 8
368+
)
369+
$jdkRegistryKey = $jdkRegistryKeys | Where-Object { Test-Path $_ } | Select-Object -First 1
370+
if ($jdkRegistryKey) {
371+
$jdkVersion = (Get-Item $jdkRegistryKey | Get-ItemProperty -name CurrentVersion).CurrentVersion
372+
$javaHome = (Get-Item $jdkRegistryKey\$jdkVersion | Get-ItemProperty -Name JavaHome).JavaHome
373+
if (Test-Path "${javaHome}\bin\javac.exe") {
374+
$env:JAVA_HOME = $javaHome
375+
Write-Host -f Magenta "Detected JDK $jdkVersion in $env:JAVA_HOME (via registry)"
376+
$foundJdk = $true
377+
}
378+
}
379+
}
380+
catch {
381+
Write-Verbose "Failed to detect Java: $_"
382+
}
383+
}
384+
385+
if ($env:PATH -notlike "*${env:JAVA_HOME}*") {
386+
$env:PATH = "$(Join-Path $env:JAVA_HOME bin);${env:PATH}"
387+
}
388+
389+
if (-not $foundJdk -and $RunBuild -and ($All -or $BuildJava) -and -not $NoBuildJava) {
390+
Write-Error "Could not find the JDK. Either run $PSScriptRoot\scripts\InstallJdk.ps1 to install for this repo, or install the JDK globally on your machine (see $PSScriptRoot\..\docs\BuildFromSource.md for details)."
391+
}
392+
}
393+
387394
# Add default .binlog location if not already on the command line. tools.ps1 does not handle this; it just checks
388395
# $BinaryLog, $CI and $ExcludeCIBinarylog values for an error case. But tools.ps1 provides a nice function to help.
389396
if ($BinaryLog) {
@@ -416,6 +423,17 @@ try {
416423
$tmpRestore = $restore
417424
$restore = $true
418425

426+
# Initialize the native tools before locating java.
427+
if ($NativeToolsOnMachine) {
428+
$env:NativeToolsOnMachine=$true
429+
# Do not promote native tools except in cases where -NativeToolsOnMachine is passed.
430+
# Currently the JDK is laid out in an incorrect pattern: https://github.com/dotnet/dnceng/issues/2185
431+
InitializeNativeTools
432+
}
433+
434+
# Locate java, now that we may have java available after initializing native tools.
435+
LocateJava
436+
419437
$toolsetBuildProj = InitializeToolset
420438

421439
$restore = $tmpRestore

eng/configure-toolset.sh

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
if [ "${DotNetBuildFromSource:-false}" = false ]; then
66
use_installed_dotnet_cli="false"
77
fi
8+
9+
# Working around issue https://github.com/dotnet/arcade/issues/2673
10+
DisableNativeToolsetInstalls=true

0 commit comments

Comments
 (0)