Clone this repo:
  1. e7b8e28 Revert "Delete WORKSPACE" by Matt Stark · 9 months ago factory-brya-15684.B factory-geralt-15840.B factory-rex-15708.B firmware-cr50-efi-15611.28.B firmware-cr50-mp-15611.B firmware-cr50-prepvt-15608.B firmware-geralt-15842.B firmware-rex-15709.B main release-R117-15572.B release-R118-15604.B release-R119-15633.B release-R120-15662.B release-R121-15699.B release-R122-15753.B release-R123-15786.B release-R124-15823.B release-R125-15853.B stabilize-15561.B stabilize-15562.B stabilize-15563.B stabilize-15564.B stabilize-15572.16.B stabilize-15572.39.B stabilize-15572.4.B stabilize-15572.50.B stabilize-15572.57.B stabilize-15572.63.B stabilize-15588.B stabilize-15604.16.B stabilize-15604.45.B stabilize-15604.56.B stabilize-15604.57.B stabilize-15610.B stabilize-15633.44.B stabilize-15633.58.B stabilize-15633.69.B stabilize-15642.B stabilize-15654.B stabilize-15662.64.B stabilize-15662.76.B stabilize-15662.78.B stabilize-15662.80.B stabilize-15662.88.B stabilize-15677.B stabilize-15699.58.B stabilize-15699.66.B stabilize-15714.B stabilize-15753.46.B stabilize-15753.55.B stabilize-15756.B stabilize-15786.48.B stabilize-15786.58.B stabilize-15793.B stabilize-15828.B stabilize-15855.B stabilize-15857.B stabilize-quickfix-15662.77.B stabilize-quickfix-15786.49.B
  2. be836ab Revert "Update prebuilts for the new snapshot" by Shuhei Takahashi · 12 months ago release-R115-15474.B release-R116-15509.B stabilize-15446.B stabilize-15474.38.B stabilize-15474.53.B stabilize-15474.70.B stabilize-15483.B stabilize-15485.B stabilize-15509.37.B stabilize-15509.63.B stabilize-15509.72.B stabilize-15511.B stabilize-15519.B stabilize-15531.B stabilize-15532.B
  3. 048f9a0 Update prebuilts for the new snapshot by Shuhei Takahashi · 12 months ago
  4. 010683b Support live feedback for vscode rust code. by Matt Stark · 1 year ago
  5. 5293edf bazelrcs/prebuilts: Update prebuilts for stabilize-15429.B by Raul E Rangel · 1 year ago release-R114-15437.B stabilize-15437.42.B stabilize-15437.57.B stabilize-15437.59.B stabilize-15439.B

Chrome OS Bazel Rules


This repository provides common rules and configuration for Bazel projects in Chrome OS.


The code is this directory is experimental and under active development. Stability and functionality is not guaranteed :)

Configuring dev experience


We use rust_analyzer to generate a rust-project.json file in the workspace root, which allows vscode to understand your dependencies.

Simply install the rust_analyzer VSCode plugin, and then add the following to your .vscode/tasks.json file, substituting TARGET for a label of any bazel target you want to depend on. VSCode will then analyze all the transitive dependencies of the specified targets.

For example, I might use the following line:

"args": ["run", "//rules_cros/toolchains/rust:gen_rust_project", "--", "//rules_cros/toolchains/rust/examples/use_local_crate/...", "//rules_cros/toolchains/rust/examples/hello_world:helllo_world"],

    "version": "2.0.0",
    "tasks": [
            "label": "Generate rust-project.json",
            "command": "bazel",
            "args": ["run", "//rules_cros/toolchains/rust:gen_rust_project", "--", "<TARGET1>", "<TARGET2>", "..."],
            "options": {
                "cwd": "${workspaceFolder}"
            "group": "build",
            "problemMatcher": [],
            "presentation": {
                "reveal": "never",
                "panel": "dedicated",
            "runOptions": {
                "runOn": "folderOpen"

If you add a new file, you may need to manually re-run the task.