Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 46 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Want to contribute? Great! First, read this page (including the small print at the end).

### Before you contribute
## Before you contribute
**Before we can use your code, you must sign the
[Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1)
(CLA)**, which you can do online.
Expand All @@ -17,11 +17,53 @@ Before you start working on a larger contribution, you should get in touch
with us first. Use the issue tracker to explain your idea so we can help and
possibly guide you.

### Code reviews and other contributions.
## Code Reviews and Contributing PRs
**All submissions, including submissions by project members, require review.**
Please follow the instructions in [the contributors documentation](http://bazel.io/contributing.html).

### The small print
### AI Generated Contributions
**To ensure maintainability & sustainability of rules_rust in the LLM era, we’re adopting LLVM’s AI tools [policy](https://llvm.org/docs/AIToolPolicy.html).** As a short summary, when contributing to `rules_rust` you are expected to:
* **Understand and Own the Code**: You may use AI tools, but you are fully accountable for the work. You must thoroughly read, understand, and self-review all content before submitting it for review.
* **Learn from Feedback**: When maintainers review your work, use their feedback as a human learning opportunity to grow your skills, rather than simply funneling their comments back into an LLM to generate a quick fix.
* **Be Transparent**: Clearly label any contribution that contains a substantial amount of AI-generated content (e.g., using an Assisted-by commit trailer).

### Public Interface changes
**If your proposed change affects an existing or adds a public API (e.g new attribute, new build setting), please file an issue explaining the problem space & proposed design first.**

As Rust & Bazel are seeing increased adoption in the industry, we see more and more PRs that add/enhance the public facing interface of rules_rust (e.g new attributes, new rules, new build settings). Sometimes such PRs are near-universally beneficial, other times they address specific/narrow use cases. In its present shape, the core ruleset does not provide a sufficient level of configurability so that the latter use cases can be addressed locally. We will soon start a [redesign](https://github.com/bazelbuild/rules_rust/issues/4049) of the core ruleset that aims to allow for sufficient configurability so that users can address their own needs without expanding the rules_rust API surface.

### Adding New Rules
**We do not accept new non-core rules to the `rules_rust` repository.**

In its current state, rules_rust contains functionality broader than most rulesets: in addition to a core ruleset, it also contains functionality for automated `BUILD`/`bzl` file generation for crates, IDE integration via `rust-analyzer`, docs generation via `rustdoc`, C++ interop via `bindgen`, Js/Ts interop via `wasm_bindgen` etc. At present time there are areas that the maintainers don’t have sufficient expertise in, or where there is a single maintainer that can meaningfully act on incoming PRs and issues, making it difficult for interested parties to contribute. To address this, we will be splitting the non-core rulesets into separate repositories. This will allow for additional maintainers to join specific areas. For areas where we don’t find maintainers, we’ll deprecate and retire.

#### Core Rules
Rules used to compile Rust code.
* `rust_library`
* `rust_binary`
* `rust_test`
* `rust_static_library`
* `rust_shared_library`
* `rust_proc_macro`
* `cargo_build_script`

### Unowned / Undermaintained / Undertested areas
There are areas of `rules_rust` that no maintainers currently have expertise in. For these areas, expect some friction during contribution:
* `prost`
Best effort maintenance, long term these rules will not live in rules_rust. If you’re interested in taking over maintenance please reach out.
* `wasm-bindgen`
Best effort maintenance, long term these rules will not live in rules_rust. If you’re interested in taking over maintenance please reach out.
* Windows as host
Best effort maintenance, with no capability / bandwidth to help contributors. Experts willing to help review PRs would be much appreciated!
* Platforms other than Linux / MacOS / Windows
Best effort maintenance, no CI testing.

### Testing
A PR should contain tests for the change where feasible.

### Stale PRs and Issues
PRs and issues that are in awaiting-response state for more than 90 days will be closed as inactive.

## The small print
Contributions made by corporations are covered by a different agreement than
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a bit weird to split this part about the corporate CLA from the rest of the CLA discussion at the beginning of the file. Other than that, LGTM.

the one above, the
[Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate).
Loading