Skip to content

Commit 2e0058d

Browse files
ArPow stage 1: local source-build infrastructure (#51765)
* ArPow stage 1: local source-build infra
1 parent 98ff130 commit 2e0058d

20 files changed

Lines changed: 2447 additions & 26 deletions

azure-pipelines.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ jobs:
148148
configuration: Debug
149149
testArguments: --testCoreClr --helixQueueName OSX.1014.Amd64.Open
150150

151+
- template: eng/common/templates/jobs/source-build.yml
152+
151153
# Build Correctness Jobs
152154

153155
- job: Correctness_Determinism
@@ -198,30 +200,6 @@ jobs:
198200
publishLocation: Container
199201
condition: succeeded()
200202

201-
- job: Correctness_SourceBuild
202-
pool:
203-
name: NetCorePublic-Pool
204-
queue: BuildPool.Ubuntu.1604.amd64.Open
205-
timeoutInMinutes: 90
206-
steps:
207-
- template: eng/pipelines/checkout-unix-task.yml
208-
209-
- script: ./eng/cibuild.sh --configuration Debug --prepareMachine --binaryLog --sourceBuild
210-
displayName: Build
211-
212-
- template: eng/pipelines/publish-logs.yml
213-
parameters:
214-
jobName: Correctness_SourceBuild
215-
configuration: Release
216-
- task: PublishBuildArtifacts@1
217-
displayName: Publish Logs
218-
inputs:
219-
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/Debug'
220-
ArtifactName: 'SourceBuild_Test'
221-
publishLocation: Container
222-
continueOnError: true
223-
condition: not(succeeded())
224-
225203
- job: Correctness_Rebuild
226204
pool:
227205
name: NetCorePublic-Pool

eng/SourceBuild.props

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<GitHubRepositoryName>roslyn</GitHubRepositoryName>
5+
<SourceBuildManagedOnly>true</SourceBuildManagedOnly>
6+
</PropertyGroup>
7+
8+
<Target Name="ApplySourceBuildPatchFiles"
9+
Condition="
10+
'$(ArcadeBuildFromSource)' == 'true' and
11+
'$(ArcadeInnerBuildFromSource)' == 'true'"
12+
BeforeTargets="Execute">
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="$(RepoRoot)"
20+
Condition="'@(SourceBuildPatchFile)' != ''" />
21+
</Target>
22+
23+
<!--
24+
The build script passes in the full path of the sln to build. This must be overridden in order to build
25+
the cloned source in the inner build.
26+
-->
27+
<Target Name="ConfigureInnerBuildArg" BeforeTargets="GetSourceBuildCommandConfiguration">
28+
<PropertyGroup>
29+
<InnerBuildArgs>$(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)\Compilers.sln"</InnerBuildArgs>
30+
</PropertyGroup>
31+
</Target>
32+
33+
</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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
33
<ProductDependencies>
4+
<Dependency Name="XliffTasks" Version="1.0.0-beta.21215.1">
5+
<Uri>https://github.com/dotnet/xliff-tasks</Uri>
6+
<Sha>7e80445ee82adbf9a8e6ae601ac5e239d982afaa</Sha>
7+
<SourceBuild RepoName="xliff-tasks" ManagedOnly="true" />
8+
</Dependency>
9+
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build" Version="0.1.0-alpha.1.21126.2">
10+
<Uri>https://github.com/dotnet/source-build</Uri>
11+
<Sha>c06ae1212bd69e9fe52bed0b0a7d79cc8ea39054</Sha>
12+
<SourceBuild RepoName="source-build" ManagedOnly="true"/>
13+
</Dependency>
414
</ProductDependencies>
515
<ToolsetDependencies>
616
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21216.2">
717
<Uri>https://github.com/dotnet/arcade</Uri>
818
<Sha>53fe29e220fc0db05eafd5c6bc6c8fb9ee7cec7c</Sha>
19+
<SourceBuild RepoName="arcade" ManagedOnly="true"/>
920
</Dependency>
1021
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="3.10.0-3.21216.10">
1122
<Uri>https://github.com/dotnet/roslyn</Uri>

eng/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ function BuildSolution {
306306
/p:ContinuousIntegrationBuild=$ci \
307307
/p:TreatWarningsAsErrors=true \
308308
/p:TestRuntimeAdditionalArguments=$test_runtime_args \
309-
/p:DotNetBuildFromSource=$source_build \
309+
/p:ArcadeBuildFromSource=$source_build \
310310
$test_runtime \
311311
$mono_tool \
312312
$generate_documentation_file \
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From b3ea2bb3b55f654b32475f214e3d3a4b39e3d3eb Mon Sep 17 00:00:00 2001
2+
From: dseefeld <dseefeld@microsoft.com>
3+
Date: Mon, 15 Jul 2019 19:26:42 +0000
4+
Subject: [PATCH 1/5] Conditionally remove net472 from TargetFrameworks
5+
6+
---
7+
.../Microsoft.Net.Compilers.Toolset.Package.csproj | 3 ++-
8+
1 file changed, 2 insertions(+), 1 deletion(-)
9+
10+
diff --git a/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj b/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj
11+
index 9e646ebab5b..7a27d77877f 100644
12+
--- a/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj
13+
+++ b/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj
14+
@@ -2,6 +2,7 @@
15+
<Project Sdk="Microsoft.NET.Sdk">
16+
<PropertyGroup>
17+
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
18+
+ <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">netcoreapp3.1</TargetFrameworks>
19+
20+
<IsPackable>true</IsPackable>
21+
<NuspecPackageId>Microsoft.Net.Compilers.Toolset</NuspecPackageId>
22+
@@ -51,7 +52,7 @@
23+
<_File Include="@(CoreClrCompilerBinArtifact)" TargetDir="tasks/netcoreapp3.1/bincore"/>
24+
<_File Include="@(CoreClrCompilerBinRuntimesArtifact)" TargetDir="tasks/netcoreapp3.1/bincore/runtimes"/>
25+
26+
- <_File Include="$(MSBuildProjectDirectory)\build\**\*.*" Condition="'$(TargetFramework)' == 'net472'" TargetDir="build" />
27+
+ <_File Include="$(MSBuildProjectDirectory)\build\**\*.*" Condition="'$(TargetFramework)' == 'net472' or '$(DotNetBuildFromSource)' == 'true'" TargetDir="build" />
28+
29+
<TfmSpecificPackageFile Include="@(_File)" PackagePath="%(_File.TargetDir)/%(_File.RecursiveDir)%(_File.FileName)%(_File.Extension)" />
30+
</ItemGroup>
31+
--
32+
2.18.0
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 23af45da9c3fc6718a7d6e1ddcb4891374d40309 Mon Sep 17 00:00:00 2001
2+
From: adaggarwal <aditya.aggarwal@microsoft.com>
3+
Date: Wed, 20 Nov 2019 22:31:11 +0000
4+
Subject: [PATCH 2/5] Do not build NET Fx binaries in source build
5+
6+
---
7+
eng/Versions.props | 2 +-
8+
1 file changed, 1 insertions(+), 1 deletions(-)
9+
10+
diff --git a/eng/Versions.props b/eng/Versions.props
11+
index e7eb20eff11..dc3a737f86a 100644
12+
--- a/eng/Versions.props
13+
+++ b/eng/Versions.props
14+
@@ -253,7 +253,7 @@
15+
<UsingToolSymbolUploader>true</UsingToolSymbolUploader>
16+
<UsingToolNuGetRepack>true</UsingToolNuGetRepack>
17+
<UsingToolVSSDK>true</UsingToolVSSDK>
18+
- <UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
19+
+ <UsingToolNetFrameworkReferenceAssemblies Condition="'$(DotNetBuildFromSource)' != 'true'">true</UsingToolNetFrameworkReferenceAssemblies>
20+
<UsingToolIbcOptimization>true</UsingToolIbcOptimization>
21+
<UsingToolVisualStudioIbcTraining>true</UsingToolVisualStudioIbcTraining>
22+
<UsingToolXliff>true</UsingToolXliff>
23+
--
24+
2.18.0
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From 17c34e0cdbc1a2219dd1a7457c16e32706ee59e3 Mon Sep 17 00:00:00 2001
2+
From: dseefeld <dseefeld@microsoft.com>
3+
Date: Mon, 25 Nov 2019 17:10:34 +0000
4+
Subject: [PATCH 4/5] Include Compilers package projects in source-build
5+
6+
---
7+
.../Microsoft.NETCore.Compilers.Package.csproj | 2 +-
8+
.../Microsoft.Net.Compilers.Toolset.Package.csproj | 2 +-
9+
2 files changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/src/NuGet/Microsoft.NETCore.Compilers/Microsoft.NETCore.Compilers.Package.csproj b/src/NuGet/Microsoft.NETCore.Compilers/Microsoft.NETCore.Compilers.Package.csproj
12+
index a7802b01f5..dcb5df09f2 100644
13+
--- a/src/NuGet/Microsoft.NETCore.Compilers/Microsoft.NETCore.Compilers.Package.csproj
14+
+++ b/src/NuGet/Microsoft.NETCore.Compilers/Microsoft.NETCore.Compilers.Package.csproj
15+
@@ -4,6 +4,7 @@
16+
<TargetFramework>netcoreapp3.1</TargetFramework>
17+
18+
<IsPackable>true</IsPackable>
19+
+ <ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
20+
<NuspecPackageId>Microsoft.NETCore.Compilers</NuspecPackageId>
21+
<IncludeBuildOutput>false</IncludeBuildOutput>
22+
<DevelopmentDependency>true</DevelopmentDependency>
23+
@@ -17,7 +18,6 @@
24+
<ItemGroup>
25+
<ProjectReference Include="..\..\Compilers\CSharp\csc\csc.csproj"/>
26+
<ProjectReference Include="..\..\Compilers\VisualBasic\vbc\vbc.csproj"/>
27+
- <ProjectReference Include="..\..\Interactive\csi\csi.csproj"/>
28+
<ProjectReference Include="..\..\Compilers\Core\MSBuildTask\Microsoft.Build.Tasks.CodeAnalysis.csproj"/>
29+
<ProjectReference Include="..\..\Compilers\Server\VBCSCompiler\VBCSCompiler.csproj"/>
30+
</ItemGroup>
31+
diff --git a/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj b/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj
32+
index 5f8c77e6e2..2178f6f5ee 100644
33+
--- a/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj
34+
+++ b/src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj
35+
@@ -5,6 +5,7 @@
36+
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">netcoreapp3.1</TargetFrameworks>
37+
38+
<IsPackable>true</IsPackable>
39+
+ <ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
40+
<NuspecPackageId>Microsoft.Net.Compilers.Toolset</NuspecPackageId>
41+
<IncludeBuildOutput>false</IncludeBuildOutput>
42+
<DevelopmentDependency>true</DevelopmentDependency>
43+
@@ -31,7 +32,6 @@
44+
<ItemGroup>
45+
<ProjectReference Include="..\..\Compilers\CSharp\csc\csc.csproj" PrivateAssets="All"/>
46+
<ProjectReference Include="..\..\Compilers\VisualBasic\vbc\vbc.csproj" PrivateAssets="All"/>
47+
- <ProjectReference Include="..\..\Interactive\csi\csi.csproj" PrivateAssets="All"/>
48+
<ProjectReference Include="..\..\Compilers\Core\MSBuildTask\Microsoft.Build.Tasks.CodeAnalysis.csproj" PrivateAssets="All"/>
49+
<ProjectReference Include="..\..\Compilers\Server\VBCSCompiler\VBCSCompiler.csproj" PrivateAssets="All"/>
50+
51+
--
52+
2.17.1
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 93a4b6a0a67a211a2e69b198b0e6a98a941d64ce Mon Sep 17 00:00:00 2001
2+
From: Chris Rummel <crummel@microsoft.com>
3+
Date: Fri, 4 Sep 2020 09:32:49 -0500
4+
Subject: [PATCH] Don't restore tools in source-build
5+
6+
---
7+
eng/build.sh | 6 +++---
8+
1 file changed, 3 insertions(+), 3 deletions(-)
9+
10+
diff --git a/eng/build.sh b/eng/build.sh
11+
index eab7422de0a..cf04036b5be 100755
12+
--- a/eng/build.sh
13+
+++ b/eng/build.sh
14+
@@ -319,9 +319,9 @@ if [[ "$restore" == true || "$test_core_clr" == true ]]; then
15+
install=true
16+
fi
17+
InitializeDotNetCli $install
18+
-if [[ "$restore" == true ]]; then
19+
- dotnet tool restore
20+
-fi
21+
+# if [[ "$restore" == true ]]; then
22+
+# dotnet tool restore
23+
+# fi
24+
25+
bootstrap_dir=""
26+
if [[ "$bootstrap" == true ]]; then
27+
--
28+
2.21.3
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From ee8cef65cd2bc322fe005c3c8b96ecbf39f167e0 Mon Sep 17 00:00:00 2001
2+
From: Chris Rummel <crummel@microsoft.com>
3+
Date: Fri, 4 Sep 2020 11:50:51 -0500
4+
Subject: [PATCH 6/6] Dirty revert of
5+
https://github.com/dotnet/roslyn/issues/10785
6+
7+
---
8+
src/Compilers/Shared/BuildClient.cs | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/src/Compilers/Shared/BuildClient.cs b/src/Compilers/Shared/BuildClient.cs
12+
index 4d1660794cb..cb606f3a957 100644
13+
--- a/src/Compilers/Shared/BuildClient.cs
14+
+++ b/src/Compilers/Shared/BuildClient.cs
15+
@@ -84,7 +84,7 @@ internal static int Run(IEnumerable<string> arguments, RequestLanguage language,
16+
{
17+
// Register encodings for console
18+
// https://github.com/dotnet/roslyn/issues/10785
19+
- System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
20+
+ //System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
21+
}
22+
23+
var client = new BuildClient(language, compileFunc, logger);
24+
--
25+
2.21.3

0 commit comments

Comments
 (0)