Skip to content

Commit 1512073

Browse files
committed
docs(dev-guide): mention how to support new compilation targets
1 parent 62df1e9 commit 1512073

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

doc/dev-guide/src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Summary
22

33
- [Introduction](index.md)
4-
- [Linting](linting.md)
4+
- [Linting](linting.md)
55
- [Coding standards](coding-standards.md)
66
- [Version numbers](version-numbers.md)
7+
- [Recipes](recipes.md)
78
- [Release process](release-process.md)
89
- [Tips and tricks](tips-and-tricks.md)
910
- [Tracing](tracing.md)

doc/dev-guide/src/recipes.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Recipes
2+
3+
This section contains some recipes for common tasks that you may want to
4+
perform when contributing to rustup.
5+
6+
## Supporting a new compilation target
7+
8+
Adding support for a new compilation target involves the following steps:
9+
10+
1. Informing rustup of the new target:
11+
12+
Since you are here, it is quite likely that you are promoting a target from
13+
tier 3 to tier 2. As such, it is often sufficient to just cross-compile
14+
rustup from Linux to that target.
15+
16+
You can refer to [rustup#4688] for a practical example for this step. You
17+
can find in that PR nearly all places where you would need to mention your
18+
new target in the rustup codebase.
19+
20+
Notably, you would need to add a line in
21+
`ci/actions-templates/linux-builds-template.yaml` to include it in rustup's
22+
CI, while disabling the build for this target in all scenarios. At the
23+
moment of writing, this is done by appending the YAML comment
24+
`# skip-pr skip-master skip-stable`
25+
at the end of the line when mentioning your target in that file.
26+
27+
[rustup#4688]: https://github.com/rust-lang/rustup/pull/4688
28+
29+
2. Stabilizing the target:
30+
31+
When your new target reaches stable Rust, you can then enable the target in
32+
certain CI scenarios, depending on the popularity of the target. At the
33+
moment of writing, this is done by removing certain occurrences of `skip-*`
34+
in the aforementioned YAML comment. In most cases, you would only need to
35+
enable the target for the `stable` CI scenario by removing `skip-stable`.
36+
37+
You can refer to [rustup#4816] for a practical example for this step.
38+
39+
Do note that when creating the PR for this step, you will need to prove that
40+
the target's CI is indeed working by removing `skip-pr` in a separate commit
41+
to temporarily enable this target in this PR's CI. Once the CI is green, you
42+
can send the link ([example][send-link]) to that CI run in the PR thread for
43+
verification. After that, you can safely drop the temporary commit to get
44+
the PR ready for merging.
45+
46+
[rustup#4816]: https://github.com/rust-lang/rustup/pull/4816
47+
[send-link]: https://github.com/rust-lang/rustup/pull/4816#issuecomment-4263419604

0 commit comments

Comments
 (0)