Skip to content
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

Add support for building S.P.CoreLib in a separate job #34166

Merged
merged 31 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
74cb414
Add support for building S.P.CoreLib in a separate job
mangod9 Mar 26, 2020
def5d70
PR Comments.
mangod9 Mar 27, 2020
fc99faa
fix deletion typo
mangod9 Mar 27, 2020
de8f012
Adding step to upload output directory.
mangod9 Mar 27, 2020
34a19e8
update libraries job to depend on corelib instead of product
mangod9 Mar 27, 2020
eb1ee34
reverting libraries dependency change
mangod9 Mar 27, 2020
478b77f
Add OSX and musl_arm64 corelib builds + use full product for mono
mangod9 Mar 28, 2020
a6a2a3b
Another attempt to fix mono iOS case
mangod9 Mar 28, 2020
fbfb35e
propagating runtimeFlavor to libraries base-job.yml
mangod9 Mar 28, 2020
46efc4d
updating DependsOn for libraries job to use corelib
mangod9 Mar 28, 2020
4fb3931
Merge remote-tracking branch 'upstream/master'
mangod9 Mar 28, 2020
57b5d81
Make LIbraries Test Build also depend on Product
mangod9 Mar 28, 2020
6436fb6
download product dependency when testScope is not null
mangod9 Mar 28, 2020
0683d82
reverting a change which is not required
mangod9 Mar 28, 2020
f21a514
Adding runtime.depproj to libraries restore, and pretest.proj to test…
mangod9 Mar 30, 2020
19e6701
Fixing run_test_job to download product artifact
mangod9 Mar 30, 2020
6b73ed5
run pretest.proj on test runs as well.
mangod9 Mar 30, 2020
bb09589
Add libraries -restore to test run
mangod9 Mar 30, 2020
2ec1f5a
Updating pretest to use TargetArchitecture
mangod9 Mar 30, 2020
77dfbcf
Merge remote-tracking branch 'upstream/master'
mangod9 Mar 30, 2020
e6d4882
Moving runtime restore from \restore\dirs.proj
mangod9 Mar 31, 2020
afe6717
fix -allConfigurations build
mangod9 Mar 31, 2020
a082f9c
Adding corelib job to coreclr=and=Libraries.
mangod9 Mar 31, 2020
fec325d
Add corelib to other pipelines.
mangod9 Mar 31, 2020
dfef8c3
libraries test should depend on full product
mangod9 Mar 31, 2020
2e4d00a
remove upload unsigned artifacts step from official build
mangod9 Mar 31, 2020
42dfd0d
Merge remote-tracking branch 'upstream/master'
mangod9 Apr 1, 2020
56bf4c0
PR Comments
mangod9 Apr 1, 2020
18e5190
typo fix :(
mangod9 Apr 1, 2020
e76db3a
Fix run-test-job pretest build
mangod9 Apr 2, 2020
e3c15b0
removed some unused corelib configs.
mangod9 Apr 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions eng/pipelines/common/build-coreclr-and-libraries-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ parameters:
pool: ''

jobs:
- template: /eng/pipelines/coreclr/templates/build-corelib-job.yml
parameters:
buildConfig: ${{ parameters.buildConfig }}
archType: ${{ parameters.archType }}
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup }}
container: ${{ parameters.container }}
testGroup: ${{ parameters.testGroup }}
crossrootfsDir: ${{ parameters.crossrootfsDir }}
timeoutInminutes: ${{ parameters.timeoutInMinutes }}
signBinaries: ${{ parameters.signBinaries }}
stagedBuild: ${{ parameters.stagedBuild }}
variables: ${{ parameters.variables }}
pool: ${{ parameters.pool }}

- template: /eng/pipelines/coreclr/templates/build-job.yml
parameters:
buildConfig: ${{ parameters.buildConfig }}
Expand Down
11 changes: 11 additions & 0 deletions eng/pipelines/coreclr/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ jobs:
#
- template: /eng/pipelines/common/checkout-job.yml

