Skip to content

Commit 4d67e70

Browse files
John LuoMichaelSimons
andauthored
Arcade powered source build (#32790)
* Add source-build ci leg * Remove patches * Fixup project type logic * Mark Components.E2ETests as NodeJsProject * Exclude YarnMSBuild project in source build * Update binlog parameter logic * Modify source build global json script Co-authored-by: Michael Simons <[email protected]>
1 parent f304c44 commit 4d67e70

21 files changed

+55
-643
lines changed

.azure/pipelines/ci.yml

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -749,56 +749,13 @@ stages:
749749
includeForks: true
750750

751751
# Source build
752-
- job: Source_Build
753-
displayName: 'Test: Linux Source Build'
754-
container: centos:7
755-
pool:
756-
vmImage: 'ubuntu-18.04'
757-
variables:
758-
LC_ALL: 'en_US.UTF-8'
759-
LANG: 'en_US.UTF-8'
760-
LANGUAGE: 'en_US.UTF-8'
761-
DotNetCoreSdkDir: $(Agent.ToolsDirectory)/dotnet
762-
# This isn't needed in the path because build does not need to _use_ global tools.
763-
DOTNET_CLI_HOME: $(System.DefaultWorkingDirectory)
764-
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true
765-
steps:
766-
- script: |
767-
source eng/common/native/common-library.sh
768-
mkdir -p $(System.DefaultWorkingDirectory)/.tools
769-
GetFile https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 $(System.DefaultWorkingDirectory)/.tools/jq
770-
chmod +x $(System.DefaultWorkingDirectory)/.tools/jq
771-
echo "##vso[task.prependpath]$(System.DefaultWorkingDirectory)/.tools"
772-
displayName: Install jq
773-
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
774-
- task: Bash@3
775-
displayName: Setup Private Feeds Credentials
776-
inputs:
777-
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
778-
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
779-
env:
780-
Token: $(dn-bot-dnceng-artifact-feeds-rw)
781-
- script: ./eng/scripts/ci-source-build.sh --ci --nobl --configuration Release /p:BuildManaged=true /p:BuildNodeJs=false $(_InternalRuntimeDownloadArgs)
782-
displayName: Run ci-source-build.sh
783-
- task: PublishBuildArtifacts@1
784-
displayName: Upload logs
785-
condition: always()
786-
continueOnError: true
787-
inputs:
788-
pathtoPublish: artifacts/log/
789-
artifactName: Source_Build_Logs
790-
artifactType: Container
791-
parallel: true
792-
- task: PublishBuildArtifacts@1
793-
displayName: Upload package artifacts
794-
# Only capture source build artifacts in PRs for the sake of inspecting
795-
# changes that impact source-build. The artifacts from this build pipeline are never actually used.
796-
condition: and(succeeded(), in(variables['Build.Reason'], 'PullRequest'))
797-
inputs:
798-
pathtoPublish: artifacts/packages/
799-
artifactName: Source_Build_Packages
800-
artifactType: Container
801-
parallel: true
752+
- template: /eng/common/templates/job/source-build.yml
753+
parameters:
754+
platform:
755+
name: 'Managed'
756+
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-f39df28-20191023143754'
757+
buildScript: './eng/build.sh'
758+
skipPublishValidation: true
802759

803760
# Publish to the BAR
804761
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
@@ -827,7 +784,7 @@ stages:
827784
- Linux_musl_arm_build
828785
- Linux_musl_arm64_build
829786
# In addition to the dependencies above, ensure the build was successful overall.
830-
- Source_Build
787+
- Source_Build_Managed
831788
pool:
832789
vmImage: vs2017-win2016
833790
publishUsingPipelines: ${{ variables._PublishUsingPipelines }}

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
( $(MSBuildProjectName.EndsWith('Tests')) OR
3030
$(MSBuildProjectName.EndsWith('.Test')) OR
3131
$(MSBuildProjectName.EndsWith('.FunctionalTest')) ) ">true</IsUnitTestProject>
32-
<IsTestAssetProject Condition=" $(RepoRelativeProjectDir.Contains('testassets')) ">true</IsTestAssetProject>
32+
<IsTestAssetProject Condition=" $(RepoRelativeProjectDir.Contains('testassets')) OR $(MSBuildProjectName.Contains('TestCommon'))">true</IsTestAssetProject>
3333
<IsSampleProject Condition=" $(RepoRelativeProjectDir.ToUpperInvariant().Contains('SAMPLE')) ">true</IsSampleProject>
3434
<IsAnalyzersProject Condition="$(MSBuildProjectName.EndsWith('.Analyzers'))">true</IsAnalyzersProject>
3535
<IsShipping Condition=" '$(IsSampleProject)' == 'true' OR
@@ -171,7 +171,8 @@
171171
linux-musl-arm64;
172172
linux-x64;
173173
linux-arm;
174-
linux-arm64
174+
linux-arm64;
175+
freebsd-x64
175176
</SupportedRuntimeIdentifiers>
176177

177178
<!-- Make error messages clickable in VS Code's console -->

eng/Build.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@
134134
<ProjectToBuild Condition=" '$(BuildNodeJS)' == 'true'" Include="@(NodeJsProjects)" Exclude="@(ProjectToExclude)" />
135135
<ProjectToExclude Condition=" '$(BuildNodeJS)' != 'true'" Include="@(NodeJsProjects)" />
136136

137+
<YarnMSBuildProjects Include="
138+
$(RepoRoot)src\Components\test\E2ETest\Microsoft.AspNetCore.Components.E2ETests.csproj;
139+
$(RepoRoot)src\Components\WebAssembly\Authentication.Msal\src\Microsoft.Authentication.WebAssembly.Msal.csproj;
140+
$(RepoRoot)src\Components\WebAssembly\WebAssembly.Authentication\src\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj;
141+
"
142+
Exclude="@(ProjectToExclude)" />
143+
<ProjectToExclude Condition=" '$(DotNetBuildFromSource)' == 'true'" Include="@(YarnMSBuildProjects)" />
144+
137145
<JavaProjects Include="$(RepoRoot)src\SignalR\**\*.javaproj"
138146
Exclude="@(ProjectToExclude)" />
139147

eng/Common.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('Windows'))">win</TargetOsName>
44
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('OSX'))">osx</TargetOsName>
55
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('Linux'))">linux</TargetOsName>
6+
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('FreeBSD'))">freebsd</TargetOsName>
67
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
78
<TargetRuntimeIdentifier Condition="'$(TargetRuntimeIdentifier)' == ''">$(TargetOsName)-$(TargetArchitecture)</TargetRuntimeIdentifier>
89
</PropertyGroup>

