-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add support for building S.P.CoreLib in a separate job #34166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
74cb414
def5d70
fc99faa
de8f012
34a19e8
eb1ee34
478b77f
a6a2a3b
fbfb35e
46efc4d
4fb3931
57b5d81
6436fb6
0683d82
f21a514
19e6701
6b73ed5
bb09589
2ec1f5a
77dfbcf
e6d4882
afe6717
a082f9c
fec325d
dfef8c3
2e4d00a
42dfd0d
56bf4c0
18e5190
e76db3a
e3c15b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| parameters: | ||
| archType: '' | ||
| buildConfig: '' | ||
| condition: true | ||
| container: '' | ||
| crossrootfsDir: '' | ||
| isOfficialBuild: false | ||
| osGroup: '' | ||
| osSubgroup: '' | ||
| platform: '' | ||
| pool: '' | ||
| signBinaries: false | ||
| stagedBuild: false | ||
| testGroup: '' | ||
| timeoutInMinutes: '' | ||
| variables: {} | ||
|
|
||
| ### Product build | ||
| jobs: | ||
| - template: xplat-pipeline-job.yml | ||
| parameters: | ||
| buildConfig: ${{ parameters.buildConfig }} | ||
| _BuildConfig: ${{ parameters.buildConfig }} | ||
| archType: ${{ parameters.archType }} | ||
| osGroup: ${{ parameters.osGroup }} | ||
| osSubgroup: ${{ parameters.osSubgroup }} | ||
| testGroup: ${{ parameters.testGroup }} | ||
| helixType: 'build/product/' | ||
| enableMicrobuild: true | ||
| stagedBuild: ${{ parameters.stagedBuild }} | ||
| pool: ${{ parameters.pool }} | ||
| condition: ${{ parameters.condition }} | ||
|
|
||
| name: ${{ format('coreclr_corelib_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} | ||
| displayName: ${{ format('CoreCLR CoreLib Build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} | ||
|
|
||
| # Run all steps in the container. | ||
| # Note that the containers are defined in platform-matrix.yml | ||
| container: ${{ parameters.container }} | ||
|
|
||
| timeoutInMinutes: ${{ parameters.timeoutInMinutes }} | ||
|
|
||
| crossrootfsDir: ${{ parameters.crossrootfsDir }} | ||
|
|
||
| gatherAssetManifests: true | ||
| variables: | ||
| - name: osGroup | ||
| value: ${{ parameters.osGroup }} | ||
| - name: osSubgroup | ||
| value: ${{ parameters.osSubgroup }} | ||
| - name: compilerArg | ||
| value: '' | ||
| - name: publishLogsArtifactPrefix | ||
| value: 'BuildLogs_CoreLib' | ||
| - name: officialBuildIdArg | ||
| value: '' | ||
| - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: | ||
| - name: officialBuildIdArg | ||
| value: '/p:OfficialBuildId=$(Build.BuildNumber)' | ||
|
|
||
| - ${{ parameters.variables }} | ||
|
|
||
| steps: | ||
|
|
||
| # Install native dependencies | ||
mangod9 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Linux builds use docker images with dependencies preinstalled, | ||
| # and FreeBSD builds use a build agent with dependencies | ||
| # preinstalled, so we only need this step for OSX and Windows. | ||
| - ${{ if eq(parameters.osGroup, 'OSX') }}: | ||
| - script: sh $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) | ||
| displayName: Install native dependencies | ||
| - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: | ||
| # Necessary to install python | ||
| - script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force | ||
| displayName: Install native dependencies | ||
|
|
||
| # # Install internal tools on official builds | ||
| # # Since our internal tools are behind an authenticated feed, | ||
| # # we need to use the DotNetCli AzDO task to restore from the feed using a service connection. | ||
| # # We can't do this from within the build, so we need to do this as a separate step. | ||
| - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: | ||
| - template: /eng/pipelines/common/restore-internal-tools.yml | ||
| parameters: | ||
| installDotnet: true | ||
|
|
||
| # Build Private CoreLib | ||
| - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subsetCategory coreclr -subset corelib $(crossArg) -arch $(archType) -c $(buildConfig) $(officialBuildIdArg) -ci | ||
mangod9 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| displayName: Build System.Private.CoreLib | ||
|
|
||
|
|
||
| # Publish corelib output directory for consumption by libraries. | ||
| - template: /eng/pipelines/common/upload-artifact-step.yml | ||
| parameters: | ||
| rootFolder: $(buildProductRootFolderPath) | ||
| includeRootFolder: false | ||
| archiveType: $(archiveType) | ||
| tarCompression: $(tarCompression) | ||
| archiveExtension: $(archiveExtension) | ||
| artifactName: $(corelibProductArtifactName) | ||
| displayName: Upload System.Private.CoreLib | ||
|
|
||
| # Publish Logs | ||
| - task: PublishPipelineArtifact@1 | ||
| displayName: Publish Logs | ||
| inputs: | ||
| targetPath: $(Build.SourcesDirectory)/artifacts/log | ||
| artifactName: '$(publishLogsArtifactPrefix)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' | ||
| continueOnError: true | ||
| condition: always() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ jobs: | |
| isOfficialBuild: ${{ parameters.isOfficialBuild }} | ||
| isOfficialAllConfigurations: ${{ parameters.isOfficialAllConfigurations }} | ||
| liveRuntimeBuildConfig: ${{ parameters.liveRuntimeBuildConfig }} | ||
| runtimeFlavor: ${{ parameters.runtimeFlavor }} | ||
| timeoutInMinutes: ${{ parameters.timeoutInMinutes }} | ||
| preBuildSteps: ${{ parameters.preBuildSteps }} | ||
| container: ${{ parameters.container }} | ||
|
|
@@ -49,7 +50,11 @@ jobs: | |
| ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: | ||
| dependsOn: | ||
| - ${{ if ne(parameters.osGroup, 'WebAssembly') }}: | ||
| - ${{ format('{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeFlavor, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }} | ||
| # Use corelib dependencies for coreclr and non test builds | ||
| - ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.testScope, '')) }}: | ||
| - ${{ format('coreclr_corelib_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }} | ||
| - ${{ if or(ne(parameters.runtimeFlavor, 'coreclr'), ne(parameters.testScope, '')) }}: | ||
| - ${{ format('{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeFlavor, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }} | ||
| - ${{ if eq(parameters.osGroup, 'WebAssembly') }}: | ||
| - ${{ format('{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeFlavor, 'linux', parameters.osSubgroup, 'x64', parameters.liveRuntimeBuildConfig) }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WebAssembly is still depending on the full coreclr build. We should be able to also make it build against corelib by doing something similare as above.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup will do as a subsequent PR.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are now included in this PR: #34460 |
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ parameters: | |
| framework: '' | ||
| isOfficialBuild: false | ||
| liveRuntimeBuildConfig: '' | ||
| runtimeFlavor: 'coreclr' | ||
| timeoutInMinutes: 150 | ||
| container: '' | ||
| publishTestArtifacs: true | ||
|
|
@@ -38,6 +39,9 @@ jobs: | |
| - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} | ||
| - ${{ if in(parameters.framework, 'allConfigurations', 'net472') }}: | ||
| - ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} | ||
| # Libraries Test also depends on Product, now that the libraries build only depends on corelib | ||
| - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: | ||
| - ${{ format('{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeFlavor, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disregard, - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
# Libraries Test also depends on Product, now that the libraries build only depends on corelib
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- ${{ format('{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeFlavor, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok will do as a subsequent PR.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are now included in this PR: #34460 |
||
|
|
||
| variables: | ||
| - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.archType, parameters.buildConfig) }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,8 @@ | |
| Projects="@(Project)" | ||
| Properties="TargetFramework=$(BuildTargetFramework);%(Project.AdditionalProperties)" | ||
| BuildInParallel="true" | ||
| ContinueOnError="ErrorAndStop" /> | ||
| ContinueOnError="ErrorAndStop" | ||
| Condition="'$(SkipBuildProjects)' != 'true'"/> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about instead directly invoking pretest.proj from CI and passing in the target that you care about?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that makes sense. We could just call change the current call to /t: GenerateTestSharedFrameworkDepsFile. Maybe on a follow-up PR so that he can merge?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I'm fine with that.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok will do on next PR. |
||
|
|
||
| <!-- Given we ErrorAndContinue we need to propagate the error if the overall task failed --> | ||
| <Error Condition="'$(MSBuildLastTaskResult)' == 'false'" /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,8 +41,19 @@ | |
| <Import Project="$(RepositoryEngineeringDir)coverage.targets" Condition="'$(EnableCoverageSupport)' == 'true'" /> | ||
| <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" /> | ||
|
|
||
| <ItemGroup> | ||
| <SetupProjects Include="$(MSBuildThisFileDirectory)restore\runtime\runtime.depproj" /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is CI only, why not directly invoking the runtime.depproj before tests.proj?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one issue is that build parallelization might cause a race, pretest.proj has to complete before tests start to build, since pretest generates the dep file to ensure testhost is setup correctly.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not following. You can do two steps before the test build so the sequence would be:
Noteworthy, if you would wait until Monday, we could just invoke the lib-pretest lib-tests subsets which would handle all that for you. I plan to merge this on Monday (if ready) which introduces the libraries subsets #33553.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ideally want to merge this tomorrow, since this PR touches a bunch of infra pieces. I can commit to reworking this once your PR is merged.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No problem at all, I can make the changes afterwards. |
||
| <SetupProjects Include="$(MSBuildThisFileDirectory)\pretest.proj" /> | ||
| </ItemGroup> | ||
|
|
||
| <Target Name="Build" DependsOnTargets="BuildAllProjects" /> | ||
| <Target Name="BuildAllProjects"> | ||
| <!-- These projects are required to restore the runtime and setup testhost --> | ||
| <MSBuild Targets="Build" | ||
| Projects="@(SetupProjects)" | ||
| Condition="'$(DotNetBuildFromSource)' != 'true' and '$(BuildAllConfigurations)' != 'true' and '$(ContinuousIntegrationBuild)' == 'true'" | ||
| BuildInParallel="false" | ||
| ContinueOnError="ErrorAndStop" /> | ||
| <MSBuild Targets="Build" | ||
| Projects="@(Project)" | ||
| Properties="BuildAllProjects=true;%(Project.AdditionalProperties)" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.