]> git.proxmox.com Git - rustc.git/blob - src/doc/rustc/src/target-tier-policy.md
New upstream version 1.60.0+dfsg1
[rustc.git] / src / doc / rustc / src / target-tier-policy.md
1 # Target Tier Policy
2
3 ## Table of Contents
4
5 * [General](#general)
6 * [Tier 3 target policy](#tier-3-target-policy)
7 * [Tier 2 target policy](#tier-2-target-policy)
8 * [Tier 2 with host tools](#tier-2-with-host-tools)
9 * [Tier 1 target policy](#tier-1-target-policy)
10 * [Tier 1 with host tools](#tier-1-with-host-tools)
11
12 ## General
13
14 Rust provides three tiers of target support:
15
16 - Rust provides no guarantees about tier 3 targets; they exist in the codebase,
17 but may or may not build.
18 - Rust's continuous integration checks that tier 2 targets will always build,
19 but they may or may not pass tests.
20 - Rust's continuous integration checks that tier 1 targets will always build
21 and pass tests.
22
23 Adding a new tier 3 target imposes minimal requirements; we focus primarily on
24 avoiding disruption to other ongoing Rust development.
25
26 Tier 2 and tier 1 targets place work on Rust project developers as a whole, to
27 avoid breaking the target. The broader Rust community may also feel more
28 inclined to support higher-tier targets in their crates (though they are not
29 obligated to do so). Thus, these tiers require commensurate and ongoing efforts
30 from the maintainers of the target, to demonstrate value and to minimize any
31 disruptions to ongoing Rust development.
32
33 This policy defines the requirements for accepting a proposed target at a given
34 level of support.
35
36 Each tier builds on all the requirements from the previous tier, unless
37 overridden by a stronger requirement. Targets at tier 2 and tier 1 may also
38 provide *host tools* (such as `rustc` and `cargo`); each of those tiers
39 includes a set of supplementary requirements that must be met if supplying host
40 tools for the target. A target at tier 2 or tier 1 is not required to supply
41 host tools, but if it does, it must meet the corresponding additional
42 requirements for host tools.
43
44 The policy for each tier also documents the Rust governance teams that must
45 approve the addition of any target at that tier. Those teams are responsible
46 for reviewing and evaluating the target, based on these requirements and their
47 own judgment. Those teams may apply additional requirements, including
48 subjective requirements, such as to deal with issues not foreseen by this
49 policy. (Such requirements may subsequently motivate additions to this policy.)
50
51 While these criteria attempt to document the policy, that policy still involves
52 human judgment. Targets must fulfill the spirit of the requirements as well, as
53 determined by the judgment of the approving teams. Reviewers and team members
54 evaluating targets and target-specific patches should always use their own best
55 judgment regarding the quality of work, and the suitability of a target for the
56 Rust project. Neither this policy nor any decisions made regarding targets
57 shall create any binding agreement or estoppel by any party.
58
59 Before filing an issue or pull request (PR) to introduce or promote a target,
60 the target should already meet the corresponding tier requirements. This does
61 not preclude an existing target's maintainers using issues (on the Rust
62 repository or otherwise) to track requirements that have not yet been met, as
63 appropriate; however, before officially proposing the introduction or promotion
64 of a target, it should meet all of the necessary requirements. A target
65 proposal must quote the corresponding requirements verbatim and respond to them
66 as part of explaining how the target meets those requirements. (For the
67 requirements that simply state that the target or the target developers must
68 not do something, it suffices to acknowledge the requirement.)
69
70 For a list of all supported targets and their corresponding tiers ("tier 3",
71 "tier 2", "tier 2 with host tools", "tier 1", or "tier 1 with host tools"), see
72 [platform support](platform-support.md).
73
74 Several parts of this policy require providing target-specific documentation.
75 Such documentation should typically appear in a subdirectory of the
76 platform-support section of this rustc manual, with a link from the target's
77 entry in [platform support](platform-support.md). Use
78 [TEMPLATE.md](platform-support/TEMPLATE.md) as a base, and see other
79 documentation in that directory for examples.
80
81 Note that a target must have already received approval for the next lower tier,
82 and spent a reasonable amount of time at that tier, before making a proposal
83 for promotion to the next higher tier; this is true even if a target meets the
84 requirements for several tiers at once. This policy leaves the precise
85 interpretation of "reasonable amount of time" up to the approving teams; those
86 teams may scale the amount of time required based on their confidence in the
87 target and its demonstrated track record at its current tier. At a minimum,
88 multiple stable releases of Rust should typically occur between promotions of a
89 target.
90
91 The availability or tier of a target in stable Rust is not a hard stability
92 guarantee about the future availability or tier of that target. Higher-level
93 target tiers are an increasing commitment to the support of a target, and we
94 will take that commitment and potential disruptions into account when
95 evaluating the potential demotion or removal of a target that has been part of
96 a stable release. The promotion or demotion of a target will not generally
97 affect existing stable releases, only current development and future releases.
98
99 In this policy, the words "must" and "must not" specify absolute requirements
100 that a target must meet to qualify for a tier. The words "should" and "should
101 not" specify requirements that apply in almost all cases, but for which the
102 approving teams may grant an exception for good reason. The word "may"
103 indicates something entirely optional, and does not indicate guidance or
104 recommendations. This language is based on [IETF RFC
105 2119](https://tools.ietf.org/html/rfc2119).
106
107 ## Tier 3 target policy
108
109 At this tier, the Rust project provides no official support for a target, so we
110 place minimal requirements on the introduction of targets.
111
112 A proposed new tier 3 target must be reviewed and approved by a member of the
113 compiler team based on these requirements. The reviewer may choose to gauge
114 broader compiler team consensus via a [Major Change Proposal (MCP)][MCP].
115
116 A proposed target or target-specific patch that substantially changes code
117 shared with other targets (not just target-specific code) must be reviewed and
118 approved by the appropriate team for that shared code before acceptance.
119
120 - A tier 3 target must have a designated developer or developers (the "target
121 maintainers") on record to be CCed when issues arise regarding the target.
122 (The mechanism to track and CC such developers may evolve over time.)
123 - Targets must use naming consistent with any existing targets; for instance, a
124 target for the same CPU or OS as an existing Rust target should use the same
125 name for that CPU or OS. Targets should normally use the same names and
126 naming conventions as used elsewhere in the broader ecosystem beyond Rust
127 (such as in other toolchains), unless they have a very good reason to
128 diverge. Changing the name of a target can be highly disruptive, especially
129 once the target reaches a higher tier, so getting the name right is important
130 even for a tier 3 target.
131 - Target names should not introduce undue confusion or ambiguity unless
132 absolutely necessary to maintain ecosystem compatibility. For example, if
133 the name of the target makes people extremely likely to form incorrect
134 beliefs about what it targets, the name should be changed or augmented to
135 disambiguate it.
136 - Tier 3 targets may have unusual requirements to build or use, but must not
137 create legal issues or impose onerous legal terms for the Rust project or for
138 Rust developers or users.
139 - The target must not introduce license incompatibilities.
140 - Anything added to the Rust repository must be under the standard Rust
141 license (`MIT OR Apache-2.0`).
142 - The target must not cause the Rust tools or libraries built for any other
143 host (even when supporting cross-compilation to the target) to depend
144 on any new dependency less permissive than the Rust licensing policy. This
145 applies whether the dependency is a Rust crate that would require adding
146 new license exceptions (as specified by the `tidy` tool in the
147 rust-lang/rust repository), or whether the dependency is a native library
148 or binary. In other words, the introduction of the target must not cause a
149 user installing or running a version of Rust or the Rust tools to be
150 subject to any new license requirements.
151 - Compiling, linking, and emitting functional binaries, libraries, or other
152 code for the target (whether hosted on the target itself or cross-compiling
153 from another target) must not depend on proprietary (non-FOSS) libraries.
154 Host tools built for the target itself may depend on the ordinary runtime
155 libraries supplied by the platform and commonly used by other applications
156 built for the target, but those libraries must not be required for code
157 generation for the target; cross-compilation to the target must not require
158 such libraries at all. For instance, `rustc` built for the target may
159 depend on a common proprietary C runtime library or console output library,
160 but must not depend on a proprietary code generation library or code
161 optimization library. Rust's license permits such combinations, but the
162 Rust project has no interest in maintaining such combinations within the
163 scope of Rust itself, even at tier 3.
164 - "onerous" here is an intentionally subjective term. At a minimum, "onerous"
165 legal/licensing terms include but are *not* limited to: non-disclosure
166 requirements, non-compete requirements, contributor license agreements
167 (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms,
168 requirements conditional on the employer or employment of any particular
169 Rust developers, revocable terms, any requirements that create liability
170 for the Rust project or its developers or users, or any requirements that
171 adversely affect the livelihood or prospects of the Rust project or its
172 developers or users.
173 - Neither this policy nor any decisions made regarding targets shall create any
174 binding agreement or estoppel by any party. If any member of an approving
175 Rust team serves as one of the maintainers of a target, or has any legal or
176 employment requirement (explicit or implicit) that might affect their
177 decisions regarding a target, they must recuse themselves from any approval
178 decisions regarding the target's tier status, though they may otherwise
179 participate in discussions.
180 - This requirement does not prevent part or all of this policy from being
181 cited in an explicit contract or work agreement (e.g. to implement or
182 maintain support for a target). This requirement exists to ensure that a
183 developer or team responsible for reviewing and approving a target does not
184 face any legal threats or obligations that would prevent them from freely
185 exercising their judgment in such approval, even if such judgment involves
186 subjective matters or goes beyond the letter of these requirements.
187 - Tier 3 targets should attempt to implement as much of the standard libraries
188 as possible and appropriate (`core` for most targets, `alloc` for targets
189 that can support dynamic memory allocation, `std` for targets with an
190 operating system or equivalent layer of system-provided functionality), but
191 may leave some code unimplemented (either unavailable or stubbed out as
192 appropriate), whether because the target makes it impossible to implement or
193 challenging to implement. The authors of pull requests are not obligated to
194 avoid calling any portions of the standard library on the basis of a tier 3
195 target not implementing those portions.
196 - The target must provide documentation for the Rust community explaining how
197 to build for the target, using cross-compilation if possible. If the target
198 supports running binaries, or running tests (even if they do not pass), the
199 documentation must explain how to run such binaries or tests for the target,
200 using emulation if possible or dedicated hardware if necessary.
201 - Tier 3 targets must not impose burden on the authors of pull requests, or
202 other developers in the community, to maintain the target. In particular,
203 do not post comments (automated or manual) on a PR that derail or suggest a
204 block on the PR based on a tier 3 target. Do not send automated messages or
205 notifications (via any medium, including via `@`) to a PR author or others
206 involved with a PR regarding a tier 3 target, unless they have opted into
207 such messages.
208 - Backlinks such as those generated by the issue/PR tracker when linking to
209 an issue or PR are not considered a violation of this policy, within
210 reason. However, such messages (even on a separate repository) must not
211 generate notifications to anyone involved with a PR who has not requested
212 such notifications.
213 - Patches adding or updating tier 3 targets must not break any existing tier 2
214 or tier 1 target, and must not knowingly break another tier 3 target without
215 approval of either the compiler team or the maintainers of the other tier 3
216 target.
217 - In particular, this may come up when working on closely related targets,
218 such as variations of the same architecture with different features. Avoid
219 introducing unconditional uses of features that another variation of the
220 target may not have; use conditional compilation or runtime detection, as
221 appropriate, to let each target run code supported by that target.
222
223 If a tier 3 target stops meeting these requirements, or the target maintainers
224 no longer have interest or time, or the target shows no signs of activity and
225 has not built for some time, or removing the target would improve the quality
226 of the Rust codebase, we may post a PR to remove it; any such PR will be CCed
227 to the target maintainers (and potentially other people who have previously
228 worked on the target), to check potential interest in improving the situation.
229
230 ## Tier 2 target policy
231
232 At this tier, the Rust project guarantees that a target builds, and will reject
233 patches that fail to build on a target. Thus, we place requirements that ensure
234 the target will not block forward progress of the Rust project.
235
236 A proposed new tier 2 target must be reviewed and approved by the compiler team
237 based on these requirements. Such review and approval may occur via a [Major
238 Change Proposal (MCP)][MCP].
239
240 In addition, the infrastructure team must approve the integration of the target
241 into Continuous Integration (CI), and the tier 2 CI-related requirements. This
242 review and approval may take place in a PR adding the target to CI, or simply
243 by an infrastructure team member reporting the outcome of a team discussion.
244
245 - A tier 2 target must have value to people other than its maintainers. (It may
246 still be a niche target, but it must not be exclusively useful for an
247 inherently closed group.)
248 - A tier 2 target must have a designated team of developers (the "target
249 maintainers") available to consult on target-specific build-breaking issues,
250 or if necessary to develop target-specific language or library implementation
251 details. This team must have at least 2 developers.
252 - The target maintainers should not only fix target-specific issues, but
253 should use any such issue as an opportunity to educate the Rust community
254 about portability to their target, and enhance documentation of the target.
255 - The target must not place undue burden on Rust developers not specifically
256 concerned with that target. Rust developers are expected to not gratuitously
257 break a tier 2 target, but are not expected to become experts in every tier 2
258 target, and are not expected to provide target-specific implementations for
259 every tier 2 target.
260 - The target must provide documentation for the Rust community explaining how
261 to build for the target using cross-compilation, and explaining how to run
262 tests for the target. If at all possible, this documentation should show how
263 to run Rust programs and tests for the target using emulation, to allow
264 anyone to do so. If the target cannot be feasibly emulated, the documentation
265 should explain how to obtain and work with physical hardware, cloud systems,
266 or equivalent.
267 - The target must document its baseline expectations for the features or
268 versions of CPUs, operating systems, libraries, runtime environments, and
269 similar.
270 - If introducing a new tier 2 or higher target that is identical to an existing
271 Rust target except for the baseline expectations for the features or versions
272 of CPUs, operating systems, libraries, runtime environments, and similar,
273 then the proposed target must document to the satisfaction of the approving
274 teams why the specific difference in baseline expectations provides
275 sufficient value to justify a separate target.
276 - Note that in some cases, based on the usage of existing targets within the
277 Rust community, Rust developers or a target's maintainers may wish to
278 modify the baseline expectations of a target, or split an existing target
279 into multiple targets with different baseline expectations. A proposal to
280 do so will be treated similarly to the analogous promotion, demotion, or
281 removal of a target, according to this policy, with the same team approvals
282 required.
283 - For instance, if an OS version has become obsolete and unsupported, a
284 target for that OS may raise its baseline expectations for OS version
285 (treated as though removing a target corresponding to the older
286 versions), or a target for that OS may split out support for older OS
287 versions into a lower-tier target (treated as though demoting a target
288 corresponding to the older versions, and requiring justification for a
289 new target at a lower tier for the older OS versions).
290 - Tier 2 targets must not leave any significant portions of `core` or the
291 standard library unimplemented or stubbed out, unless they cannot possibly be
292 supported on the target.
293 - The right approach to handling a missing feature from a target may depend
294 on whether the target seems likely to develop the feature in the future. In
295 some cases, a target may be co-developed along with Rust support, and Rust
296 may gain new features on the target as that target gains the capabilities
297 to support those features.
298 - As an exception, a target identical to an existing tier 1 target except for
299 lower baseline expectations for the OS, CPU, or similar, may propose to
300 qualify as tier 2 (but not higher) without support for `std` if the target
301 will primarily be used in `no_std` applications, to reduce the support
302 burden for the standard library. In this case, evaluation of the proposed
303 target's value will take this limitation into account.
304 - The code generation backend for the target should not have deficiencies that
305 invalidate Rust safety properties, as evaluated by the Rust compiler team.
306 (This requirement does not apply to arbitrary security enhancements or
307 mitigations provided by code generation backends, only to those properties
308 needed to ensure safe Rust code cannot cause undefined behavior or other
309 unsoundness.) If this requirement does not hold, the target must clearly and
310 prominently document any such limitations as part of the target's entry in
311 the target tier list, and ideally also via a failing test in the testsuite.
312 The Rust compiler team must be satisfied with the balance between these
313 limitations and the difficulty of implementing the necessary features.
314 - For example, if Rust relies on a specific code generation feature to ensure
315 that safe code cannot overflow the stack, the code generation for the
316 target should support that feature.
317 - If the Rust compiler introduces new safety properties (such as via new
318 capabilities of a compiler backend), the Rust compiler team will determine
319 if they consider those new safety properties a best-effort improvement for
320 specific targets, or a required property for all Rust targets. In the
321 latter case, the compiler team may require the maintainers of existing
322 targets to either implement and confirm support for the property or update
323 the target tier list with documentation of the missing property.
324 - If the target supports C code, and the target has an interoperable calling
325 convention for C code, the Rust target must support that C calling convention
326 for the platform via `extern "C"`. The C calling convention does not need to
327 be the default Rust calling convention for the target, however.
328 - The target must build reliably in CI, for all components that Rust's CI
329 considers mandatory.
330 - The approving teams may additionally require that a subset of tests pass in
331 CI, such as enough to build a functional "hello world" program, `./x.py test
332 --no-run`, or equivalent "smoke tests". In particular, this requirement may
333 apply if the target builds host tools, or if the tests in question provide
334 substantial value via early detection of critical problems.
335 - Building the target in CI must not take substantially longer than the current
336 slowest target in CI, and should not substantially raise the maintenance
337 burden of the CI infrastructure. This requirement is subjective, to be
338 evaluated by the infrastructure team, and will take the community importance
339 of the target into account.
340 - Tier 2 targets should, if at all possible, support cross-compiling. Tier 2
341 targets should not require using the target as the host for builds, even if
342 the target supports host tools.
343 - In addition to the legal requirements for all targets (specified in the tier
344 3 requirements), because a tier 2 target typically involves the Rust project
345 building and supplying various compiled binaries, incorporating the target
346 and redistributing any resulting compiled binaries (e.g. built libraries,
347 host tools if any) must not impose any onerous license requirements on any
348 members of the Rust project, including infrastructure team members and those
349 operating CI systems. This is a subjective requirement, to be evaluated by
350 the approving teams.
351 - As an exception to this, if the target's primary purpose is to build
352 components for a Free and Open Source Software (FOSS) project licensed
353 under "copyleft" terms (terms which require licensing other code under
354 compatible FOSS terms), such as kernel modules or plugins, then the
355 standard libraries for the target may potentially be subject to copyleft
356 terms, as long as such terms are satisfied by Rust's existing practices of
357 providing full corresponding source code. Note that anything added to the
358 Rust repository itself must still use Rust's standard license terms.
359 - Tier 2 targets must not impose burden on the authors of pull requests, or
360 other developers in the community, to ensure that tests pass for the target.
361 In particular, do not post comments (automated or manual) on a PR that derail
362 or suggest a block on the PR based on tests failing for the target. Do not
363 send automated messages or notifications (via any medium, including via `@`)
364 to a PR author or others involved with a PR regarding the PR breaking tests
365 on a tier 2 target, unless they have opted into such messages.
366 - Backlinks such as those generated by the issue/PR tracker when linking to
367 an issue or PR are not considered a violation of this policy, within
368 reason. However, such messages (even on a separate repository) must not
369 generate notifications to anyone involved with a PR who has not requested
370 such notifications.
371 - The target maintainers should regularly run the testsuite for the target, and
372 should fix any test failures in a reasonably timely fashion.
373 - All requirements for tier 3 apply.
374
375 A tier 2 target may be demoted or removed if it no longer meets these
376 requirements. Any proposal for demotion or removal will be CCed to the target
377 maintainers, and will be communicated widely to the Rust community before being
378 dropped from a stable release. (The amount of time between such communication
379 and the next stable release may depend on the nature and severity of the failed
380 requirement, the timing of its discovery, whether the target has been part of a
381 stable release yet, and whether the demotion or removal can be a planned and
382 scheduled action.)
383
384 In some circumstances, especially if the target maintainers do not respond in a
385 timely fashion, Rust teams may land pull requests that temporarily disable some
386 targets in the nightly compiler, in order to implement a feature not yet
387 supported by those targets. (As an example, this happened when introducing the
388 128-bit types `u128` and `i128`.) Such a pull request will include notification
389 and coordination with the maintainers of such targets, and will ideally happen
390 towards the beginning of a new development cycle to give maintainers time to
391 update their targets. The maintainers of such targets will then be expected to
392 implement the corresponding target-specific support in order to re-enable the
393 target. If the maintainers of such targets cannot provide such support in time
394 for the next stable release, this may result in demoting or removing the
395 targets.
396
397 ### Tier 2 with host tools
398
399 Some tier 2 targets may additionally have binaries built to run on them as a
400 host (such as `rustc` and `cargo`). This allows the target to be used as a
401 development platform, not just a compilation target.
402
403 A proposed new tier 2 target with host tools must be reviewed and approved by
404 the compiler team based on these requirements. Such review and approval may
405 occur via a [Major Change Proposal (MCP)][MCP].
406
407 In addition, the infrastructure team must approve the integration of the
408 target's host tools into Continuous Integration (CI), and the CI-related
409 requirements for host tools. This review and approval may take place in a PR
410 adding the target's host tools to CI, or simply by an infrastructure team
411 member reporting the outcome of a team discussion.
412
413 - Depending on the target, its capabilities, its performance, and the
414 likelihood of use for any given tool, the host tools provided for a tier 2
415 target may include only `rustc` and `cargo`, or may include additional tools
416 such as `clippy` and `rustfmt`.
417 - Approval of host tools will take into account the additional time required to
418 build the host tools, and the substantial additional storage required for the
419 host tools.
420 - The host tools must have direct value to people other than the target's
421 maintainers. (It may still be a niche target, but the host tools must not be
422 exclusively useful for an inherently closed group.) This requirement will be
423 evaluated independently from the corresponding tier 2 requirement.
424 - The requirement to provide "direct value" means that it does not suffice to
425 argue that having host tools will help the target's maintainers more easily
426 provide the target to others. The tools themselves must provide value to
427 others.
428 - There must be a reasonable expectation that the host tools will be used, for
429 purposes other than to prove that they can be used.
430 - The host tools must build and run reliably in CI (for all components that
431 Rust's CI considers mandatory), though they may or may not pass tests.
432 - Building host tools for the target must not take substantially longer than
433 building host tools for other targets, and should not substantially raise the
434 maintenance burden of the CI infrastructure.
435 - The host tools must provide a substantively similar experience as on other
436 targets, subject to reasonable target limitations.
437 - Adding a substantively different interface to an existing tool, or a
438 target-specific interface to the functionality of an existing tool,
439 requires design and implementation approval (e.g. RFC/MCP) from the
440 appropriate approving teams for that tool.
441 - Such an interface should have a design that could potentially work for
442 other targets with similar properties.
443 - This should happen separately from the review and approval of the target,
444 to simplify the target review and approval processes, and to simplify the
445 review and approval processes for the proposed new interface.
446 - By way of example, a target that runs within a sandbox may need to modify
447 the handling of files, tool invocation, and similar to meet the
448 expectations and conventions of the sandbox, but must not introduce a
449 separate "sandboxed compilation" interface separate from the CLI interface
450 without going through the normal approval process for such an interface.
451 Such an interface should take into account potential other targets with
452 similar sandboxes.
453 - If the host tools for the platform would normally be expected to be signed or
454 equivalent (e.g. if running unsigned binaries or similar involves a
455 "developer mode" or an additional prompt), it must be possible for the Rust
456 project's automated builds to apply the appropriate signature process,
457 without any manual intervention by either Rust developers, target
458 maintainers, or a third party. This process must meet the approval of the
459 infrastructure team.
460 - This process may require one-time or semi-regular manual steps by the
461 infrastructure team, such as registration or renewal of a signing key. Any
462 such manual process must meet the approval of the infrastructure team.
463 - This process may require the execution of a legal agreement with the
464 signature provider. Such a legal agreement may be revocable, and may
465 potentially require a nominal fee, but must not be otherwise onerous. Any
466 such legal agreement must meet the approval of the infrastructure team.
467 (The infrastructure team is not expected or required to sign binding legal
468 agreements on behalf of the Rust project; this review and approval exists
469 to ensure no terms are onerous or cause problems for infrastructure,
470 especially if such terms may impose requirements or obligations on people
471 who have access to target-specific infrastructure.)
472 - Changes to this process, or to any legal agreements involved, may
473 cause a target to stop meeting this requirement.
474 - This process involved must be available under substantially similar
475 non-onerous terms to the general public. Making it available exclusively to
476 the Rust project does not suffice.
477 - This requirement exists to ensure that Rust builds, including nightly
478 builds, can meet the necessary requirements to allow users to smoothly run
479 the host tools.
480 - Providing host tools does not exempt a target from requirements to support
481 cross-compilation if at all possible.
482 - All requirements for tier 2 apply.
483
484 A target may be promoted directly from tier 3 to tier 2 with host tools if it
485 meets all the necessary requirements, but doing so may introduce substantial
486 additional complexity. If in doubt, the target should qualify for tier 2
487 without host tools first.
488
489 ## Tier 1 target policy
490
491 At this tier, the Rust project guarantees that a target builds and passes all
492 tests, and will reject patches that fail to build or pass the testsuite on a
493 target. We hold tier 1 targets to our highest standard of requirements.
494
495 A proposed new tier 1 target must be reviewed and approved by the compiler team
496 based on these requirements. In addition, the release team must approve the
497 viability and value of supporting the target. For a tier 1 target, this will
498 typically take place via a full RFC proposing the target, to be jointly
499 reviewed and approved by the compiler team and release team.
500
501 In addition, the infrastructure team must approve the integration of the target
502 into Continuous Integration (CI), and the tier 1 CI-related requirements. This
503 review and approval may take place in a PR adding the target to CI, by an
504 infrastructure team member reporting the outcome of a team discussion, or by
505 including the infrastructure team in the RFC proposing the target.
506
507 - Tier 1 targets must have substantial, widespread interest within the
508 developer community, and must serve the ongoing needs of multiple production
509 users of Rust across multiple organizations or projects. These requirements
510 are subjective, and determined by consensus of the approving teams. A tier 1
511 target may be demoted or removed if it becomes obsolete or no longer meets
512 this requirement.
513 - The target maintainer team must include at least 3 developers.
514 - The target must build and pass tests reliably in CI, for all components that
515 Rust's CI considers mandatory.
516 - The target must not disable an excessive number of tests or pieces of tests
517 in the testsuite in order to do so. This is a subjective requirement.
518 - If the target does not have host tools support, or if the target has low
519 performance, the infrastructure team may choose to have CI cross-compile
520 the testsuite from another platform, and then run the compiled tests
521 either natively or via accurate emulation. However, the approving teams may
522 take such performance considerations into account when determining the
523 viability of the target or of its host tools.
524 - The target must provide as much of the Rust standard library as is feasible
525 and appropriate to provide. For instance, if the target can support dynamic
526 memory allocation, it must provide an implementation of `alloc` and the
527 associated data structures.
528 - Building the target and running the testsuite for the target must not take
529 substantially longer than other targets, and should not substantially raise
530 the maintenance burden of the CI infrastructure.
531 - In particular, if building the target takes a reasonable amount of time,
532 but the target cannot run the testsuite in a timely fashion due to low
533 performance of either native code or accurate emulation, that alone may
534 prevent the target from qualifying as tier 1.
535 - If running the testsuite requires additional infrastructure (such as physical
536 systems running the target), the target maintainers must arrange to provide
537 such resources to the Rust project, to the satisfaction and approval of the
538 Rust infrastructure team.
539 - Such resources may be provided via cloud systems, via emulation, or via
540 physical hardware.
541 - If the target requires the use of emulation to meet any of the tier
542 requirements, the approving teams for those requirements must have high
543 confidence in the accuracy of the emulation, such that discrepancies
544 between emulation and native operation that affect test results will
545 constitute a high-priority bug in either the emulation or the
546 implementation of the target.
547 - If it is not possible to run the target via emulation, these resources must
548 additionally be sufficient for the Rust infrastructure team to make them
549 available for access by Rust team members, for the purposes of development
550 and testing. (Note that the responsibility for doing target-specific
551 development to keep the target well maintained remains with the target
552 maintainers. This requirement ensures that it is possible for other
553 Rust developers to test the target, but does not obligate other Rust
554 developers to make target-specific fixes.)
555 - Resources provided for CI and similar infrastructure must be available for
556 continuous exclusive use by the Rust project. Resources provided
557 for access by Rust team members for development and testing must be
558 available on an exclusive basis when in use, but need not be available on a
559 continuous basis when not in use.
560 - Tier 1 targets must not have a hard requirement for signed, verified, or
561 otherwise "approved" binaries. Developers must be able to build, run, and
562 test binaries for the target on systems they control, or provide such
563 binaries for others to run. (Doing so may require enabling some appropriate
564 "developer mode" on such systems, but must not require the payment of any
565 additional fee or other consideration, or agreement to any onerous legal
566 agreements.)
567 - The Rust project may decide to supply appropriately signed binaries if
568 doing so provides a smoother experience for developers using the target,
569 and a tier 2 target with host tools already requires providing appropriate
570 mechanisms that enable our infrastructure to provide such signed binaries.
571 However, this additional tier 1 requirement ensures that Rust developers
572 can develop and test Rust software for the target (including Rust itself),
573 and that development or testing for the target is not limited.
574 - All requirements for tier 2 apply.
575
576 A tier 1 target may be demoted if it no longer meets these requirements but
577 still meets the requirements for a lower tier. Any proposal for demotion of a
578 tier 1 target requires a full RFC process, with approval by the compiler and
579 release teams. Any such proposal will be communicated widely to the Rust
580 community, both when initially proposed and before being dropped from a stable
581 release. A tier 1 target is highly unlikely to be directly removed without
582 first being demoted to tier 2 or tier 3. (The amount of time between such
583 communication and the next stable release may depend on the nature and severity
584 of the failed requirement, the timing of its discovery, whether the target has
585 been part of a stable release yet, and whether the demotion or removal can be a
586 planned and scheduled action.)
587
588 Raising the baseline expectations of a tier 1 target (such as the minimum CPU
589 features or OS version required) requires the approval of the compiler and
590 release teams, and should be widely communicated as well, but does not
591 necessarily require a full RFC.
592
593 ### Tier 1 with host tools
594
595 Some tier 1 targets may additionally have binaries built to run on them as a
596 host (such as `rustc` and `cargo`). This allows the target to be used as a
597 development platform, not just a compilation target.
598
599 A proposed new tier 1 target with host tools must be reviewed and approved by
600 the compiler team based on these requirements. In addition, the release team
601 must approve the viability and value of supporting host tools for the target.
602 For a tier 1 target, this will typically take place via a full RFC proposing
603 the target, to be jointly reviewed and approved by the compiler team and
604 release team.
605
606 In addition, the infrastructure team must approve the integration of the
607 target's host tools into Continuous Integration (CI), and the CI-related
608 requirements for host tools. This review and approval may take place in a PR
609 adding the target's host tools to CI, by an infrastructure team member
610 reporting the outcome of a team discussion, or by including the infrastructure
611 team in the RFC proposing the target.
612
613 - Tier 1 targets with host tools should typically include all of the additional
614 tools such as `clippy` and `rustfmt`, unless there is a target-specific
615 reason why a tool cannot possibly make sense for the target.
616 - Unlike with tier 2, for tier 1 we will not exclude specific tools on the
617 sole basis of them being less likely to be used; rather, we'll take that
618 into account when considering whether the target should be at tier 1 with
619 host tools. In general, on any tier 1 target with host tools, people
620 should be able to expect to find and install all the same components that
621 they would for any other tier 1 target with host tools.
622 - Approval of host tools will take into account the additional time required to
623 build the host tools, and the substantial additional storage required for the
624 host tools.
625 - Host tools for the target must have substantial, widespread interest within
626 the developer community, and must serve the ongoing needs of multiple
627 production users of Rust across multiple organizations or projects. These
628 requirements are subjective, and determined by consensus of the approving
629 teams. This requirement will be evaluated independently from the
630 corresponding tier 1 requirement; it is possible for a target to have
631 sufficient interest for cross-compilation, but not have sufficient interest
632 for native compilation. The host tools may be dropped if they no longer meet
633 this requirement, even if the target otherwise qualifies as tier 1.
634 - The host tools must build, run, and pass tests reliably in CI, for all
635 components that Rust's CI considers mandatory.
636 - The target must not disable an excessive number of tests or pieces of tests
637 in the testsuite in order to do so. This is a subjective requirement.
638 - Building the host tools and running the testsuite for the host tools must not
639 take substantially longer than other targets, and should not substantially raise
640 the maintenance burden of the CI infrastructure.
641 - In particular, if building the target's host tools takes a reasonable
642 amount of time, but the target cannot run the testsuite in a timely fashion
643 due to low performance of either native code or accurate emulation, that
644 alone may prevent the target from qualifying as tier 1 with host tools.
645 - Providing host tools does not exempt a target from requirements to support
646 cross-compilation if at all possible.
647 - All requirements for tier 2 targets with host tools apply.
648 - All requirements for tier 1 apply.
649
650 A target seeking promotion to tier 1 with host tools should typically either be
651 tier 2 with host tools or tier 1 without host tools, to reduce the number of
652 requirements to simultaneously review and approve.
653
654 In addition to the general process for demoting a tier 1 target, a tier 1
655 target with host tools may be demoted (including having its host tools dropped,
656 or being demoted to tier 2 with host tools) if it no longer meets these
657 requirements but still meets the requirements for a lower tier. Any proposal
658 for demotion of a tier 1 target (with or without host tools) requires a full
659 RFC process, with approval by the compiler and release teams. Any such proposal
660 will be communicated widely to the Rust community, both when initially proposed
661 and before being dropped from a stable release.
662
663 [MCP]: https://forge.rust-lang.org/compiler/mcp.html