#
# Checked Corelib builds
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/build-corelib-job.yml
buildConfig: checked
platformGroup: all
jobParameters:
testGroup: outerloop

#
# Debug builds
#
Expand Down
109 changes: 109 additions & 0 deletions eng/pipelines/coreclr/templates/build-corelib-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
parameters:
archType: ''
buildConfig: ''
condition: true
container: ''
crossrootfsDir: ''
mangod9 marked this conversation as resolved.
Show resolved Hide resolved
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()
3 changes: 3 additions & 0 deletions eng/pipelines/coreclr/templates/xplat-pipeline-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
- name: buildProductRootFolderPath
value: '$(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).$(archType).$(buildConfigUpper)'

- name: corelibProductArtifactName
mangod9 marked this conversation as resolved.
Show resolved Hide resolved
value: 'CoreLib_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)'

- name: managedTestArtifactName
value: 'CoreCLRManagedTestArtifacts_${{ parameters.managedTestBuildOsGroup }}${{ parameters.managedTestBuildOsSubgroup }}_$(archType)_$(buildConfig)'

Expand Down
7 changes: 6 additions & 1 deletion eng/pipelines/libraries/base-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ jobs:

- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- _runtimeDownloadPath: '$(Build.SourcesDirectory)/artifacts/transport/${{ parameters.runtimeFlavor }}'
- _runtimeArtifactName: '$(runtimeFlavorName)Product_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveRuntimeBuildConfig }}'
mangod9 marked this conversation as resolved.
Show resolved Hide resolved
# Download corelib dependencies for coreclr libraries and not test
- ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.testScope, '')) }}:
- _runtimeArtifactName: 'CoreLib_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveRuntimeBuildConfig }}'
mangod9 marked this conversation as resolved.
Show resolved Hide resolved
# Download full product dependencies for mono or test
- ${{ if or(ne(parameters.runtimeFlavor, 'coreclr'), ne(parameters.testScope, '')) }}:
- _runtimeArtifactName: '$(runtimeFlavorName)Product_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveRuntimeBuildConfig }}'
- _runtimeArtifactsPathArg: ' /p:RuntimeArtifactsPath=$(_runtimeDownloadPath)'
- _testRunNamePrefixSuffix: $(runtimeFlavorName)_${{ parameters.liveRuntimeBuildConfig }}

Expand Down
7 changes: 6 additions & 1 deletion eng/pipelines/libraries/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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) }}
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup will do as a subsequent PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are now included in this PR: #34460


Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/libraries/build-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ parameters:
framework: ''
isOfficialBuild: false
liveRuntimeBuildConfig: ''
runtimeFlavor: 'coreclr'
timeoutInMinutes: 150
container: ''
publishTestArtifacs: true
Expand Down Expand Up @@ -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) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe allConfigurations shouldn't depend on the whole coreclr build. It should only need corelib as the tests we run there don't use testhost.

Copy link
Member

@safern safern Apr 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disregard, allConfigurations nor net472 use this template at all. We can actually remove the in(parameters.framework conditions above and just leave it as:

- ${{ 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) }}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok will do as a subsequent PR.

Copy link
Member Author

Choose a reason for hiding this comment

The 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) }}
Expand Down
23 changes: 23 additions & 0 deletions eng/pipelines/libraries/outerloop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@ variables:
jobs:
- template: /eng/pipelines/common/checkout-job.yml

#
# CoreLib Build
#
- template: /eng/pipelines/common/platform-matrix.yml
safern marked this conversation as resolved.
Show resolved Hide resolved
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/build-corelib-job.yml
buildConfig: release
platforms:
- ${{ if eq(variables['includeWindowsOuterloop'], true) }}:
- Windows_NT_x64
- Windows_NT_x86
- ${{ if eq(variables['includeLinuxOuterloop'], true) }}:
- Linux_x64
- Linux_musl_x64
- ${{ if eq(variables['isFullMatrix'], true) }}:
- Linux_arm
- Linux_arm64
- Linux_musl_arm64
- ${{ if eq(variables['includeOsxOuterloop'], true) }}:
- OSX_x64
jobParameters:
testGroup: innerloop

