Skip to content

Commit 7230a91

Browse files
committed
ArPow stage 1: local source-build infrastructure
Conflicts: eng/Version.Details.xml
1 parent 033b1fb commit 7230a91

15 files changed

+549
-3
lines changed

eng/SourceBuild.props

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<GitHubRepositoryName>aspnetcore</GitHubRepositoryName>
5+
<SourceBuildManagedOnly>true</SourceBuildManagedOnly>
6+
<CloneSubmodulesToInnerSourceBuildRepo>false</CloneSubmodulesToInnerSourceBuildRepo>
7+
</PropertyGroup>
8+
9+
<Target Name="ApplySourceBuildPatchFiles"
10+
AfterTargets="PrepareInnerSourceBuildRepoRoot"
11+
BeforeTargets="RunInnerSourceBuildCommand">
12+
13+
<ItemGroup>
14+
<SourceBuildPatchFile Include="$(RepositoryEngineeringDir)source-build-patches\*.patch" />
15+
</ItemGroup>
16+
17+
<Exec
18+
Command="git apply --ignore-whitespace --whitespace=nowarn &quot;%(SourceBuildPatchFile.FullPath)&quot;"
19+
WorkingDirectory="$(InnerSourceBuildRepoRoot)"
20+
Condition="'@(SourceBuildPatchFile)' != ''" />
21+
</Target>
22+
23+
<!--
24+
Init submodules - temporarary workaround for https://github.com/dotnet/sourcelink/pull/653
25+
-->
26+
<Target Name="InitSubmodules"
27+
DependsOnTargets="PrepareInnerSourceBuildRepoRoot"
28+
BeforeTargets="RunInnerSourceBuildCommand">
29+
30+
<Exec
31+
Command="git submodule update --init --recursive"
32+
WorkingDirectory="$(InnerSourceBuildRepoRoot)"
33+
EnvironmentVariables="@(InnerBuildEnv)" />
34+
</Target>
35+
36+
<!--
37+
Remove inner source .globalconfig file as both the inner and outer config files get loaded and cause a conflict.
38+
Leaving the inner will cause all conflicting settings to be ignored.
39+
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#general-options
40+
-->
41+
<Target Name="RemoveInnerGlobalConfig"
42+
DependsOnTargets="PrepareInnerSourceBuildRepoRoot"
43+
BeforeTargets="RunInnerSourceBuildCommand">
44+
45+
<Delete Files="$(InnerSourceBuildRepoRoot).globalconfig" />
46+
</Target>
47+
48+
<!--
49+
Build RepoTasks - this is normally triggered via the build script but the inner ArPow source-build is run via msbuild
50+
-->
51+
<Target Name="BuildRepoTasks"
52+
Condition="'$(ArcadeInnerBuildFromSource)' == 'true'"
53+
BeforeTargets="Execute">
54+
55+
<Exec
56+
Command="./eng/build.sh --only-build-repo-tasks"
57+
WorkingDirectory="$(InnerSourceBuildRepoRoot)"
58+
EnvironmentVariables="@(InnerBuildEnv)" />
59+
</Target>
60+
61+
<Target Name="CustomizeInnerBuildArgs"
62+
BeforeTargets="GetSourceBuildCommandConfiguration">
63+
64+
<PropertyGroup>
65+
<InnerBuildArgs>$(InnerBuildArgs) /p:SourceBuildRuntimeIdentifier=$(TargetRuntimeIdentifier)</InnerBuildArgs>
66+
</PropertyGroup>
67+
</Target>
68+
69+
</Project>

eng/SourceBuildPrebuiltBaseline.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<UsageData>
2+
<IgnorePatterns>
3+
<UsagePattern IdentityGlob="*/*" />
4+
</IgnorePatterns>
5+
</UsageData>

