Escape string literals in crate_universe Tera repository templates (#4416) No functional changes intended. `TemplateEngine::new` in `crate_universe` initializes `tera::Tera::default()`, which does not enable auto-escaping for `.j2` template files. While `deps_map.j2` and `aliases_map.j2` already pipe interpolated values through Tera's `| addslashes` filter when rendering Starlark string literals, `repo_git.j2`, `repo_http.j2`, and `local_crate_mirror` in `module_bzl.j2` interpolated string attributes (such as `strip_prefix`, `remote`, `commitish`, `patch_args`, `urls`, and `path`) directly inside `"..."` literals. If any of those fields contain double quotes (`"`) or backslashes (`\`), the generated `crates.bzl` contains unescaped Starlark string literals. This change applies `| addslashes` consistently across the string-literal interpolations in `repo_git.j2`, `repo_http.j2`, and `module_bzl.j2`, and adds a unit test in `crate_universe/src/rendering.rs`. Assisted-by: Gemini
This repository provides rules for building Rust projects with Bazel.
The fastest way to try this in an empty project is to click the green “Use this template” button on https://github.com/bazel-starters/rust.
General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust.
Please refer to the full documentation.