From 67cc2e8da14de4d462db3a597b4155222f0fa61a Mon Sep 17 00:00:00 2001 From: scentini Date: Tue, 19 May 2026 15:54:20 +0200 Subject: [PATCH 1/2] Update CONTRIBUTING.md Update `CONTRIBUTING.md` to add guidelines around LLM contributions, public interface changes, and manage expectations for contributions to areas that are not properly owned/maintained today. --- CONTRIBUTING.md | 52 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9d3d1aaf8a..178f2c63a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. @@ -17,11 +17,55 @@ 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 the one above, the [Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate). + + From b53bca0fdc867e0e450e93cefcfa551c94a3cc54 Mon Sep 17 00:00:00 2001 From: scentini Date: Tue, 19 May 2026 15:55:25 +0200 Subject: [PATCH 2/2] Update CONTRIBUTING.md Trim whitespace --- CONTRIBUTING.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 178f2c63a7..7da538955f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,5 +67,3 @@ PRs and issues that are in awaiting-response state for more than 90 days will be Contributions made by corporations are covered by a different agreement than the one above, the [Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate). - -