eng/Version.Details.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@
299299
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21167.3">
300300
<Uri>https://github.com/dotnet/arcade</Uri>
301301
<Sha>0ca849f0b71866b007fedaaa938cee63f8d056a6</Sha>
302+
<SourceBuild RepoName="arcade" ManagedOnly="true"/>
302303
</Dependency>
303304
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="6.0.0-beta.21167.3">
304305
<Uri>https://github.com/dotnet/arcade</Uri>

eng/build.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ run_pack=false
2121
run_tests=false
2222
build_all=false
2323
build_deps=true
24+
only_build_repo_tasks=false
2425
build_repo_tasks=true
2526
build_managed=''
2627
build_native=''
@@ -64,6 +65,7 @@ Options:
6465
Globbing patterns are supported, such as \"$(pwd)/**/*.csproj\".
6566
--no-build-deps Do not build project-to-project references and only build the specified project.
6667
--no-build-repo-tasks Suppress building RepoTasks.
68+
--only-build-repo-tasks Only build RepoTasks.
6769
6870
--all Build all project types.
6971
--[no-]build-native Build native projects (C, C++). Ignored in most cases i.e. with `dotnet msbuild`.
@@ -195,6 +197,9 @@ while [[ $# -gt 0 ]]; do
195197
-no-build-repo-tasks|-nobuildrepotasks)
196198
build_repo_tasks=false
197199
;;
200+
-only-build-repo-tasks|-onlybuildrepotasks)
201+
only_build_repo_tasks=true
202+
;;
198203
-arch)
199204
shift
200205
target_arch="${1:-}"
@@ -366,8 +371,10 @@ if [ "$build_repo_tasks" = true ]; then
366371
${toolset_build_args[@]+"${toolset_build_args[@]}"}
367372
fi
368373

369-
# This incantation avoids unbound variable issues if msbuild_args is empty
370-
# https://stackoverflow.com/questions/7577052/bash-empty-array-expansion-with-set-u
371-
MSBuild $_InitializeToolset -p:RepoRoot="$repo_root" ${msbuild_args[@]+"${msbuild_args[@]}"}
374+
if [ "$only_build_repo_tasks" != true ]; then
375+
# This incantation avoids unbound variable issues if msbuild_args is empty
376+
# https://stackoverflow.com/questions/7577052/bash-empty-array-expansion-with-set-u
377+
MSBuild $_InitializeToolset -p:RepoRoot="$repo_root" ${msbuild_args[@]+"${msbuild_args[@]}"}
378+
fi
372379

