From 8b2df416233bec4b9526409640d369b2661c7603 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 29 Mar 2022 17:36:55 -0400 Subject: [PATCH 1/3] [xtro] Fix xtro on dotnet. --- tests/xtro-sharpie/Makefile | 4 ++++ tools/devops/automation/templates/build/build.yml | 3 +++ tools/devops/automation/templates/tests/stage.yml | 2 ++ 3 files changed, 9 insertions(+) diff --git a/tests/xtro-sharpie/Makefile b/tests/xtro-sharpie/Makefile index 3b8f99aa1980..df47a754c47b 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)/$(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 36d0e61f950f..ccb07850b795 100644 --- a/tools/devops/automation/templates/build/build.yml +++ b/tools/devops/automation/templates/build/build.yml @@ -393,6 +393,9 @@ steps: echo "Rollback file contents:" echo "$(cat $WORKLOAD_DST)" + + echo "##vso[task.setvariable variable=WorkloadVersion;]$IOS_NUGET_VERSION_FULL" + name: workload_file displayName: 'Generate "WorkloadRollback.json' # upload each of the pkgs into the pipeline artifacts diff --git a/tools/devops/automation/templates/tests/stage.yml b/tools/devops/automation/templates/tests/stage.yml index eac68a4fe144..3d1fa7bcc075 100644 --- a/tools/devops/automation/templates/tests/stage.yml +++ b/tools/devops/automation/templates/tests/stage.yml @@ -74,6 +74,8 @@ stages: # we need to have the pkgs built and the device sets to be ran, that is decided via the labels or type of build during the build_packages stage condition: and(succeeded(), ${{ parameters.condition }}) + variables: + WORKLOAD_VERSION: $[ stageDependencies.build_packages.build.outputs['workload_file.WorkloadVersion'] ] jobs: - ${{ if eq(parameters.testPool, '') }}: - job: AgentPoolSelector # https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml From 3060f151d8c3adcdb4097247db55d5751d7aad1a Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 30 Mar 2022 09:14:23 -0400 Subject: [PATCH 2/3] Use the workload json as the source of the versions and use a var per platform. --- tests/xtro-sharpie/Makefile | 2 +- .../devops/automation/templates/build/build.yml | 2 -- .../automation/templates/tests/run-tests.yml | 17 +++++++++++++++++ .../devops/automation/templates/tests/stage.yml | 2 -- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/xtro-sharpie/Makefile b/tests/xtro-sharpie/Makefile index df47a754c47b..4cc1fe101f8c 100644 --- a/tests/xtro-sharpie/Makefile +++ b/tests/xtro-sharpie/Makefile @@ -127,7 +127,7 @@ $(XMACCATALYST_PCH): .stamp-check-sharpie define DotNetAssembly ifdef TESTS_USE_SYSTEM -X$(2)_DOTNET ?= $(DOTNET_DIR)/packs/Microsoft.$(1).Runtime.$(X$(2)_RID)/$(WORKLOAD_VERSION)/runtimes/$(X$(2)_RID)/lib/$(DOTNET_TFM)/$(DOTNET_$(2)_ASSEMBLY_NAME).dll +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 diff --git a/tools/devops/automation/templates/build/build.yml b/tools/devops/automation/templates/build/build.yml index ccb07850b795..af53d8f12244 100644 --- a/tools/devops/automation/templates/build/build.yml +++ b/tools/devops/automation/templates/build/build.yml @@ -393,8 +393,6 @@ steps: echo "Rollback file contents:" echo "$(cat $WORKLOAD_DST)" - - echo "##vso[task.setvariable variable=WorkloadVersion;]$IOS_NUGET_VERSION_FULL" name: workload_file displayName: 'Generate "WorkloadRollback.json' diff --git a/tools/devops/automation/templates/tests/run-tests.yml b/tools/devops/automation/templates/tests/run-tests.yml index efdbdd01a944..171eddbc52ce 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: Boostrap 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 what 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 diff --git a/tools/devops/automation/templates/tests/stage.yml b/tools/devops/automation/templates/tests/stage.yml index 3d1fa7bcc075..eac68a4fe144 100644 --- a/tools/devops/automation/templates/tests/stage.yml +++ b/tools/devops/automation/templates/tests/stage.yml @@ -74,8 +74,6 @@ stages: # we need to have the pkgs built and the device sets to be ran, that is decided via the labels or type of build during the build_packages stage condition: and(succeeded(), ${{ parameters.condition }}) - variables: - WORKLOAD_VERSION: $[ stageDependencies.build_packages.build.outputs['workload_file.WorkloadVersion'] ] jobs: - ${{ if eq(parameters.testPool, '') }}: - job: AgentPoolSelector # https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml From 7d7e4ef9539b037f5404bd2f4fc59096c36cc1fc Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 30 Mar 2022 09:18:52 -0400 Subject: [PATCH 3/3] Update tools/devops/automation/templates/tests/run-tests.yml --- tools/devops/automation/templates/tests/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/devops/automation/templates/tests/run-tests.yml b/tools/devops/automation/templates/tests/run-tests.yml index 171eddbc52ce..9ada86a772a0 100644 --- a/tools/devops/automation/templates/tests/run-tests.yml +++ b/tools/devops/automation/templates/tests/run-tests.yml @@ -103,7 +103,7 @@ steps: - 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 what to be smart just yet + # 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"