Skip to content

Commit c70697a

Browse files
authored
Copy docs to master: prep for changing default branch (#1973)
* Reset Documentation dir, README to release/3.1 Docs to be maintained in the default branch.
1 parent 8482f70 commit c70697a

25 files changed

+2680
-49
lines changed
Lines changed: 195 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,195 @@
1-
These documents have moved: https://github.com/dotnet/source-build/tree/release/3.1/Documentation/planning/arcade-powered-source-build
1+
> For the arcade-powered source-build status doc, see [implementation-plan.md](implementation-plan.md).
2+
3+
# Arcade-powered source-build
4+
5+
Source-build existing as a process outside the Microsoft build impedes efforts
6+
to maintain the source-buildability of .NET Core. Integration into the normal
7+
build process is driven by two major goals:
8+
9+
1. When the .NET Core SDK **official build** completes, its artifacts include
10+
validated, ship-ready source-build outputs, in addition to the Microsoft
11+
build outputs.
12+
13+
* **Official builds** produce the signed bits released by Microsoft, running
14+
on a daily or per-commit basis depending on repo and point in time.
15+
16+
* This has two core benefits over the current situation: we know immediately
17+
whether an SDK can be source-built cleanly, and the status is as visible as
18+
an SDK build failure.
19+
20+
* Breaks in source-build can be detected and fixed immediately by repo
21+
owners, just as any other build failure, rather than fixed by source-build
22+
maintainers weeks to months after the fact using patches.
23+
24+
* Microsoft build process owners don't need to reject late build respins
25+
based on manual post-build source-build efforts being projected to not
26+
complete in time for release dates.
27+
28+
* Rebuilding the SDK close to a release day doesn't cause setbacks to
29+
source-build maintainers by throwing away manual build uptake work.
30+
31+
* This eliminates the delay between Microsoft build completion and
32+
source-build tarball availability, as long as we treat a source-build
33+
failure as seriously as a Microsoft build failure.
34+
35+
2. Every repo involved in source-build validates source-buildability in its **PR
36+
validation** build.
37+
38+
* **PR validation** builds run on each pull request submitted to a
39+
repository, and is typically required to succeed to merge. There are also
40+
**rolling builds** that run lower-priority and slower tests after each
41+
merge.
42+
43+
* This allows developers and release owners to understand the source-build
44+
impact of changes, reducing the frequency the source-build servicing team
45+
has to root-cause and patch over problems.
46+
47+
* Gives us a place to add additional checks in the future, such as
48+
[nongranular servicing readiness](../nongranular-servicing-readiness/).
49+
50+
This doc is about where we can start, what incremental progress would look like,
51+
and the vision.
52+
53+
## Starting point: official build
54+
55+
The output of source-build is a set of tarballs that can be used to build the
56+
.NET Core SDK from source. We can move the current behavior of source-build to
57+
the dotnet/installer official build. That is, dotnet/installer clones all
58+
constituent repos, applies patches, builds each repo using customized build
59+
commands, and produces the source-build tarballs as artifacts.
60+
61+
This immediately makes the dotnet/source-build repo unnecessary for 5.0: it only
62+
held the source-build orchestration behavior.
63+
64+
The migration work will be done in a new dev branch. It's expected that the dev
65+
branch will trail significantly behind the active 5.0 working branch: due to
66+
churn with 5.0 auto-updates and the full source-build being way too slow to put
67+
as a PR validation step in dotnet/installer, source-build would probably always
68+
fail if we tried to apply it to the mainline 5.0 branch.
69+
70+
Putting source-build infrastructure into dotnet/installer doesn't directly
71+
accomplish any of our goals. However, it gives us a testbed for infrastructure
72+
that we need to move to dotnet/arcade, so we can be reasonably sure it will work
73+
when we roll it out to each repository. Eventually, the build performance will
74+
improve enough that source-build *can* run in PR validation. At that point, the
75+
dev branch can be merged and our goals will be accomplished.
76+
77+
For more info, see [source-build-in-pipeline.md].
78+
79+
## Starting point: PR validation
80+
81+
We can start here by adding extra jobs that run the standard source-build
82+
command and arguments. This is a simple step to confirm the build isn't
83+
fundamentally broken.
84+
85+
This needs more work to meet our goals for many reasons:
86+
87+
* Prebuilt dependency usage isn't tracked, because all dependencies are
88+
downloaded as non-source-built prebuilts.
89+
* Source-build behavior may not work with source-built upstreams.
90+
* The artifacts built by the repo may not work downstream.
91+
* Advanced build flows aren't checked, such as source-build bootstrap or using
92+
an N-1 SDK.
93+
94+
For more info, see [source-build-in-pipeline.md].
95+
96+
Related work, but not necessary to meet our goals:
97+
98+
* Unit tests are typically disabled in source-build, because test infrastructure
99+
isn't built from source. We should run tests on the source-build product to
100+
catch bugs. However, this isn't necessary to meet the maintainability goals of
101+
this plan.
102+
103+
## Incremental progress
104+
105+
### The performance gap
106+
We need to avoid building all constituent repos in the dotnet/installer build.
107+
To do this, each repo needs to produce intermediate source-built artifacts
108+
during its official build, to be consumed by downstream repos. On the other end,
109+
source-build needs to support restoring from an intermediate artifact.
110+
111+
To make incremental progress, we should pick an upstream of dotnet/installer,
112+
and add source-build functionality that produces source-built intermediates.
113+
dotnet/installer should consume them. We should choose a leaf in the
114+
source-build dependency graph, dotnet/source-build-reference-packages (SBRP).
115+
When dotnet/installer looks at the build graph to determine which repos to
116+
build, instead of building SBRP, it should restore the SBRP intermediate
117+
artifact. Once we have this flow working, the functionality should be integrated
118+
into Arcade SDK for easy onboarding.
119+
120+
Then, working from the bottom (leaves) upward (towards dotnet/installer), more
121+
repos should consume and produce source-built intermediates in their official
122+
builds. When this completes, each repo only needs to build itself. See
123+
[incremental-official.md] for more details about this process.
124+
125+
It is possible to instead only implement official source-build in a handful of
126+
repos. This segments the build into chunks, which must be coherent. This idea is
127+
discussed in [incremental-official-chunked.md], and is not recommended.
128+
129+
> Note: some constituent repos aren't maintained by Microsoft, so it isn't
130+
> feasible to add them directly to this flow. We could fork them and set up a
131+
> build just for source-build intermediates. If a repo builds quickly, however,
132+
> it might be better to simply rebuild it whenever the outputs are needed.
133+
134+
### Getting into Arcade
135+
The initial plan to run source-build in dotnet/installer doesn't assume any
136+
changes to Arcade: this should be possible due to the extension points that
137+
already exist in the Arcade SDK. Once we have that, it will be clearer what
138+
logic is missing, and how to add it. This allows us to migrate source-build
139+
logic incrementally and in parallel with other work.
140+
141+
For more info, see [in-arcade.md].
142+
143+
### The speculative SDK
144+
It's difficult to validate that a PR won't break downstream repos. This problem
145+
is shared by source-build and the Microsoft build. "Speculative builds" have
146+
been proposed to try to help with this, but would be very difficult to implement
147+
in the Microsoft build. It may be more reasonable in the context of
148+
source-build: all builds happen on a single machine, so the problem is focused
149+
on figuring out a build graph rather than organizing dozens of machines in a
150+
build lab and flowing bits across a network.
151+
152+
This is also necessary in source-build to validate several distro maintenance
153+
scenarios: by making a PR, is it still possible to run a bootstrap build of the
154+
.NET Core SDK? Can .NET Core SDK version N be built using SDK N-1?
155+
156+
This can be developed in parallel to other efforts. See [speculative-build.md]
157+
for more info about speculative builds.
158+
159+
## End result
160+
161+
When all of this is working, the official Microsoft build of the .NET Core SDK
162+
also produces tarballs that distro maintainers can use to build it from source.
163+
Contributors in each repo use checks in PR validation to verify each change is
164+
compatible with source-build requirements, and if validation runs into a
165+
problem, they are able to reproduce the build locally using an Arcade build
166+
command.
167+
168+
---
169+
170+
## Q&A
171+
172+
### Q: How do we patch without an orchestration-focused repo?
173+
A: We shouldn't! But if we have to, use a forked branch. See
174+
[patching.md](patching.md).
175+
176+
177+
[in-arcade.md]: in-arcade.md
178+
[incremental-official-chunked.md]: incremental-official-chunked.md
179+
[incremental-official.md]: incremental-official.md
180+
[source-build-in-pipeline.md]: source-build-in-pipeline.md
181+
[speculative-build.md]: speculative-build.md
182+
183+
---
184+
185+
## Revisions:
186+
187+
**2020-07-15** dagood
188+
Removed the plan to test every added intermediate nupkg all the way downstream
189+
in dotnet/installer. Looking at it after some hands-on work has been done, we
190+
don't think this end-to-end integration test is actually feasible. Not running
191+
these tests creates some uncertainty, but it seems acceptable. We will likely
192+
end up with a backlog of unknown issues to work through once we start building a
193+
tarball in dotnet/installer. They *may* have been avoided with testing. We don't
194+
expect this will be disruptive enough to make it worth trying to more
195+
exhaustively find some way to get end-to-end testing feasible.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
// dot.exe implementation-plan-graph.dot -Tsvg -o implementation-plan-graph.svg
2+
3+
digraph {
4+
node[
5+
shape=rect
6+
width=0 height=0 margin=0.07
7+
style=filled
8+
fontsize=11]
9+
edge[
10+
penwidth=1
11+
arrowsize=0.6
12+
arrowhead=vee
13+
pencolor="#444444"]
14+
rankdir=LR
15+
nodesep=0.07
16+
ranksep=0.08
17+
18+
node [fillcolor="#F5F5F5",style="dotted,filled,rounded",tooltip="Built"]
19+
"pre0"[label="Built in 5.0"]
20+
"arcade" "aspnet-xdt" "aspnetcore" "clicommandlineparser" "command-line-api" "fsharp" "msbuild" "nuget-client" "roslyn" "roslyn-analyzers" "runtime" "runtime-portable" "sdk" "templating" "vstest" "installer" "symreader" "common" "test-templates"
21+
22+
node [fillcolor="#F7CAAC",style="filled,diagonals",tooltip="Inputs ready"]
23+
"pre1"[label="Inputs ready"]
24+
"application-insights" "netcorecli-fsc" "newtonsoft-json" "newtonsoft-json901" "xliff-tasks" "humanizer" "linker" "cssparser" "diagnostics"
25+
26+
node [fillcolor="#FFE599",style="dashed,filled,rounded",tooltip="1"]
27+
"s1"[label="#1 - Local build infra"]
28+
"sourcelink"
29+
30+
node [fillcolor="#F0FE86",style="dashed,filled",tooltip="2"]
31+
"s2"[label="#2 - CI implemented"]
32+
33+
node [fillcolor="#B4C6E7",style="bold,filled,rounded",tooltip="3"]
34+
"s3"[label="#3 - Artifacts greenlit"]
35+
"source-build-reference-packages"
36+
37+
node [fillcolor="#CFAFE7",style="bold,filled",tooltip="4"]
38+
"s4"[label="#4 - Prebuilt regressions blocked"]
39+
40+
// Color all future nodes red. All nodes should be accounted for: red means they need a category.
41+
node [fillcolor="#FF0000",style=filled]
42+
43+
subgraph clusterLegend {
44+
style=filled
45+
color="#ebebeb"
46+
"pre0" "pre1" "s1" "s2" "s3" "s4"
47+
}
48+
49+
// Remaining text created by generate-graphviz.proj based on repos/*.proj:
50+
"sourcelink" -> "arcade"
51+
"arcade" -> "aspnet-xdt"
52+
"arcade" -> "aspnetcore"
53+
"cssparser" -> "aspnetcore"
54+
"runtime" -> "aspnetcore"
55+
"msbuild" -> "aspnetcore"
56+
"roslyn" -> "aspnetcore"
57+
"roslyn-analyzers" -> "aspnetcore"
58+
"arcade" -> "clicommandlineparser"
59+
"arcade" -> "command-line-api"
60+
"newtonsoft-json" -> "common"
61+
"arcade" -> "fsharp"
62+
"msbuild" -> "fsharp"
63+
"newtonsoft-json901" -> "fsharp"
64+
"newtonsoft-json" -> "fsharp"
65+
"xliff-tasks" -> "fsharp"
66+
"application-insights" -> "installer"
67+
"arcade" -> "installer"
68+
"aspnetcore" -> "installer"
69+
"clicommandlineparser" -> "installer"
70+
"fsharp" -> "installer"
71+
"msbuild" -> "installer"
72+
"netcorecli-fsc" -> "installer"
73+
"newtonsoft-json" -> "installer"
74+
"newtonsoft-json901" -> "installer"
75+
"nuget-client" -> "installer"
76+
"roslyn" -> "installer"
77+
"runtime" -> "installer"
78+
"sdk" -> "installer"
79+
"templating" -> "installer"
80+
"test-templates" -> "installer"
81+
"vstest" -> "installer"
82+
"xliff-tasks" -> "installer"
83+
"arcade" -> "msbuild"
84+
"runtime" -> "msbuild"
85+
"roslyn" -> "msbuild"
86+
"common" -> "nuget-client"
87+
"newtonsoft-json" -> "nuget-client"
88+
"msbuild" -> "nuget-client"
89+
"aspnet-xdt" -> "nuget-client"
90+
"runtime" -> "roslyn-analyzers"
91+
"roslyn" -> "roslyn-analyzers"
92+
"arcade" -> "roslyn"
93+
"command-line-api" -> "roslyn"
94+
"humanizer" -> "roslyn"
95+
"xliff-tasks" -> "roslyn"
96+
"arcade" -> "runtime-portable"
97+
"linker" -> "runtime-portable"
98+
"newtonsoft-json" -> "runtime-portable"
99+
"newtonsoft-json901" -> "runtime-portable"
100+
"roslyn" -> "runtime-portable"
101+
"arcade" -> "runtime"
102+
"symreader" -> "runtime"
103+
"linker" -> "runtime"
104+
"newtonsoft-json" -> "runtime"
105+
"newtonsoft-json901" -> "runtime"
106+
"roslyn" -> "runtime"
107+
"arcade" -> "sdk"
108+
"xliff-tasks" -> "sdk"
109+
"runtime" -> "sdk"
110+
"msbuild" -> "sdk"
111+
"newtonsoft-json" -> "sdk"
112+
"newtonsoft-json901" -> "sdk"
113+
"nuget-client" -> "sdk"
114+
"roslyn-analyzers" -> "sdk"
115+
"vstest" -> "sdk"
116+
"fsharp" -> "sdk"
117+
"arcade" -> "symreader"
118+
"clicommandlineparser" -> "templating"
119+
"newtonsoft-json" -> "templating"
120+
"arcade" -> "test-templates"
121+
"diagnostics" -> "vstest"
122+
"runtime" -> "vstest"
123+
"newtonsoft-json" -> "vstest"
124+
}

0 commit comments

Comments
 (0)