rules_rs

(★ 90)

Next-gen Rust Bazel rules which provide a blazing-fast ergonomic `crate_universe` reimplementation, first-class Windows support, optimized toolchains, and more.

File Explorer

  • .bazelignore
  • .bazelrc
  • .bazelversion
  • .gitattributes
  • .gitignore
  • .pre-commit-config.yaml
  • .prettierignore
  • .typos.toml
  • BUILD.bazel
  • CONTRIBUTING.md
  • LICENSE
  • MODULE.bazel
  • MODULE.bazel.lock
  • README.md
  • release.sh
  • renovate.json
  • REPO.bazel

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

bazel

View Details ▼

Open-source build and test tool similar to Make, Maven, and Gradle.

bazel build {{target}}

Build the specified target in the workspace:

bazel clean

Remove output files and stop the server if running:

bazel shutdown

Stop the bazel server:

🔍

cargo

View Details ▼

Manage Rust projects and their module dependencies (crates).
Some subcommands such as `build` have their own usage documentation.

cargo search {{search_string}}

Search for crates:

cargo install {{crate_name}}

Install a binary crate:

cargo install --list

List installed binary crates:

🔍

rustc

View Details ▼

The Rust compiler.
Rust projects usually use `cargo` instead of invoking `rustc` directly.

rustc {{path/to/main.rs}}

Compile a binary crate:

rustc {{[-C|--codegen]}} lto {{[-C|--codegen]}} opt-level={{0|1|2|3|s|z}} {{path/to/main.rs}}

Compile with optimizations (`s` means optimize for binary size; `z` is the same with even more optimizations):

rustc {{[-g|--codegen debuginfo=2]}} {{path/to/main.rs}}

Compile with debugging information:

// repository documentation