Skip to content

Commit d19d9ed

Browse files
committed
WIP: Enable source-build through arcade
This enables 'source-build', which makes it easier to build the entire shipping .NET SDK from source. This is the first and second step of arcade-powered-source-build: https://github.com/dotnet/source-build/blob/master/Documentation/planning/arcade-powered-source-build/README.md See dotnet/sourcelink#692 for a similar PR, that this is based on. The `LICENSE` to `LICENSE.txt` rename is hack to work around NuGet/Home#7601 for now.
1 parent 15ab783 commit d19d9ed

File tree

9 files changed

+55
-2
lines changed

9 files changed

+55
-2
lines changed
File renamed without changes.

build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@echo off
2-
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -projects """%~dp0illink.sln""" -restore -build %*"
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build %*"

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ while [[ -h $source ]]; do
1313
done
1414

1515
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
16-
"$scriptroot/eng/common/build.sh" --projects "$scriptroot/illink.sln" --build --restore $@
16+
"$scriptroot/eng/common/build.sh" --build --restore $@

eng/Build.props

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project>
2+
<ItemGroup>
3+
4+
<ProjectToBuild Include="$(RepoRoot)src\linker\Mono.Linker.csproj" />
5+
<ProjectToBuild Include="$(RepoRoot)src\ILLink.Tasks\ILLink.Tasks.csproj" />
6+
<ProjectToBuild Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(RepoRoot)test\Mono.Linker.Tests\Mono.Linker.Tests.csproj" />
7+
<ProjectToBuild Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(RepoRoot)test\Mono.Linker.Tests.Cases\Mono.Linker.Tests.Cases.csproj" />
8+
<ProjectToBuild Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(RepoRoot)test\Mono.Linker.Tests.Cases.Expectations\Mono.Linker.Tests.Cases.Expectations.csproj" />
9+
<ProjectToBuild Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(RepoRoot)src\analyzer\analyzer.csproj" />
10+
<ProjectToBuild Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(RepoRoot)test\ILLink.Tasks.Tests\ILLink.Tasks.Tests.csproj" />
11+
<ProjectToBuild Include="$(RepoRoot)src\ILLink.RoslynAnalyzer\ILLink.RoslynAnalyzer.csproj" />
12+
<ProjectToBuild Include="$(RepoRoot)test\ILLink.RoslynAnalyzer.Tests\ILLink.RoslynAnalyzer.Tests.csproj" />
13+
<ProjectToBuild Include="$(RepoRoot)src\linker\ref\Mono.Linker.csproj" />
14+
<ProjectToBuild Include="$(RepoRoot)src\tlens\tlens.csproj" />
15+
16+
</ItemGroup>
17+
</Project>

eng/SourceBuild.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<GitHubRepositoryName>linker</GitHubRepositoryName>
5+
<SourceBuildManagedOnly>true</SourceBuildManagedOnly>
6+
</PropertyGroup>
7+
8+
</Project>
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21105.5">
77
<Uri>https://github.com/dotnet/arcade</Uri>
88
<Sha>fc83e59329203724d4a63c4f6c843be62983a35e</Sha>
9+
<SourceBuild RepoName="arcade" ManagedOnly="true" />
910
</Dependency>
1011
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="6.0.0-beta.21105.5">
1112
<Uri>https://github.com/dotnet/arcade</Uri>
@@ -14,6 +15,10 @@
1415
<Dependency Name="Microsoft.NET.Sdk.IL" Version="6.0.0-preview.2.21108.2">
1516
<Uri>https://github.com/dotnet/runtime</Uri>
1617
<Sha>a66b4e3bf5e3c5ecb2e9fba771f69b177bd3844e</Sha>
18+
<!--
19+
This would introduce a cyclic dependency, so it's explictly not enabled for now
20+
<SourceBuild RepoName="runtime" />
21+
-->
1722
</Dependency>
1823
</ToolsetDependencies>
1924
</Dependencies>

eng/azure-pipelines.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ stages:
4444
testResultsFormat: vstest
4545
enablePublishBuildAssets: true # generate build manifests and publish to BAR in internal builds
4646
enableMicrobuild: true # only affects internal builds
47+
# See https://github.com/dotnet/source-build/issues/2049
48+
# enableSourceBuild: true
4749

4850
jobs:
4951

@@ -84,6 +86,20 @@ stages:
8486
${{ if eq(variables.officialBuild, 'true') }}:
8587
displayName: Build and publish illink.sln $(_BuildConfig)
8688

89+
- job: SourceBuild_Managed
90+
displayName: Source-Build (Managed)
91+
pool:
92+
vmImage: ubuntu-20.04
93+
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'
94+
workspace:
95+
clean: all
96+
steps:
97+
- checkout: self
98+
submodules: true
99+
- template: /eng/common/templates/steps/source-build.yml
100+
parameters:
101+
enablePublishTestResults: true
102+
87103
- ${{ if eq(variables.officialBuild, 'false') }}:
88104
- job: Linux
89105
condition: eq(variables.officialBuild, 'false')

src/linker/Mono.Linker.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5+
<!-- This apphost is not necessary for source-build. Remove it to avoid a prebuilt. See https://github.com/dotnet/source-build/issues/1905 -->
6+
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
57
<Nullable>disable</Nullable>
68
<ServerGarbageCollection>true</ServerGarbageCollection>
79
</PropertyGroup>

0 commit comments

Comments
 (0)