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

ArPow stage 1: local source-build infrastructure #53294

Merged
merged 50 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
1054536
Initial arcade-powered source-build infra
dagood Feb 4, 2021
7d0c956
Add patches, fixup from 5.0
dagood Feb 4, 2021
376c10c
Rename patches to match 6.0-p1 work
dagood Feb 4, 2021
8a4c258
Add source-build specific build script
dseefeld Jan 15, 2020
9d474ce
Incorporate build-source-build.sh, into eng/
dagood Feb 4, 2021
06f1d5e
Run inner build script, through coreclr
dagood Feb 8, 2021
0e4d155
Initial source-build args based on live build (not props file)
dagood Feb 8, 2021
cc4124f
Cleanup: add RID comments, rm empty/absolute args
dagood Feb 8, 2021
59fb50e
Fix subsets
dagood Feb 8, 2021
ad4201b
Disable sourcelink in env, not args
dagood Feb 8, 2021
1c87b39
Fix CI NZEC
dagood Feb 8, 2021
c4f711d
Revert "Use same code to DetectCiphersuiteConfiguration for portable …
dagood Feb 8, 2021
479c95a
Fix portability
dagood Feb 8, 2021
2565431
Fix AllJits build
dagood Feb 8, 2021
cd313cd
Fix missing crossgen2 for non-portable RID
dagood Feb 12, 2021
2b5307d
Create supplemental intermediate nupkgs
dagood Feb 12, 2021
d7546c5
Tweak category names
dagood Feb 16, 2021
d6602eb
Use centralized supplemental nupkg infra
dagood Feb 16, 2021
843caa7
Merge branch 'main' of https://github.com/dotnet/runtime into arpow-s…
MichaelSimons Apr 27, 2021
a7d8b95
Add additional 6.0 patches
MichaelSimons Apr 27, 2021
18d9616
Patch updates after merging in main
MichaelSimons Apr 27, 2021
f8e8475
SourceBuild.props cleanup
MichaelSimons Apr 27, 2021
aa13d3c
Fix issue with incorrect patch merge
MichaelSimons May 3, 2021
38cea15
Patch updates
MichaelSimons May 4, 2021
f5445ee
Edit clr.tools patch
MichaelSimons May 14, 2021
4d94fd4
Merge branch 'main' of https://github.com/dotnet/runtime into arpow-s…
MichaelSimons May 14, 2021
0a8059d
patch updates
MichaelSimons May 14, 2021
9b2c5b3
Revert patch integration
MichaelSimons May 14, 2021
1b2d9b1
Merge branch 'main' of https://github.com/dotnet/runtime into arpow-s…
MichaelSimons May 25, 2021
23e4735
Patch updates
MichaelSimons May 26, 2021
5a12eaf
Edits per code review feedback
MichaelSimons Jun 8, 2021
e0c3357
ILAsm workaround
MichaelSimons Jun 8, 2021
658dea4
Merge branch 'main' of https://github.com/dotnet/runtime into arpow-s…
MichaelSimons Jun 8, 2021
de586df
patch updates
MichaelSimons Jun 8, 2021
e9b7fe4
Move logic to set ILAsmToolPath for source-build
MichaelSimons Jun 8, 2021
469f6a1
Update eng/SourceBuild.props
MichaelSimons Jun 9, 2021
6c2e477
Remove libraries specific patches
ViktorHofer Jun 14, 2021
1c97495
Merge branch 'main' of https://github.com/dotnet/runtime into arpow-s…
MichaelSimons Jun 14, 2021
e6f5d8f
Patch updates necessary with latest main merge
MichaelSimons Jun 14, 2021
f026627
Add back libraries-packages.proj harvesting patch
MichaelSimons Jun 14, 2021
371a532
Refactor intermediate package split to be chunkier
MichaelSimons Jun 14, 2021
58bb935
Merge branch 'main' of https://github.com/dotnet/runtime into arpow-s…
MichaelSimons Jun 15, 2021
309421d
Integrate patch 0017
MichaelSimons Jun 15, 2021
7230fa1
Subsets update per code review
MichaelSimons Jun 15, 2021
972035a
Remove obsolete patch
MichaelSimons Jun 15, 2021
f905b0e
Merge branch 'main' of https://github.com/dotnet/runtime into arpow-s…
MichaelSimons Jun 15, 2021
0124b4f
Merge branch 'main' of https://github.com/dotnet/runtime into arpow-s…
MichaelSimons Jun 18, 2021
cf48c62
Removed patches that were integrated into main
MichaelSimons Jun 18, 2021
4211c03
Remove two additional patches
ViktorHofer Jun 21, 2021
88a1715
Remove remaining patches
ViktorHofer Jun 21, 2021
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
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<WasmBuildTasksAssemblyPath>$([MSBuild]::NormalizePath('$(WasmBuildTasksDir)', 'WasmBuildTasks.dll'))</WasmBuildTasksAssemblyPath>
<MonoAOTCompilerTasksAssemblyPath>$([MSBuild]::NormalizePath('$(MonoAOTCompilerDir)', 'MonoAOTCompiler.dll'))</MonoAOTCompilerTasksAssemblyPath>
<RuntimeConfigParserTasksAssemblyPath>$([MSBuild]::NormalizePath('$(RuntimeConfigParserDir)', 'RuntimeConfigParser.dll'))</RuntimeConfigParserTasksAssemblyPath>
<ILAsmToolPath Condition="'$(DotNetBuildFromSource)' == 'true'">$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'coreclr', '$(TargetOS).$(TargetArchitecture).$(Configuration)'))</ILAsmToolPath>
</PropertyGroup>

