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.
We use the Chromium issue tracker. Please use OS>Systems>Containers
component.
The following is high level guidance for producing contributions to crosvm.
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.
You need to set up a user account with gerrit. Once logged in, you can obtain HTTP Credentials to set up git to upload changes.
Once set up, run ./tools/cl
to install the gerrit commit message hook. This will insert a unique “Change-Id” into all commit messages so gerrit can identify changes.
Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you‘ve already submitted one (even if it was for a different project), you probably don’t need to do it again.
To make changes to crosvm, start your work on a new branch tracking origin/main
.
git checkout --branch myfeature --track origin/main
After making the necessary changes, and testing them via Presubmit Checks, you can commit and upload them:
git commit ./tools/cl upload
If you need to revise your change, you can amend the existing commit and upload again:
git commit --amend ./tools/cl upload
This will create a new version of the same change in gerrit.
Note: We don't accept any pull requests on the GitHub mirror.
All submissions needs to be reviewed by one of the crosvm owners. Use the gerrit UI to request a review. If you are uncertain about the correct person to review, reach out to the team via chat or email list.
Crosvm uses a Commit Queue, which will run pre-submit testing on all changes before merging them into crosvm.
Once one of the crosvm owners has voted “Code-Review+2” on your change, you can use the “Submit to CQ” button, which will trigger the test process.
Gerrit will show any test failures. Refer to Building Crosvm for information on how to run the same tests locally.
When all tests pass, your change is merged into origin/main
.
The book of crosvm is build with mdBook. Each markdown files must follow Google Markdown style guide.
To render the book locally, you need to install mdbook and mdbook-mermaid, which should be installed when you run ./tools/install-deps
script. Or you can use the tools/dev_container
environment.
cd docs/book/ mdbook build
Output is found at docs/book/book/html/
.
Note: If you make a certain size of changes, it's recommended to reinstall mdbook manually with
cargo install mdbook
, as./tools/install-deps
only installs a binary with some convenient features disabled. For example, the full version of mdbook allows you to edit files while checking rendered results.