#
# CoreCLR Build
#
Expand Down
13 changes: 12 additions & 1 deletion eng/pipelines/libraries/run-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
container: '' # we just send to helix, no need to use a container.
condition: ${{ parameters.condition }}
pool: ${{ parameters.pool }}
testScope: ${{ parameters.testScope }}
${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
displayName: ${{ format('Test Run {0} {1}', parameters.liveRuntimeBuildConfig, parameters.runtimeFlavor) }}
name: ${{ format('test_run_{0}_{1}', parameters.liveRuntimeBuildConfig, parameters.runtimeFlavor) }}
Expand Down Expand Up @@ -78,9 +79,19 @@ jobs:
/p:RuntimeFlavor=${{ parameters.runtimeFlavor }}
/p:TargetArchitecture=${{ parameters.archType }}
/p:Configuration=${{ parameters.buildConfig }}
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/overrideCoreclrFromLiveDrop.binlog
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/overrideRuntimeFromLiveDrop.binlog
displayName: Override $(runtimeFlavorName) from live drop

- script: $(_buildScript) -projects $(Build.SourcesDirectory)/src/libraries/pretest.proj
$(_runtimeArtifactsPathArg)
$(_runtimeOSArg)
/p:RuntimeFlavor=${{ parameters.runtimeFlavor }}
/p:TargetArchitecture=${{ parameters.archType }}
/p:Configuration=${{ parameters.buildConfig }}
/p:SkipBuildProjects=true
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/pretest.binlog
displayName: Build PreTest to Generate Deps Json File

- template: /eng/pipelines/libraries/helix.yml
parameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
Expand Down
21 changes: 21 additions & 0 deletions eng/pipelines/runtime-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@ stages:
#
- template: /eng/pipelines/common/checkout-job.yml

#
# Build CoreLib
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/build-corelib-job.yml
buildConfig: release
platforms:
- OSX_x64
- Linux_x64
- Linux_arm
- Linux_arm64
- Linux_musl_x64
- Linux_musl_arm64
- Windows_NT_x86
- Windows_NT_x64
- Windows_NT_arm
- Windows_NT_arm64
jobParameters:
isOfficialBuild: ${{ variables.isOfficialBuild }}

#
# Build CoreCLR
#
Expand Down
21 changes: 21 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,27 @@ jobs:
- eng/pipelines/mono/*
- eng/pipelines/libraries/*

#
mangod9 marked this conversation as resolved.
Show resolved Hide resolved
# Build CoreLib release
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/build-corelib-job.yml
buildConfig: release
platforms:
- OSX_x64
- Linux_x64
- Linux_arm
- Linux_arm64
- Linux_musl_x64
- Linux_musl_arm64
- Windows_NT_x64
- Windows_NT_x86
- Windows_NT_arm
- Windows_NT_arm64
jobParameters:
testGroup: innerloop

#
# Build CoreCLR checked
# Only when CoreCLR is changed
Expand Down
3 changes: 2 additions & 1 deletion src/libraries/pretest.proj
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
Projects="@(Project)"
Properties="TargetFramework=$(BuildTargetFramework);%(Project.AdditionalProperties)"
BuildInParallel="true"
ContinueOnError="ErrorAndStop" />
ContinueOnError="ErrorAndStop"
Condition="'$(SkipBuildProjects)' != 'true'"/>
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm fine with that.

Copy link
Member Author

Choose a reason for hiding this comment

The 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'" />
Expand Down
11 changes: 11 additions & 0 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

@ViktorHofer ViktorHofer Apr 2, 2020

Choose a reason for hiding this comment

The 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:

  1. runtime.proj
  2. pretest.proj and
  3. tests.proj

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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

@ViktorHofer ViktorHofer Apr 2, 2020

Choose a reason for hiding this comment

The 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)"
Expand Down