<PropertyGroup Label="CalculateConfiguration">
Expand Down
73 changes: 73 additions & 0 deletions eng/SourceBuild.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<Project>

<PropertyGroup>
<GitHubRepositoryName>runtime</GitHubRepositoryName>
MichaelSimons marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<!-- Set up the dotnet/runtime source-build command. -->
<PropertyGroup>
<BaseInnerSourceBuildCommand>./build.sh</BaseInnerSourceBuildCommand>

<SourceBuildPortable>true</SourceBuildPortable>
<SourceBuildPortable Condition="'$(SourceBuildNonPortable)' == 'true'">false</SourceBuildPortable>

<!-- If TargetRid not specified, detect RID based on portability. -->
<TargetRid Condition="'$(TargetRid)' == '' and '$(SourceBuildNonPortable)' == 'true'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</TargetRid>
<TargetRid Condition="'$(TargetRid)' == ''">$(__DistroRid)</TargetRid>

<!-- Split e.g. 'fedora.33-x64' into 'fedora.33' and 'x64'. -->
<_targetRidPlatformIndex>$(TargetRid.LastIndexOfAny("-"))</_targetRidPlatformIndex>
<TargetRidWithoutPlatform>$(TargetRid.Substring(0, $(_targetRidPlatformIndex)))</TargetRidWithoutPlatform>
<TargetRidPlatform>$(TargetRid.Substring($(_targetRidPlatformIndex)).TrimStart('-'))</TargetRidPlatform>

<LogVerbosity Condition="'$(LogVerbosity)' == ''">minimal</LogVerbosity>
</PropertyGroup>

<ItemGroup>
<!-- Work around issue where local clone may cause failure using non-origin remote fallback: https://github.com/dotnet/sourcelink/issues/629 -->
<InnerBuildEnv Include="EnableSourceControlManagerQueries=false" />
<InnerBuildEnv Include="EnableSourceLink=false" />
<InnerBuildEnv Include="DisableSourceLink=true" />
<InnerBuildEnv Include="DeterministicSourcePaths=false" />
</ItemGroup>

<Target Name="GetRuntimeSourceBuildCommandConfiguration"
BeforeTargets="GetSourceBuildCommandConfiguration">
<PropertyGroup>
<InnerBuildArgs>$(InnerBuildArgs) --arch $(TargetRidPlatform)</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) --configuration $(Configuration)</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) --ci</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) --allconfigurations</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) --verbosity $(LogVerbosity)</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) --nodereuse false</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) --warnAsError false</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.0</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:ContinuousIntegrationBuild=true</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:PackageRid=$(TargetRid)</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:NoPgoOptimize=true</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:KeepNativeSymbols=true</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:RuntimeOS=$(TargetRidWithoutPlatform)</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:PortableBuild=$(SourceBuildPortable)</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:BuildDebPackage=false</InnerBuildArgs>
</PropertyGroup>
</Target>

<Target Name="CategorizeRuntimeSupplementalArtifacts"
BeforeTargets="GetCategorizedIntermediateNupkgContents">
<ItemGroup>
<!--
Copy link
Member Author

Choose a reason for hiding this comment

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

FYI - I logged an issue for having the ArPOW infrastructure handle large packages.

Runtime artifacts are too large to fit into a single package (Azure DevOps feeds 500 mb constraint).
Split large components into separate packages.
-->
<IntermediateNupkgArtifactFile Include="$(CurrentRepoSourceBuildArtifactsPackagesDir)Shipping\dotnet-runtime-*.tar.gz" Category="runtime" />

<IntermediateNupkgArtifactFile
Include="
$(CurrentRepoSourceBuildArtifactsPackagesDir)Shipping\dotnet-crossgen2-*.tar.gz;
$(CurrentRepoSourceBuildArtifactsPackagesDir)Shipping\Microsoft.NETCore.App.Crossgen2.*.nupkg"
Category="Crossgen2Pack" />
</ItemGroup>
</Target>