eng/SourceBuild.props

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@
66
<CloneSubmodulesToInnerSourceBuildRepo>false</CloneSubmodulesToInnerSourceBuildRepo>
77
</PropertyGroup>
88

9-
<Target Name="ApplySourceBuildPatchFiles"
9+
<Target Name="PrepareGlobalJsonForSourceBuild"
1010
AfterTargets="PrepareInnerSourceBuildRepoRoot"
1111
BeforeTargets="RunInnerSourceBuildCommand">
12-
13-
<ItemGroup>
14-
<SourceBuildPatchFile Include="$(RepositoryEngineeringDir)source-build-patches\*.patch" />
15-
</ItemGroup>
16-
1712
<Exec
18-
Command="git apply --ignore-whitespace --whitespace=nowarn &quot;%(SourceBuildPatchFile.FullPath)&quot;"
19-
WorkingDirectory="$(InnerSourceBuildRepoRoot)"
20-
Condition="'@(SourceBuildPatchFile)' != ''" />
13+
Command="./eng/scripts/prepare-sourcebuild-globaljson.sh"
14+
WorkingDirectory="$(InnerSourceBuildRepoRoot)" />
2115
</Target>
2216

2317
<!--

eng/Versions.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@
183183
<MicrosoftBuildVersion>16.9.0</MicrosoftBuildVersion>
184184
<MicrosoftAzureSignalRVersion>1.2.0</MicrosoftAzureSignalRVersion>
185185
<MicrosoftBuildFrameworkVersion>16.9.0</MicrosoftBuildFrameworkVersion>
186+
<MicrosoftBuildTaskCoreVersion>16.9.0</MicrosoftBuildTaskCoreVersion>
187+
<MicrosoftBuildUtilitiesCoreVersion>16.9.0</MicrosoftBuildUtilitiesCoreVersion>
186188
<MicrosoftBuildLocatorVersion>1.2.6</MicrosoftBuildLocatorVersion>
187189
<MicrosoftBuildUtilitiesCoreVersion>16.9.0</MicrosoftBuildUtilitiesCoreVersion>
188190
<MicrosoftCodeAnalysisCommonVersion>3.8.0</MicrosoftCodeAnalysisCommonVersion>
@@ -201,6 +203,7 @@
201203
<MicrosoftWebWebView2Version>1.0.705.50</MicrosoftWebWebView2Version>
202204
<MicrosoftWebXdtVersion>1.4.0</MicrosoftWebXdtVersion>
203205
<SystemIdentityModelTokensJwtVersion>6.10.0</SystemIdentityModelTokensJwtVersion>
206+
<NuGetPackagingVersion>5.10.0-rc.7240</NuGetPackagingVersion>
204207
<NuGetVersioningVersion>5.10.0-rc.7240</NuGetVersioningVersion>
205208
<NuGetFrameworksVersion>5.10.0-rc.7240</NuGetFrameworksVersion>
206209
<SystemComponentModelAnnotationsVersion>5.0.0</SystemComponentModelAnnotationsVersion>

eng/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ if [[ "$binary_log" == true ]]; then
342342
if [[ "$found" == false ]]; then
343343
msbuild_args[${#msbuild_args[*]}]="/bl:$log_dir/Build.binlog"
344344
fi
345+
toolset_build_args[${#toolset_build_args[*]}]="/bl:$log_dir/Build.repotasks.binlog"
345346
elif [[ "$ci" == true ]]; then
346347
# Ensure the artifacts/log directory isn't empty to avoid warnings.
347348
touch "$log_dir/empty.log"

eng/scripts/ci-source-build.sh

Lines changed: 0 additions & 113 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
7+
while IFS= read -r line
8+
do
9+
# Remove dotnet/x64 runtimes
10+
if [[ "$line" == *"dotnet/x86"* ]]
11+
then
12+
while IFS= read -r removeLine
13+
do
14+
if [[ "$removeLine" == *"]"* ]]
15+
then
16+
break
17+
fi
18+
done
19+
else
20+
# Change dotnet/x64 to dotnet
21+
echo "${line/dotnet\/x64/dotnet}"
22+
fi
23+
done < $DIR/../../global.json > global.json.swap
24+
mv global.json.swap $DIR/../../global.json

eng/source-build-patches/0002-Conditionally-set-PackAsToolShimRID.patch

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)