[PERF] Use script instead of powershell to set DOTNET_ROOT (#89123)
authorParker Bibus <parkerbibus@microsoft.com>
Wed, 19 Jul 2023 17:02:22 +0000 (10:02 -0700)
committerGitHub <noreply@github.com>
Wed, 19 Jul 2023 17:02:22 +0000 (10:02 -0700)
Use script for non-windows and powershell for windows.
Use the proper path separators for non-windows and windows.

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

index 9b8c937..4afea4b 100644 (file)
@@ -153,10 +153,17 @@ jobs:
     - script: cp -r $(PerformanceDirectory)/scripts $(WorkItemDirectory)/scripts/ && cp -r $(PerformanceDirectory)/src/scenarios/shared $(WorkItemDirectory)/shared/ && cp -r $(PerformanceDirectory)/src/scenarios/staticdeps/ $(WorkItemDirectory)/staticdeps/
       displayName: Copy scenario support files (Linux/MAC)
       condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
+    # Set DOTNET_ROOT
+    - script: |
+        echo "##vso[task.setvariable variable=DOTNET_ROOT;]$(PayloadDirectory)/dotnet"
+        echo "Set DOTNET_ROOT to $(PayloadDirectory)/dotnet"
+      displayName: Explicitly set DOTNET_ROOT (Non-Windows)
+      condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
     - powershell: |
-        Write-Host "##vso[task.setvariable variable=DOTNET_ROOT;]$(PayloadDirectory)/dotnet"
-        Write-Host "Set DOTNET_ROOT to $(PayloadDirectory)/dotnet"
-      displayName: Explicitly set DOTNET_ROOT
+        Write-Host "##vso[task.setvariable variable=DOTNET_ROOT;]$(PayloadDirectory)\dotnet"
+        Write-Host "Set DOTNET_ROOT to $(PayloadDirectory)\dotnet"
+      displayName: Explicitly set DOTNET_ROOT (Windows)
+      condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'))
     # build Startup
     - 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
       displayName: Build Startup tool (Windows)