diff --git a/eng/pipelines/coreclr/templates/build-test-job.yml b/eng/pipelines/coreclr/templates/build-test-job.yml index bb30b83e8c18b4..15f8668b8e9aa2 100644 --- a/eng/pipelines/coreclr/templates/build-test-job.yml +++ b/eng/pipelines/coreclr/templates/build-test-job.yml @@ -5,6 +5,14 @@ parameters: osSubgroup: '' container: '' testGroup: '' + + # When set to a non-empty value (Debug / Release), it determines libraries + # build configuration to use for the tests. Setting this property implies + # a dependency of this job on the appropriate libraries build and is used + # to construct the name of the Azure artifact representing libraries build + # to use for building the tests. + liveLibrariesBuildConfig: '' + displayNameArgs: '' condition: true stagedBuild: false @@ -31,6 +39,7 @@ jobs: container: ${{ parameters.container }} testGroup: ${{ parameters.testGroup }} stagedBuild: ${{ parameters.stagedBuild }} + liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} variables: ${{ parameters.variables }} pool: ${{ parameters.pool }} @@ -55,7 +64,11 @@ jobs: # because it needs System.Private.Corelib; we should be able to remove this dependency # by switching over to using reference assembly. ${{ if ne(parameters.stagedBuild, true) }}: - dependsOn: ${{ format('coreclr_product_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + dependsOn: + - ${{ format('coreclr_product_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', 'netcoreapp', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }} + ${{ if eq(parameters.testGroup, 'innerloop') }}: timeoutInMinutes: 90 @@ -75,6 +88,17 @@ jobs: displayName: Install native dependencies + # Optionally download live-built libraries + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(librariesDownloadDir) + cleanUnpackFolder: false + artifactFileName: '$(librariesArtifactName)$(archiveExtension)' + artifactName: '$(librariesArtifactName)' + displayName: 'live-built libraries' + + # Download product binaries directory - template: /eng/pipelines/common/download-artifact-step.yml parameters: @@ -85,7 +109,7 @@ jobs: # Build managed test components - - script: $(coreClrRepoRootDir)build-test$(scriptExt) skipnative skipgeneratelayout $(buildConfig) $(archType) $(crossArg) $(priorityArg) ci + - script: $(coreClrRepoRootDir)build-test$(scriptExt) skipnative skipgeneratelayout $(buildConfig) $(archType) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) displayName: Build managed test components diff --git a/eng/pipelines/coreclr/templates/run-test-job.yml b/eng/pipelines/coreclr/templates/run-test-job.yml index f65e2fa9da75da..bf854e1af11d11 100644 --- a/eng/pipelines/coreclr/templates/run-test-job.yml +++ b/eng/pipelines/coreclr/templates/run-test-job.yml @@ -9,10 +9,12 @@ parameters: testGroup: '' crossrootfsDir: '' readyToRun: false + liveLibrariesBuildConfig: '' crossgen2: false helixQueues: '' # If true, run the corefx tests instead of the coreclr ones corefxTests: false + condition: true stagedBuild: false displayNameArgs: '' runInUnloadableContext: false @@ -38,6 +40,7 @@ jobs: crossrootfsDir: ${{ parameters.crossrootfsDir }} corefxTests: ${{ parameters.corefxTests }} stagedBuild: ${{ parameters.stagedBuild }} + liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} helixType: 'build/tests/' pool: ${{ parameters.pool }} @@ -105,6 +108,17 @@ jobs: steps: + # Optionally download live-built libraries + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(librariesDownloadDir) + cleanUnpackFolder: false + artifactFileName: '$(librariesArtifactName)$(archiveExtension)' + artifactName: '$(librariesArtifactName)' + displayName: 'live-built libraries' + + # Download and unzip managed test artifacts - ${{ if ne(parameters.corefxTests, true) }}: - template: /eng/pipelines/common/download-artifact-step.yml @@ -151,19 +165,19 @@ jobs: # the native artifacts to the final test folders is dependent on availability of the # managed test artifacts. - ${{ if ne(parameters.corefxTests, true) }}: - - script: $(coreClrRepoRootDir)build-test$(scriptExt) copynativeonly $(buildConfig) $(archType) $(priorityArg) + - script: $(coreClrRepoRootDir)build-test$(scriptExt) copynativeonly $(buildConfig) $(archType) $(priorityArg) $(librariesOverrideArg) displayName: Copy native test components to test output folder # Generate test host - ${{ if eq(parameters.corefxTests, true) }}: - - script: $(coreClrRepoRootDir)build-test$(scriptExt) skipmanaged skipnative $(testhostArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) + - script: $(coreClrRepoRootDir)build-test$(scriptExt) skipmanaged skipnative $(testhostArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) displayName: Generate test host # Crossgen framework assemblies prior to triggering readyToRun execution runs. - ${{ if eq(parameters.readyToRun, true) }}: - - script: $(coreClrRepoRootDir)build-test$(scriptExt) skipmanaged skipnative $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) + - script: $(coreClrRepoRootDir)build-test$(scriptExt) skipmanaged skipnative $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) displayName: Crossgen framework assemblies diff --git a/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml b/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml index f642b79db0d645..b36cad5bf86bce 100644 --- a/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml +++ b/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml @@ -11,6 +11,7 @@ parameters: testGroup: '' crossrootfsDir: '' corefxTests: false + liveLibrariesBuildConfig: '' stagedBuild: false strategy: '' pool: '' @@ -103,6 +104,18 @@ jobs: - name: priorityArg value: '-priority=1' + - librariesArtifactName: '' + - librariesOverrideArg: '' + - librariesDownloadDir: '' + + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - librariesArtifactName: ${{ format('libraries_bin_{0}_{1}{2}_{3}_{4}', 'netcoreapp', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }} + - librariesDownloadDir: $(Build.SourcesDirectory)/artifacts + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - librariesOverrideArg: ' localcorefxpath $(Build.SourcesDirectory) localcorefxconfig ${{ parameters.liveLibrariesBuildConfig }}' + - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + - librariesOverrideArg: ' localcorefxpath=$(Build.SourcesDirectory) localcorefxconfig=${{ parameters.liveLibrariesBuildConfig }}' + - ${{ each variable in parameters.variables }}: - ${{insert}}: ${{ variable }} diff --git a/eng/pipelines/libraries/base-job.yml b/eng/pipelines/libraries/base-job.yml index e345b8973f81ff..cceb842179cb12 100644 --- a/eng/pipelines/libraries/base-job.yml +++ b/eng/pipelines/libraries/base-job.yml @@ -5,7 +5,9 @@ parameters: osSubgroup: '' framework: '' isOfficialBuild: false + liveCoreClrBuildConfig: '' timeoutInMinutes: 150 + condition: true container: '' steps: [] dependsOn: [] @@ -14,29 +16,31 @@ parameters: displayName: '' testScope: '' pool: '' - stepName: '' jobs: - template: /eng/common/templates/job/job.yml parameters: - name: ${{ format('libraries_{0}_{1}_{2}{3}_{4}_{5}', parameters.stepName, parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + name: ${{ format('libraries_{0}_{1}_{2}{3}_{4}_{5}', parameters.name, parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} ${{ if eq(parameters.framework, 'netcoreapp') }}: - displayName: ${{ format('{0} {1}{2} {3} {4}', parameters.stepName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + displayName: ${{ format('Libraries {0} {1}{2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} ${{ if ne(parameters.framework, 'netcoreapp') }}: - displayName: ${{ format('{0} {1} {2} {3} {4}', parameters.stepName, parameters.osGroup, parameters.framework, parameters.archType, parameters.buildConfig) }} + displayName: ${{ format('Libraries {0} {1} {2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.framework, parameters.archType, parameters.buildConfig) }} enableTelemetry: ${{ parameters.isOfficialBuild }} # TODO: figure out if it's needed container: ${{ parameters.container }} + condition: ${{ parameters.condition }} helixRepo: dotnet/runtime pool: ${{ parameters.pool }} variables: + - _buildScriptFileName: libraries - _BuildConfig: ${{ parameters.buildConfig }} + - _msbuildCommonParameters: '' - _stripSymbolsArg: '' - _runtimeOSArg: '' - _portableArg: '' - _finalFrameworkArg: -framework ${{ parameters.framework }} - - _buildScript: $(buildScriptFileName)$(scriptExt) + - _buildScript: $(_buildScriptFileName)$(scriptExt) - _warnAsErrorArg: '' - _testScopeArg: '' @@ -65,19 +69,26 @@ jobs: - ${{ if eq(parameters.isOfficialBuild, 'true') }}: - _msbuildCommonParameters: /p:OfficialBuildId=$(Build.BuildNumber) + - _coreClrArtifactName: '' + - _coreClrDownloadPath: '' + - _coreClrOverridePathArg: '' + + - ${{ if ne(parameters.liveCoreClrBuildConfig, '') }}: + - _coreClrDownloadPath: '$(Build.SourcesDirectory)/artifacts/transport/coreclr' + - _coreClrArtifactName: 'CoreCLRProduct_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveCoreClrBuildConfig }}' + - _coreClrOverridePathArg: ' /p:CoreCLROverridePath=$(_coreClrDownloadPath)' + # Windows variables - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - - _msbuildCommand: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 -warnaserror:0 -ci - _runtimeOSArg: /p:RuntimeOS=win10 # Non-Windows variables - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - - _msbuildCommand: ./eng/common/msbuild.sh --warnaserror false --ci - - _buildScript: ./$(buildScriptFileName)$(scriptExt) + - _buildScript: ./$(_buildScriptFileName)$(scriptExt) - ${{ if eq(parameters.isOfficialBuild, 'true') }}: - _stripSymbolsArg: -stripSymbols - - _buildArguments: -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_stripSymbolsArg) $(_testScopeArg) $(_warnAsErrorArg) $(_runtimeOSArg) $(_portableArg) $(_msbuildCommonParameters) + - _buildArguments: -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_stripSymbolsArg) $(_testScopeArg) $(_warnAsErrorArg) $(_runtimeOSArg) $(_portableArg) $(_msbuildCommonParameters) $(_coreClrOverridePathArg) - ${{ parameters.variables }} dependsOn: @@ -102,4 +113,12 @@ jobs: git remote set-url origin $(Build.Repository.Uri) displayName: Clone the repository from Checkout.bundle + - ${{ if ne(parameters.liveCoreClrBuildConfig, '') }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(_coreClrDownloadPath) + artifactFileName: '$(_coreClrArtifactName)$(archiveExtension)' + artifactName: '$(_coreClrArtifactName)' + displayName: 'CoreCLR build drop' + - ${{ parameters.steps }} diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml index 0ae7cc6093d34b..9e4bf1cc4d1e58 100644 --- a/eng/pipelines/libraries/build-job.yml +++ b/eng/pipelines/libraries/build-job.yml @@ -5,6 +5,14 @@ parameters: archType: '' framework: netcoreapp isOfficialBuild: false + + # When set to a non-empty value (Debug / Release), it determines CoreCLR + # build configuration to use for building libraries and tests. Setting this + # property implies a dependency of this job on the appropriate CoreCLR build + # and is used to construct the name of the Azure artifact representing + # CoreCLR build to use for building the libraries and library tests. + liveCoreClrBuildConfig: '' + timeoutInMinutes: 150 preBuildSteps: [] container: '' @@ -22,12 +30,18 @@ jobs: archType: ${{ parameters.archType }} framework: ${{ parameters.framework }} isOfficialBuild: ${{ parameters.isOfficialBuild }} + liveCoreClrBuildConfig: ${{ parameters.liveCoreClrBuildConfig }} timeoutInMinutes: ${{ parameters.timeoutInMinutes }} preBuildSteps: ${{ parameters.preBuildSteps }} container: ${{ parameters.container }} pool: ${{ parameters.pool }} testScope: ${{ parameters.testScope }} - stepName: Build + name: build + displayName: 'Build' + + ${{ if ne(parameters.liveCoreClrBuildConfig, '') }}: + dependsOn: + - ${{ format('coreclr_product_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveCoreClrBuildConfig) }} variables: - _skipTestRestoreArg: /p:SkipTestRestore=true @@ -40,6 +54,8 @@ jobs: - ${{ if ne(parameters.framework, 'allConfigurations') }}: - _skipTestRestoreArg: /p:SkipTestRestore=false + - ${{ parameters.variables }} + steps: - script: $(_buildScript) -restore $(_buildArguments) $(_skipTestRestoreArg) displayName: Restore diff --git a/eng/pipelines/libraries/build-test-job.yml b/eng/pipelines/libraries/build-test-job.yml index a847b40cf7e235..f7a91d45b97a06 100644 --- a/eng/pipelines/libraries/build-test-job.yml +++ b/eng/pipelines/libraries/build-test-job.yml @@ -5,12 +5,14 @@ parameters: archType: '' framework: netcoreapp isOfficialBuild: false + liveCoreClrBuildConfig: '' timeoutInMinutes: 150 container: '' publishTestArtifacs: true pool: '' testScope: '' variables: {} + condition: true runTests: false jobs: @@ -22,14 +24,17 @@ jobs: archType: ${{ parameters.archType }} framework: ${{ parameters.framework }} isOfficialBuild: ${{ parameters.isOfficialBuild }} + condition: ${{ parameters.condition }} + liveCoreClrBuildConfig: ${{ parameters.liveCoreClrBuildConfig }} timeoutInMinutes: ${{ parameters.timeoutInMinutes }} container: ${{ parameters.container }} pool: ${{ parameters.pool }} testScope: ${{ parameters.testScope }} - stepName: Test + name: test_build + displayName: 'Test Build' dependsOn: - - ${{ format('libraries_Build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + - ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} variables: - _archiveTestsParameter: /p:ArchiveTests=true @@ -44,6 +49,7 @@ jobs: artifactName: ${{ format('libraries_bin_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} artifactFileName: ${{ format('libraries_bin_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}$(archiveExtension) unpackFolder: $(Build.SourcesDirectory)/artifacts + cleanUnpackFolder: false - script: $(_buildScript) -restore $(_buildArguments) $(_skipTestRestoreArg) displayName: Restore diff --git a/eng/pipelines/libraries/helix.yml b/eng/pipelines/libraries/helix.yml index 4f5f2d28af3c45..945b51bfe72635 100644 --- a/eng/pipelines/libraries/helix.yml +++ b/eng/pipelines/libraries/helix.yml @@ -11,7 +11,7 @@ parameters: steps: - script: ${{ parameters.msbuildScript }} - $(sourcesRoot)/sendtohelix.proj + $(Build.SourcesDirectory)/src/libraries/sendtohelix.proj /t:test /p:ArchGroup=${{ parameters.archGroup }} /p:ConfigurationGroup=${{ parameters.configuration }} diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index d7b316af4e9555..b662732c9d906e 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -5,11 +5,13 @@ parameters: archType: '' framework: netcoreapp isOfficialBuild: false + liveCoreClrBuildConfig: '' timeoutInMinutes: 150 pool: '' testScope: '' helixQueues: [] dependsOnBuildConfiguration: Debug + condition: true variables: {} jobs: @@ -21,14 +23,17 @@ jobs: archType: ${{ parameters.archType }} framework: ${{ parameters.framework }} isOfficialBuild: ${{ parameters.isOfficialBuild }} + liveCoreClrBuildConfig: ${{ parameters.liveCoreClrBuildConfig }} timeoutInMinutes: ${{ parameters.timeoutInMinutes }} container: '' # we just send to helix, no need to use a container. + condition: ${{ parameters.condition }} pool: ${{ parameters.pool }} - stepName: Run + name: test_run + displayName: 'Test Run' dependsOn: - - ${{ format('libraries_Build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - - ${{ format('libraries_Test_{0}_{1}_x64_{2}', parameters.framework, parameters.osGroup, parameters.dependsOnBuildConfiguration) }} + - ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + - ${{ format('libraries_test_build_{0}_{1}_x64_{2}', parameters.framework, parameters.osGroup, parameters.dependsOnBuildConfiguration) }} variables: - _archiveTestsParameter: /p:ArchiveTests=true @@ -61,4 +66,4 @@ jobs: framework: ${{ parameters.framework }} testScope: ${{ parameters.testScope }} creator: dotnet-bot - helixToken: '' \ No newline at end of file + helixToken: '' diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml new file mode 100644 index 00000000000000..f1cdbe016181d3 --- /dev/null +++ b/eng/pipelines/runtime.yml @@ -0,0 +1,137 @@ +trigger: none + +pr: + branches: + include: + - master + - release/*.* + +jobs: +# +# Checkout repository +# +- template: /eng/pipelines/common/checkout-job.yml + +# +# Build CoreCLR +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml + buildConfig: checked + platforms: + - OSX_x64 + - Linux_x64 + - Linux_arm + - Windows_NT_x86 + - Windows_NT_x64 + - Windows_NT_arm + - Windows_NT_arm64 + jobParameters: + testGroup: innerloop + +# +# Build libraries using live CoreLib from CoreCLR +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/libraries/build-job.yml + buildConfig: Release + platforms: + - OSX_x64 + - Linux_x64 + - Linux_arm + - Windows_NT_x86 + - Windows_NT_x64 + - Windows_NT_arm + - Windows_NT_arm64 + jobParameters: + isOfficialBuild: false + liveCoreClrBuildConfig: checked + +# +# Test builds using live libraries build +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/build-test-job.yml + buildConfig: checked + platforms: + - OSX_x64 + - Linux_x64 + - Linux_arm + - Windows_NT_x86 + - Windows_NT_x64 + - Windows_NT_arm + - Windows_NT_arm64 + jobParameters: + testGroup: innerloop + liveLibrariesBuildConfig: Release + +# +# CoreCLR Test executions +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/run-test-job.yml + buildConfig: checked + platforms: + - OSX_x64 + - Linux_x64 + - Linux_arm + - Windows_NT_x86 + - Windows_NT_x64 + - Windows_NT_arm + - Windows_NT_arm64 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: innerloop + liveLibrariesBuildConfig: Release + condition: false + +# +# Libraries Test Build +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/libraries/build-test-job.yml + buildConfig: Release + platforms: + - OSX_x64 + - Linux_x64 + - Linux_arm + - Windows_NT_x86 + - Windows_NT_x64 + - Windows_NT_arm + - Windows_NT_arm64 + jobParameters: + isOfficialBuild: false + testScope: innerloop + liveCoreClrBuildConfig: checked + +# +# Libraries Test Execution +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/libraries/run-test-job.yml + buildConfig: Release + platforms: + - OSX_x64 + - Linux_x64 + - Linux_arm + - Windows_NT_x86 + - Windows_NT_x64 + - Windows_NT_arm + - Windows_NT_arm64 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + jobParameters: + isOfficialBuild: false + isFullMatrix: false + framework: netcoreapp + testScope: innerloop + liveCoreClrBuildConfig: checked + dependsOnBuildConfiguration: Release + condition: false diff --git a/src/coreclr/build-test.cmd b/src/coreclr/build-test.cmd index f126181d88b681..936fbfb3fc0901 100644 --- a/src/coreclr/build-test.cmd +++ b/src/coreclr/build-test.cmd @@ -60,6 +60,7 @@ set __CopyNativeTestBinaries=0 set __CopyNativeProjectsAfterCombinedTestBuild=true set __SkipGenerateLayout=0 set __LocalCoreFXPath= +set __LocalCoreFXConfig=%__BuildType% set __SkipFXRestoreArg= set __GenerateLayoutOnly=0 @@ -106,6 +107,7 @@ if /i "%1" == "-priority" (set __Priority=%2&shift&set processedArgs if /i "%1" == "copynativeonly" (set __CopyNativeTestBinaries=1&set __SkipNative=1&set __CopyNativeProjectsAfterCombinedTestBuild=false&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "skipgeneratelayout" (set __SkipGenerateLayout=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "localcorefxpath" (set __LocalCoreFXPath=%2&set __SkipFXRestoreArg=/p:__SkipFXRestore=true&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) +if /i "%1" == "localcorefxconfig" (set __LocalCoreFXConfig=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) if /i "%1" == "generatelayoutonly" (set __SkipManaged=1&set __SkipNative=1&set __CopyNativeProjectsAfterCombinedTestBuild=false&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "--" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) @@ -481,6 +483,8 @@ REM === The test host includes a dotnet executable, system libraries and CoreCLR REM === REM ========================================================================================= +if not "%__LocalCoreFXPath%" == "" goto SkipBuildingCoreFXTestHost + echo %__MsgPrefix%Building CoreFX test host set __BuildLogRootName=Tests_CoreFX_Testhost @@ -505,6 +509,8 @@ if errorlevel 1 ( exit /b 1 ) +:SkipBuildingCoreFXTestHost + REM ========================================================================================= REM === REM === Create test wrappers. @@ -576,9 +582,9 @@ REM === REM ========================================================================================= if NOT "%__LocalCoreFXPath%"=="" ( - echo Patch CoreFX from %__LocalCoreFXPath% + echo Patch CoreFX from %__LocalCoreFXPath% (%__LocalCoreFXConfig%) set NEXTCMD=python "%__ProjectDir%\tests\scripts\patch-corefx.py" -clr_core_root "%CORE_ROOT%"^ - -fx_root "%__LocalCoreFXPath%" -arch %__BuildArch% -build_type %__BuildType% + -fx_root "%__LocalCoreFXPath%" -arch %__BuildArch% -build_type %__LocalCoreFXConfig% echo !NEXTCMD! !NEXTCMD! ) diff --git a/src/coreclr/build-test.sh b/src/coreclr/build-test.sh index 3f0fc0634b5150..bd5a62064de8c0 100755 --- a/src/coreclr/build-test.sh +++ b/src/coreclr/build-test.sh @@ -134,9 +134,9 @@ generate_layout() patch_corefx_libraries() { - echo "${__MsgPrefix}Patching CORE_ROOT: '${CORE_ROOT}' with CoreFX libaries from enlistment '${__LocalCoreFXPath}" + echo "${__MsgPrefix}Patching CORE_ROOT: '${CORE_ROOT}' with CoreFX libaries from enlistment '${__LocalCoreFXPath} (${__LocalCoreFXConfig})" - patchCoreFXArguments=("-clr_core_root" "${CORE_ROOT}" "-fx_root" "${__LocalCoreFXPath}" "-arch" "${__BuildArch}" "-build_type" "${__BuildType}") + patchCoreFXArguments=("-clr_core_root" "${CORE_ROOT}" "-fx_root" "${__LocalCoreFXPath}" "-arch" "${__BuildArch}" "-build_type" "${__LocalCoreFXConfig}") scriptPath="$__ProjectDir/tests/scripts" echo "python ${scriptPath}/patch-corefx.py ${patchCoreFXArguments[@]}" $__Python "${scriptPath}/patch-corefx.py" "${patchCoreFXArguments[@]}" @@ -371,10 +371,10 @@ build_Tests() if [ $__SkipGenerateLayout != 1 ]; then generate_layout - fi - if [ ! -z "$__LocalCoreFXPath" ]; then - patch_corefx_libraries + if [ ! -z "$__LocalCoreFXPath" ]; then + patch_corefx_libraries + fi fi } @@ -630,14 +630,12 @@ handle_arguments() { __SkipGenerateLayout=1 ;; - localcorefxpath) - if [ -n "$2" ]; then - __LocalCoreFXPath="$2" - shift - else - echo "ERROR: 'localcorefxpath' requires a non-empty option argument" - exit 1 - fi + localcorefxpath=*|-localcorefxpath=*) + __LocalCoreFXPath=$(echo "$1" | cut -d'=' -f 2) + ;; + + localcorefxconfig=*|-localcorefxconfig=*) + __LocalCoreFXConfig=$(echo "$1" | cut -d'=' -f 2) ;; *) @@ -686,6 +684,8 @@ __SkipRestore="" __SkipRestorePackages=0 __SourceDir="$__ProjectDir/src" __UnprocessedBuildArgs= +__LocalCoreFXPath= +__LocalCoreFXConfig=${__BuildType} __UseNinja=0 __VerboseBuild=0 __cmakeargs="" diff --git a/src/coreclr/tests/scripts/patch-corefx.py b/src/coreclr/tests/scripts/patch-corefx.py old mode 100644 new mode 100755 index bbc44c1af07737..54dd929892e4c1 --- a/src/coreclr/tests/scripts/patch-corefx.py +++ b/src/coreclr/tests/scripts/patch-corefx.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # # Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the MIT license. @@ -239,7 +239,7 @@ def main(args): clr_os = 'Windows_NT' if Is_windows else Unix_name_map[os.uname()[0]] if not os.path.exists(clr_core_root): - raise Exception('Core root path %s does not exist.' % (core_root)) + raise Exception('Core root path %s does not exist.' % (clr_core_root)) fx_bin = os.path.join(fx_root, 'artifacts', @@ -248,7 +248,7 @@ def main(args): 'netcoreapp-%s-%s-%s' % (clr_os, build_type, arch)) if not os.path.exists(fx_bin): - raise Exception('CoreFX bin path %s does not exist.' % (core_root)) + raise Exception('CoreFX bin path %s does not exist.' % (fx_bin)) patch_coreclr_root(clr_core_root, fx_bin)