</Project>
5 changes: 5 additions & 0 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<UsageData>
<IgnorePatterns>
<UsagePattern IdentityGlob="*/*" />
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved
</IgnorePatterns>
</UsageData>
21 changes: 12 additions & 9 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<PropertyGroup>
<DefaultSubsets>clr+mono+libs+host+packs</DefaultSubsets>
<DefaultSubsets Condition="'$(TargetsMobile)' == 'true'">mono+libs+packs</DefaultSubsets>
<!-- On Windows mono is supported for x86/x64 only -->
<DefaultSubsets Condition="'$(TargetOS)' == 'windows' and '$(TargetArchitecture)' != 'x86' and '$(TargetArchitecture)' != 'x64'">clr+libs+host+packs</DefaultSubsets>
<!-- mono is not supported in source build. On Windows mono is supported for x86/x64 only. -->
<DefaultSubsets Condition="'$(DotNetBuildFromSource)' == 'true' or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' != 'x86' and '$(TargetArchitecture)' != 'x64')">clr+libs+host+packs</DefaultSubsets>
</PropertyGroup>

<!-- Init _subset here in to allow RuntimeFlavor to be set as early as possible -->
Expand All @@ -49,18 +49,21 @@
<DefaultMonoSubsets Condition="'$(TargetOS)' == 'Browser'">$(DefaultMonoSubsets)mono.wasmruntime+</DefaultMonoSubsets>
<DefaultMonoSubsets Condition="'$(MonoCrossAOTTargetOS)' != ''">$(DefaultMonoSubsets)mono.aotcross+</DefaultMonoSubsets>
<DefaultMonoSubsets>$(DefaultMonoSubsets)mono.runtime+mono.corelib+mono.packages</DefaultMonoSubsets>

<DefaultLibrariesSubsets Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or
'$(BuildTargetFramework)' == '' or
'$(BuildAllConfigurations)' == 'true'">libs.native+</DefaultLibrariesSubsets>
<DefaultLibrariesSubsets>$(DefaultLibrariesSubsets)libs.ref+libs.src+libs.pretest+libs.packages</DefaultLibrariesSubsets>
<DefaultLibrariesSubsets>$(DefaultLibrariesSubsets)libs.ref+libs.src+libs.packages</DefaultLibrariesSubsets>
<DefaultLibrariesSubsets Condition="'$(DotNetBuildFromSource)' != 'true'">$(DefaultLibrariesSubsets)+libs.pretest</DefaultLibrariesSubsets>

<DefaultHostSubsets>host.native+host.pkg+host.tools+host.tests</DefaultHostSubsets>
<DefaultHostSubsets>host.native+host.tools</DefaultHostSubsets>
<DefaultHostSubsets Condition="'$(DotNetBuildFromSource)' != 'true'">$(DefaultHostSubsets)+host.pkg+host.tests</DefaultHostSubsets>
<DefaultHostSubsets Condition="'$(RuntimeFlavor)' == 'Mono'"></DefaultHostSubsets>
<DefaultHostSubsets Condition="'$(RuntimeFlavor)' == 'Mono' and '$(TargetsMobile)' != 'true'">host.native</DefaultHostSubsets>

<DefaultPacksSubsets>packs.product</DefaultPacksSubsets>
<DefaultPacksSubsets Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'">$(DefaultPacksSubsets)+packs.tests</DefaultPacksSubsets>
<DefaultPacksSubsets Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultPacksSubsets)+packs.installers</DefaultPacksSubsets>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -204,12 +207,12 @@
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\runincontext\runincontext.csproj;
$(CoreClrProjectRoot)tools\r2rdump\R2RDump.csproj;
$(CoreClrProjectRoot)tools\dotnet-pgo\dotnet-pgo.csproj;
$(CoreClrProjectRoot)tools\r2rtest\R2RTest.csproj;
$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2.csproj" Category="clr" />
$(CoreClrProjectRoot)tools\r2rtest\R2RTest.csproj" Category="clr" Condition="'$(DotNetBuildFromSource)' != 'true'"/>
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2.csproj" Category="clr" />

<ProjectToBuild Condition="'$(TargetArchitecture)' != 'x64' and '$(BuildArchitecture)' == 'x64'" Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_crossarch.csproj" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler.TypeSystem.ReadyToRun.Tests\ILCompiler.TypeSystem.ReadyToRun.Tests.csproj"
Test="true" Category="clr" Condition="'$(__DistroRid)' != 'linux-musl-x64'"/>
Test="true" Category="clr" Condition="'$(__DistroRid)' != 'linux-musl-x64' and '$(DotNetBuildFromSource)' != 'true'"/>
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+clr.nativecorelib+'))">
Expand All @@ -221,7 +224,7 @@

