From 54054f3749a7ed1768cbe5cd305ee80aca9ea74e Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 17 Nov 2021 11:02:27 -0800 Subject: [PATCH 1/5] Actually use TargetOS=AnyOS in the build-test-job. Match the name that's used in the job title and enable us to use TargetOS to pre-filter OS-specific tests with the new Xunit test wrapper generator. --- eng/pipelines/common/templates/runtimes/build-test-job.yml | 4 ++-- src/tests/build.proj | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index 562b426eebc1f..0b71fd43aa5c7 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -135,7 +135,7 @@ jobs: displayName: Disk Usage before Build # Build managed test components - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)Managed allTargets skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(runtimeFlavorArgs) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)Managed allTargets skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(runtimeFlavorArgs) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) /p:RuntimeOS=$(parameters.osGroup)$(parameters.osSubgroup) /p:LibrariesTargetOSConfigurationArchitecture=$(parameters.osGroup)$(parameters.osSubgroup)-$(liveLibrariesBuildConfig)-$(parameters.archType) /p:TargetOS=AnyOS displayName: Build managed test components - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: @@ -147,7 +147,7 @@ jobs: # Zip and publish managed test components - template: /eng/pipelines/common/upload-artifact-step.yml parameters: - rootFolder: $(managedTestArtifactRootFolderPath) + rootFolder: '$(binTestsPath)/AnyOS.$(archType).$(buildConfigUpper)' includeRootFolder: false archiveExtension: '.tar.gz' archiveType: tar diff --git a/src/tests/build.proj b/src/tests/build.proj index 2c0489f0822ff..ebd3750108dc0 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -448,7 +448,9 @@ $(GroupBuildCmd) "/p:TargetArchitecture=$(TargetArchitecture)" $(GroupBuildCmd) "/p:Configuration=$(Configuration)" $(GroupBuildCmd) "/p:LibrariesConfiguration=$(LibrariesConfiguration)" + $(GroupBuildCmd) "/p:LibrariesTargetOSConfigurationArchitecture=$(LibrariesTargetOSConfigurationArchitecture)" $(GroupBuildCmd) "/p:TargetOS=$(TargetOS)" + $(GroupBuildCmd) "/p:RuntimeOS=$(RuntimeOS)" $(GroupBuildCmd) "/p:RuntimeFlavor=$(RuntimeFlavor)" $(GroupBuildCmd) "/p:RuntimeVariant=$(RuntimeVariant)" $(GroupBuildCmd) "/p:CLRTestBuildAllTargets=$(CLRTestBuildAllTargets)" @@ -456,6 +458,7 @@ $(GroupBuildCmd) "/p:__SkipRestorePackages=1" $(GroupBuildCmd) /nodeReuse:false $(GroupBuildCmd) /maxcpucount + $(GroupBuildCmd) /bl:$(ArtifactsDir)/log/$(Configuration)/InnerManagedTestBuild.$(__TestGroupToBuild).binlog From cb34e5c38022a4fa0aa027c888a2b6fdf08220dd Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 17 Nov 2021 11:37:00 -0800 Subject: [PATCH 2/5] Remove check that was explicitly blocking using AnyOS --- src/tests/build.proj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tests/build.proj b/src/tests/build.proj index ebd3750108dc0..715b75cd738be 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -392,8 +392,6 @@ - From 06c7b684decaaf5742ec171c6c078a01faca2354 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 17 Nov 2021 11:38:44 -0800 Subject: [PATCH 3/5] Use other method of templating to add commands --- eng/pipelines/common/templates/runtimes/build-test-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index 0b71fd43aa5c7..ed917e87f1e02 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -135,7 +135,7 @@ jobs: displayName: Disk Usage before Build # Build managed test components - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)Managed allTargets skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(runtimeFlavorArgs) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) /p:RuntimeOS=$(parameters.osGroup)$(parameters.osSubgroup) /p:LibrariesTargetOSConfigurationArchitecture=$(parameters.osGroup)$(parameters.osSubgroup)-$(liveLibrariesBuildConfig)-$(parameters.archType) /p:TargetOS=AnyOS + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)Managed allTargets skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(runtimeFlavorArgs) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) /p:RuntimeOS=${{ parameters.osGroup }}${{ parameters.osSubgroup }} /p:LibrariesTargetOSConfigurationArchitecture=${{ parameters.osGroup }}${{ parameters.osSubgroup }}-${{ liveLibrariesBuildConfig }}-${{ parameters.archType }} /p:TargetOS=AnyOS displayName: Build managed test components - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: From c4be43a4ad7b5dc1966e897ee780753047980e44 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 17 Nov 2021 14:08:54 -0800 Subject: [PATCH 4/5] Fix typo --- eng/pipelines/common/templates/runtimes/build-test-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index ed917e87f1e02..ac6c9b8c0850c 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -135,7 +135,7 @@ jobs: displayName: Disk Usage before Build # Build managed test components - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)Managed allTargets skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(runtimeFlavorArgs) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) /p:RuntimeOS=${{ parameters.osGroup }}${{ parameters.osSubgroup }} /p:LibrariesTargetOSConfigurationArchitecture=${{ parameters.osGroup }}${{ parameters.osSubgroup }}-${{ liveLibrariesBuildConfig }}-${{ parameters.archType }} /p:TargetOS=AnyOS + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)Managed allTargets skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(runtimeFlavorArgs) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) /p:RuntimeOS=${{ parameters.osGroup }}${{ parameters.osSubgroup }} /p:LibrariesTargetOSConfigurationArchitecture=${{ parameters.osGroup }}${{ parameters.osSubgroup }}-${{ parameters.liveLibrariesBuildConfig }}-${{ parameters.archType }} /p:TargetOS=AnyOS displayName: Build managed test components - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: From 1c40bfa022706e6ae5fb265c4c690e92ca7e133c Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 17 Nov 2021 15:55:29 -0800 Subject: [PATCH 5/5] Override the runtime artifacts path so Corelib can be found by the build. --- eng/pipelines/common/templates/runtimes/build-test-job.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index ac6c9b8c0850c..9c17307ed4720 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -89,9 +89,13 @@ jobs: - ${{ if eq(parameters.runtimeFlavor, 'coreclr') }}: - name: liveRuntimeBuildParams value: ${{ format('clr.corelib+libs.ref+libs.native -rc {0} -c {1} -arch {2} -ci', coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig), parameters.liveLibrariesBuildConfig, parameters.archType) }} + - name: liveRuntimeArtifactsPathArg + value: ${{ format('/p:CoreCLROverridePath={0}/artifacts/bin/coreclr/{1}{2}.{3}.{4}', $(Build.SourcesDirectory), parameters.osGroup, parameters.osSubgroup, parameters.archType, coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig)) }} - ${{ if eq(parameters.runtimeFlavor, 'mono') }}: - name: liveRuntimeBuildParams value: ${{ format('mono.corelib+libs.ref+libs.native -rc {0} -c {1} -arch {2} -ci', coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig), parameters.liveLibrariesBuildConfig, parameters.archType) }} + - name: liveRuntimeArtifactsPathArg + value: ${{ format('/p:MonoOverridePath={0}/artifacts/bin/mono/{1}{2}.{3}.{4}', $(Build.SourcesDirectory), parameters.osGroup, parameters.osSubgroup, parameters.archType, coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig)) }} - name: compilerArg value: '' - ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc')) }}: @@ -135,7 +139,7 @@ jobs: displayName: Disk Usage before Build # Build managed test components - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)Managed allTargets skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(runtimeFlavorArgs) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) /p:RuntimeOS=${{ parameters.osGroup }}${{ parameters.osSubgroup }} /p:LibrariesTargetOSConfigurationArchitecture=${{ parameters.osGroup }}${{ parameters.osSubgroup }}-${{ parameters.liveLibrariesBuildConfig }}-${{ parameters.archType }} /p:TargetOS=AnyOS + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)Managed allTargets skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(runtimeFlavorArgs) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) /p:RuntimeOS=${{ parameters.osGroup }}${{ parameters.osSubgroup }} /p:LibrariesTargetOSConfigurationArchitecture=${{ parameters.osGroup }}${{ parameters.osSubgroup }}-${{ parameters.liveLibrariesBuildConfig }}-${{ parameters.archType }} $(liveRuntimeArtifactsPathArg) /p:TargetOS=AnyOS displayName: Build managed test components - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: