Skip to content

Commit cf1482c

Browse files
authored
[PERF] Use script instead of powershell to set DOTNET_ROOT (#89123)
Use script for non-windows and powershell for windows. Use the proper path separators for non-windows and windows.
1 parent 8ce3424 commit cf1482c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

eng/pipelines/coreclr/templates/run-scenarios-job.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,17 @@ jobs:
153153
- script: cp -r $(PerformanceDirectory)/scripts $(WorkItemDirectory)/scripts/ && cp -r $(PerformanceDirectory)/src/scenarios/shared $(WorkItemDirectory)/shared/ && cp -r $(PerformanceDirectory)/src/scenarios/staticdeps/ $(WorkItemDirectory)/staticdeps/
154154
displayName: Copy scenario support files (Linux/MAC)
155155
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
156+
# Set DOTNET_ROOT
157+
- script: |
158+
echo "##vso[task.setvariable variable=DOTNET_ROOT;]$(PayloadDirectory)/dotnet"
159+
echo "Set DOTNET_ROOT to $(PayloadDirectory)/dotnet"
160+
displayName: Explicitly set DOTNET_ROOT (Non-Windows)
161+
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
156162
- powershell: |
157-
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT;]$(PayloadDirectory)/dotnet"
158-
Write-Host "Set DOTNET_ROOT to $(PayloadDirectory)/dotnet"
159-
displayName: Explicitly set DOTNET_ROOT
163+
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT;]$(PayloadDirectory)\dotnet"
164+
Write-Host "Set DOTNET_ROOT to $(PayloadDirectory)\dotnet"
165+
displayName: Explicitly set DOTNET_ROOT (Windows)
166+
condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'))
160167
# build Startup
161168
- script: $(PayloadDirectory)\dotnet\dotnet.exe publish -c Release -o $(WorkItemDirectory)\Startup -f net7.0 -r win-$(Architecture) $(PerformanceDirectory)\src\tools\ScenarioMeasurement\Startup\Startup.csproj -p:DisableTransitiveFrameworkReferenceDownloads=true
162169
displayName: Build Startup tool (Windows)

0 commit comments

Comments
 (0)