This article goes into detail about multiple areas of interest to contributors, which includes reviewers, developers, and integrators who each share an interest in guiding crosvm's direction.
The following is high level guidance for producing contributions to crosvm.
In the bin/
directory of the crosvm repository, there is the clippy
script which lints the Rust code and the fmt
script which will format the crosvm Rust code inplace. When submitting changes, the bin/smoke_test
script, which checks Rust format and unit tests, will be run by Kokoro, the internal Google run cloud builder, and the results will be posted to the change. Kokoro is only informational, so if Kokoro rejects a change, it can still be submitted.
See also, Chrome OS Contributing Guide
When a change is approved, verified, and added to the commit queue, crosvm will be built and the unit tests (with some exceptions) will be run by the Chrome OS infrastructure. Only if that passes, will the change be submitted. Failures here will cause the commit queue to reject the change until it is re-added (CQ+2). Unfortunately, it is extremely common for false negatives to cause a change to get rejected, so be ready to re-apply the CQ+2 label if you're the owner of a ready to submit change.
To format all code, crosvm defers to rustfmt. In addition, the code adheres to the following rules:
The use
statements for each module should be grouped in this order
std
crate
crosvm uses the remain crate to keep error enums sorted, along with the #[sorted]
attribute to keep their corresponding match statements in the same order.