Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial draft of crates policy. #19

Merged
merged 9 commits into from
Mar 13, 2019
33 changes: 33 additions & 0 deletions procedures/crates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Crate Policies
This document describe the guidelines for splitting the compiler up into crates and using
third-party crates in the compiler. These guidelines were originally discussed at the Rust All
Hands 2019 by the compiler team and others.

## Where should compiler crates live?
As library-ification progresses and parts of the compiler are extracted into separate reusable
crates, these new crates should be hosted in the `rust-lang` organization.
davidtwco marked this conversation as resolved.
Show resolved Hide resolved

## Who owns these crates?
It is desired that a compiler team member has loose ownership over a crate so that there is someone
who is responsible for making sure that new versions are published and that pull requests are
reviewed.

## What should these crates be named?
When naming a crate, it is worth considering that a `rustc_` prefix could result in
compiler-specific changes being made where this isn't appropriate as the crate was actually
intended to be general-purpose.
davidtwco marked this conversation as resolved.
Show resolved Hide resolved

## What should be included in a out-of-tree crate?
A maintenance policy should be included to set appropriate expectations for anyone who may wish to
davidtwco marked this conversation as resolved.
Show resolved Hide resolved
use the crate. This enables killing dead code, and being able to make changes on a whim, where
appropriate, when this is required by a change in the compiler.

Various other infrastructure should be put in place, such as `bors-ng` and `highfive`, to ensure
davidtwco marked this conversation as resolved.
Show resolved Hide resolved
davidtwco marked this conversation as resolved.
Show resolved Hide resolved
that the process is similar for in-tree and out-of-tree pull requests. Similarly, integration tests
should be run in CI and performance measured by `perf.rust-lang.org`. It may be worth consulting
davidtwco marked this conversation as resolved.
Show resolved Hide resolved
with the infrastructure team to set these up.

## Can I include a third-party crate?
It is desirable that a third-party crate being included in the compiler is well-maintained and that,
where possible, a compiler team member is added as a maintainer. It may be worth consulting with the
rest of the compiler team before making this decision.