373380
ExitWithExitCode 0
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 64d2efe24308d9e8b99fdea60c92ee1115259506 Mon Sep 17 00:00:00 2001
2+
From: dseefeld <[email protected]>
3+
Date: Thu, 31 Oct 2019 20:38:26 +0000
4+
Subject: [PATCH 02/14] Conditionally set PackAsToolShimRID
5+
6+
---
7+
Directory.Build.targets | 5 +++++
8+
1 file changed, 5 insertions(+)
9+
10+
diff --git a/Directory.Build.targets b/Directory.Build.targets
11+
index 4b72a52947..1a3b01e858 100644
12+
--- a/Directory.Build.targets
13+
+++ b/Directory.Build.targets
14+
@@ -52,6 +52,11 @@
15+
<SuppressDependenciesWhenPacking Condition="'$(SuppressDependenciesWhenPacking)' == '' AND '$(IsAnalyzersProject)' == 'true'">true</SuppressDependenciesWhenPacking>
16+
</PropertyGroup>
17+
18+
+ <PropertyGroup Condition="'$(PackAsTool)' == 'true' AND '$(IsShippingPackage)' == 'true' AND '$(DotNetBuildFromSource)' != 'true'">
19+
+ <!-- This is a requirement for Microsoft tool packages only. -->
20+
+ <PackAsToolShimRuntimeIdentifiers>win-x64;win-x86</PackAsToolShimRuntimeIdentifiers>
21+
+ </PropertyGroup>
22+
+
23+
<PropertyGroup Condition=" '$(MSBuildProjectExtension)' == '.csproj' ">
24+
<PackageId Condition=" '$(PackageId)' == '' ">$(AssemblyName)</PackageId>
25+
<IsPackable
26+
--
27+
2.18.0
28+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 6f903f6870011b6a11074d93a03481faac6a35dc Mon Sep 17 00:00:00 2001
2+
From: dseefeld <[email protected]>
3+
Date: Thu, 4 Feb 2021 15:18:11 +0000
4+
Subject: [PATCH] Exclude some projects from source-build
5+
6+
---
7+
Directory.Build.props | 4 +++-
8+
1 file changed, 3 insertions(+), 1 deletion(-)
9+
10+
diff --git a/Directory.Build.props b/Directory.Build.props
11+
index 50d30f12fd..85c2f2428b 100644
12+
--- a/Directory.Build.props
13+
+++ b/Directory.Build.props
14+
@@ -27,7 +27,9 @@
15+
'$(IsTestAssetProject)' == 'true' OR
16+
'$(IsBenchmarkProject)' == 'true' OR
17+
'$(IsUnitTestProject)' == 'true'">false</IsShipping>
18+
-
19+
+ <IsOtherTestProject Condition="$(MSBuildProjectName.Contains('IntegrationTesting')) or $(MSBuildProjectName.Contains('TestCommon'))">true</IsOtherTestProject>
20+
+ <ExcludeFromSourceBuild Condition="'$(IsSampleProject)' == 'true' or '$(IsTestAssetProject)' == 'true' or '$(IsBenchmarkProject)' == 'true' or '$(IsUnitTestProject)' == 'true' or '$(IsSpecificationTestProject)' == 'true' or '$(IsOtherTestProject)' == 'true'">true</ExcludeFromSourceBuild>
21+
+
22+
<!--
23+
Following logic mimics core-setup approach as well as
24+
https://github.com/dotnet/arcade/blob/694d59f090b743f894779d04a7ffe11cbaf352e7/src/Microsoft.DotNet.Arcade.Sdk/tools/Publish.proj#L30-L31
25+
--
26+
2.21.3
27+
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
From 83c0f95c563fa6eb9b446f09166cac2c62ab6390 Mon Sep 17 00:00:00 2001
2+
From: dseefeld <[email protected]>
3+
Date: Thu, 14 May 2020 16:29:28 +0000
4+
Subject: [PATCH 04/14] Remove Yarn dependency - not used in source-build
5+
6+
---
7+
eng/targets/Npm.Common.targets | 3 ---
8+
global.json | 1 -
9+
.../src/Microsoft.Authentication.WebAssembly.Msal.csproj | 2 --
10+
...oft.AspNetCore.Components.WebAssembly.Authentication.csproj | 2 --
11+
src/Shared/E2ETesting/E2ETesting.targets | 3 ---
12+
5 files changed, 11 deletions(-)
13+
14+
diff --git a/eng/targets/Npm.Common.targets b/eng/targets/Npm.Common.targets
15+
index 696d23402b..6086dd0843 100644
16+
--- a/eng/targets/Npm.Common.targets
17+
+++ b/eng/targets/Npm.Common.targets
18+
@@ -1,8 +1,5 @@
19+
<Project DefaultTargets="Build" InitialTargets="_CheckForInvalidConfiguration">
20+
21+
- <!-- Version of this SDK is set in global.json -->
22+
- <Sdk Name="Yarn.MSBuild" />
23+
-
24+
<PropertyGroup>
25+
<NormalizedPackageId>$(PackageId.Replace('@','').Replace('/','-'))</NormalizedPackageId>
26+
<PackageFileName>$(NormalizedPackageId)-$(PackageVersion).tgz</PackageFileName>
27+
diff --git a/global.json b/global.json
28+
index 501ba161bf..ee9dcaf4fa 100644
29+
--- a/global.json
30+
+++ b/global.json
31+
@@ -29,7 +29,6 @@
32+
"xcopy-msbuild": "16.5.0-alpha"
33+
},
34+
"msbuild-sdks": {
35+
- "Yarn.MSBuild": "1.22.10",
36+
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21167.3",
37+
"Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.21167.3"
38+
}
39+
diff --git a/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj b/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj
40+
index 939ba16f88..ea2c849ea3 100644
41+
--- a/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj
42+
+++ b/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj
43+
@@ -1,7 +1,5 @@
44+
<Project Sdk="Microsoft.NET.Sdk.Razor">
45+
46+
- <Sdk Name="Yarn.MSBuild" />
47+
-
48+
<PropertyGroup>
49+
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
50+
<Description>Authenticate your Blazor webassembly applications with Azure Active Directory and Azure Active Directory B2C</Description>
51+
diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj
52+
index 21a2efba4e..b4a6a75446 100644
53+
--- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj
54+
+++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj
55+
@@ -1,7 +1,5 @@
56+
<Project Sdk="Microsoft.NET.Sdk.Razor">
57+
58+
- <Sdk Name="Yarn.MSBuild" />
59+
-
60+
<PropertyGroup>
61+
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
62+
<Description>Build client-side authentication for single-page applications (SPAs).</Description>
63+
diff --git a/src/Shared/E2ETesting/E2ETesting.targets b/src/Shared/E2ETesting/E2ETesting.targets
64+
index 76ced2cce9..eaecb913a9 100644
65+
--- a/src/Shared/E2ETesting/E2ETesting.targets
66+
+++ b/src/Shared/E2ETesting/E2ETesting.targets
67+
@@ -1,7 +1,4 @@
68+
<Project>
69+
- <!-- Version of this SDK is set in global.json -->
70+
- <Sdk Name="Yarn.MSBuild" />
71+
-
72+
<!-- Make sure the settings files get copied to the test output folder. -->
73+
<ItemGroup>
74+
<None Update="e2eTestSettings*.json">
75+
--
76+
2.18.0
77+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From adef97cd8923986914006454777f9f96d48c3a42 Mon Sep 17 00:00:00 2001
2+
From: Chris Rummel <[email protected]>
3+
Date: Sun, 28 Jun 2020 18:41:22 +0000
4+
Subject: [PATCH 09/14] Use source-built version of MSBuild.
5+
6+
---
7+
eng/Versions.props | 1 +
8+
eng/tools/RepoTasks/RepoTasks.csproj | 6 +++---
9+
2 files changed, 4 insertions(+), 3 deletions(-)
10+
11+
diff --git a/eng/Versions.props b/eng/Versions.props
12+
index 90bb9be..2266be5 100644
13+
--- a/eng/Versions.props
14+
+++ b/eng/Versions.props
15+
@@ -186,6 +186,7 @@
16+
<!-- Partner teams -->
17+
<MicrosoftBclAsyncInterfacesVersion>1.0.0</MicrosoftBclAsyncInterfacesVersion>
18+
<MicrosoftBuildVersion>16.9.0</MicrosoftBuildVersion>
19+
+ <MicrosoftBuildFrameworkPackageVersion>16.9.0</MicrosoftBuildFrameworkPackageVersion>
20+
<MicrosoftAzureSignalRVersion>1.2.0</MicrosoftAzureSignalRVersion>
21+
<MicrosoftBuildFrameworkVersion>16.9.0</MicrosoftBuildFrameworkVersion>
22+
<MicrosoftBuildLocatorVersion>1.2.6</MicrosoftBuildLocatorVersion>
23+
diff --git a/eng/tools/RepoTasks/RepoTasks.csproj b/eng/tools/RepoTasks/RepoTasks.csproj
24+
index 7fa9957..3664366 100644
25+
--- a/eng/tools/RepoTasks/RepoTasks.csproj
26+
+++ b/eng/tools/RepoTasks/RepoTasks.csproj
27+
@@ -20,9 +20,9 @@
28+
</ItemGroup>
29+
30+
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
31+
- <PackageReference Include="Microsoft.Build.Framework" Version="16.9.0" />
32+
- <PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.9.0" />
33+
- <PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.9.0" />
34+
+ <PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
35+
+ <PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
36+
+ <PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
37+
</ItemGroup>
38+
39+
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
40+
--
41+
2.18.0
42+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From d67aa83be72cbb1ca37aba992633da87235f397b Mon Sep 17 00:00:00 2001
2+
From: Tomas Weinfurt <[email protected]>
3+
Date: Wed, 13 Nov 2019 22:32:02 -0800
4+
Subject: [PATCH 06/14] Add FreeBSD
5+
6+
---
7+
Directory.Build.props | 1 +
8+
eng/Common.props | 1 +
9+
2 files changed, 2 insertions(+)
10+
11+
diff --git a/Directory.Build.props b/Directory.Build.props
12+
index cd2dabcdba..53d90f2903 100644
13+
--- a/Directory.Build.props
14+
+++ b/Directory.Build.props
15+
@@ -159,6 +159,7 @@
16+
win-arm64;
17+
osx-x64;
18+
osx-arm64;
19+
+ freebsd-x64;
20+
linux-musl-x64;
21+
linux-musl-arm;
22+
linux-musl-arm64;
23+
diff --git a/eng/Common.props b/eng/Common.props
24+
index 7c489b15a9..a9a69bde9f 100644
25+
--- a/eng/Common.props
26+
+++ b/eng/Common.props
27+
@@ -3,6 +3,7 @@
28+
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('Windows'))">win</TargetOsName>
29+
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('OSX'))">osx</TargetOsName>
30+
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('Linux'))">linux</TargetOsName>
31+
+ <TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('FreeBSD'))">freebsd</TargetOsName>
32+
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
33+
<TargetRuntimeIdentifier Condition="'$(TargetRuntimeIdentifier)' == ''">$(TargetOsName)-$(TargetArchitecture)</TargetRuntimeIdentifier>
34+
</PropertyGroup>
35+
--
36+
2.18.0
37+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From ca706cd8670d14fae05b36ee83de716fa19d95ba Mon Sep 17 00:00:00 2001
2+
From: Omair Majid <[email protected]>
3+
Date: Wed, 23 Oct 2019 15:43:57 -0400
4+
Subject: [PATCH 07/14] Support global.json on arm64 as well
5+
6+
arcade uses the runtime section of global.json to decide which
7+
architecture + runtime combination needs to be installed.
8+
9+
With https://github.com/dotnet/arcade/pull/4132 arcade can install
10+
foreign SDKs in separate locations correctly.
11+
12+
This change, suggested by @dougbu, makes arcade always install the
13+
runtime for the local architecture (which means it should work on arm64
14+
and x64) as well as the x86 architecture (skipped on Linux).
15+
16+
This gets us a working SDK/Runtime combo on arm64.
17+
---
18+
global.json | 5 +----
19+
1 file changed, 1 insertion(+), 4 deletions(-)
20+
21+
diff --git a/global.json b/global.json
22+
index ee9dcaf4fa..053e92ebee 100644
23+
--- a/global.json
24+
+++ b/global.json
25+
@@ -5,13 +5,10 @@
26+
"tools": {
27+
"dotnet": "6.0.100-preview.3.21168.19",
28+
"runtimes": {
29+
- "dotnet/x64": [
30+
+ "dotnet": [
31+
"2.1.25",
32+
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
33+
],
34+
- "dotnet/x86": [
35+
- "$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
36+
- ],
37+
"aspnetcore/x64": [
38+
"3.1.13"
39+
]
40+
--
41+
2.18.0
42+

0 commit comments

Comments
 (0)