From e5b8b196f742ca2877e5323eccdf23dfc93a017c Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 30 Mar 2022 11:32:25 -0400 Subject: [PATCH] [xtro] Fix xtro on dotnet. (#14559) Use the workloads versions to point to the correct dll path when running in a diff bot than the one were the build was done. --- tests/xtro-sharpie/Makefile | 4 ++++ .../devops/automation/templates/build/build.yml | 1 + .../automation/templates/tests/run-tests.yml | 17 +++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/tests/xtro-sharpie/Makefile b/tests/xtro-sharpie/Makefile index 3b8f99aa19..4cc1fe101f 100644 --- a/tests/xtro-sharpie/Makefile +++ b/tests/xtro-sharpie/Makefile @@ -126,7 +126,11 @@ $(XMACCATALYST_PCH): .stamp-check-sharpie $(CORETELEPHONY_HEADERS) \ define DotNetAssembly +ifdef TESTS_USE_SYSTEM +X$(2)_DOTNET ?= $(DOTNET_DIR)/packs/Microsoft.$(1).Runtime.$(X$(2)_RID)/$($(2)_WORKLOAD_VERSION)/runtimes/$(X$(2)_RID)/lib/$(DOTNET_TFM)/$(DOTNET_$(2)_ASSEMBLY_NAME).dll +else X$(2)_DOTNET ?= $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(X$(2)_RID)/runtimes/$(X$(2)_RID)/lib/$(DOTNET_TFM)/$(DOTNET_$(2)_ASSEMBLY_NAME).dll +endif dotnet-$(1)-$($(2)_SDK_VERSION).g.cs: .stamp-check-sharpie $$(SHARPIE) query -bind $$(X$(2)_PCH) > $$@ diff --git a/tools/devops/automation/templates/build/build.yml b/tools/devops/automation/templates/build/build.yml index 36d0e61f95..af53d8f122 100644 --- a/tools/devops/automation/templates/build/build.yml +++ b/tools/devops/automation/templates/build/build.yml @@ -393,6 +393,7 @@ steps: echo "Rollback file contents:" echo "$(cat $WORKLOAD_DST)" + name: workload_file displayName: 'Generate "WorkloadRollback.json' # upload each of the pkgs into the pipeline artifacts diff --git a/tools/devops/automation/templates/tests/run-tests.yml b/tools/devops/automation/templates/tests/run-tests.yml index 00786f8754..85b5f709d0 100644 --- a/tools/devops/automation/templates/tests/run-tests.yml +++ b/tools/devops/automation/templates/tests/run-tests.yml @@ -100,6 +100,23 @@ steps: displayName: Bootstrap dotnet timeoutInMinutes: 30 +- pwsh: | + $workloadPath = "$(Build.SourcesDirectory)/artifacts/package-internal/WorkloadRollback.json" + $versionData = Get-Content $workloadPath | ConvertFrom-Json + # could be done in a loop, but we don't want to be smart just yet + $iOSVersion = $versionData | Select-Object -ExpandProperty "microsoft.net.sdk.ios" + Write-Host "##vso[task.setvariable variable=IOS_WORKLOAD_VERSION;]$iOSVersion" + + $tvOSVersion = $versionData | Select-Object -ExpandProperty "microsoft.net.sdk.tvos" + Write-Host "##vso[task.setvariable variable=TVOS_WORKLOAD_VERSION;]$tvOSVersion" + + $macVersion = $versionData | Select-Object -ExpandProperty "microsoft.net.sdk.macos" + Write-Host "##vso[task.setvariable variable=MACOS_WORKLOAD_VERSION;]$macVersion" + + $catalystVersion = $versionData | Select-Object -ExpandProperty "microsoft.net.sdk.maccatalyst" + Write-Host "##vso[task.setvariable variable=MACCATALYST_WORKLOAD_VERSION;]$catalystVersion" + displayName: 'Set workload versions for xtro' + - bash: | set -x set -e