<ItemGroup Condition="$(_subset.Contains('+clr.packages+')) and '$(PgoInstrument)' != 'true'">
<ProjectToBuild Include="$(CoreClrProjectRoot).nuget\coreclr-packages.proj" Pack="true" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\dotnet-pgo\dotnet-pgo-pack.proj" Pack="true" BuildInParallel="false" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\dotnet-pgo\dotnet-pgo-pack.proj" Pack="true" BuildInParallel="false" Category="clr" Condition="'$(DotNetBuildFromSource)' != 'true'"/>
</ItemGroup>

<!-- Mono sets -->
Expand Down
1 change: 1 addition & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21311.3">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>4a2b475948d498b89fedef7cf890883f49bc1ea3</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.21311.3">
<Uri>https://github.com/dotnet/arcade</Uri>
Expand Down
4 changes: 0 additions & 4 deletions eng/packaging.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
</PropertyGroup>

<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<!-- Don't build referenced projects -->
<BuildPackageLibraryReferences>false</BuildPackageLibraryReferences>
<!-- Omit any files that were not built -->
<AllowPartialPackages>true</AllowPartialPackages>
<!-- Don't permit harvesting since this requires pre-builts -->
<HarvestStablePackage>false</HarvestStablePackage>
<!-- Validation will fail in case we were relying on harvested assets or assets not built to satisfy stated support -->
Expand Down
10 changes: 10 additions & 0 deletions eng/restore/harvestPackages.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<Project InitialTargets="AddPackageDownload">

<PropertyGroup>
<PackagingTaskAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.packaging\$(MicrosoftDotNetBuildTasksPackagingVersion)\tools\</PackagingTaskAssembly>
<PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' == 'core'">$(PackagingTaskAssembly)netcoreapp3.1\</PackagingTaskAssembly>
<PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' != 'core'">$(PackagingTaskAssembly)net472\</PackagingTaskAssembly>
<!-- TODO: Remove when https://github.com/dotnet/arcade/issues/7413 is fixed. -->
<PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' == 'core' and '$(DotNetBuildFromSource)' == 'true'">$(PackagingTaskAssembly)net5.0\</PackagingTaskAssembly>
<PackagingTaskAssembly>$(PackagingTaskAssembly)Microsoft.DotNet.Build.Tasks.Packaging.dll</PackagingTaskAssembly>
</PropertyGroup>

<UsingTask TaskName="GetLastStablePackage" AssemblyFile="$(PackagingTaskAssembly)"/>
<Target Name="AddPackageDownload">
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<PropertyGroup>
<!-- Build all .NET Framework configurations when net48 is passed in. This is for convenience. -->
<AdditionalBuildTargetFrameworks Condition="'$(BuildTargetFramework)' == 'net48'">net461;net462;net47;net471;net472</AdditionalBuildTargetFrameworks>
<AdditionalBuildTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true' and '$(BuildAllProjects)' == 'true'">$(AdditionalBuildTargetFrameworks);netstandard2.0</AdditionalBuildTargetFrameworks>
</PropertyGroup>

<!-- Define test projects and companions -->
Expand Down
16 changes: 3 additions & 13 deletions src/libraries/libraries-packages.proj
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<Project Sdk="Microsoft.Build.Traversal" DefaultTargets="Pack">

<PropertyGroup>
<AdditionalBuildTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(AdditionalBuildTargetFrameworks);package-$(Configuration)</AdditionalBuildTargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<PackagingTaskAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.packaging\$(MicrosoftDotNetBuildTasksPackagingVersion)\tools\</PackagingTaskAssembly>
<PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' == 'core'">$(PackagingTaskAssembly)netcoreapp3.1\</PackagingTaskAssembly>
<PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' != 'core'">$(PackagingTaskAssembly)net472\</PackagingTaskAssembly>
<PackagingTaskAssembly>$(PackagingTaskAssembly)Microsoft.DotNet.Build.Tasks.Packaging.dll</PackagingTaskAssembly>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" />

<ProjectReference Include="$(PkgDir)*\*.proj" Exclude="$(PkgDir)test\*" />
<ProjectReference Include="$(MSBuildThisFileDirectory)*\src\*.*proj"
Condition="('$(BuildAllConfigurations)' == 'true' or '$(DotNetBuildFromSource)' == 'true')"
Condition="'$(BuildAllConfigurations)' == 'true'"
Exclude="$(MSBuildThisFileDirectory)*\src\**\*.shproj"/>
</ItemGroup>

Expand All @@ -31,7 +22,6 @@
ones that might do this. After we ship a stable set of packages this target should be ran and the
changes to the package index should be commited to the repo.
-->
<UsingTask TaskName="UpdatePackageIndex" AssemblyFile="$(PackagingTaskAssembly)"/>
<Target Name="UpdatePackageIndexWithStableVersions"
BeforeTargets="Build;Pack"
Condition="'$(DotNetFinalVersionKind)' == 'release'">
Expand Down