crate_universe: Don't include crate name in build script path. (#2663)

This PR shortens the path to the build script (potentially
significantly), which helps with long-path issues on Windows.
This change is motivated by the crate `tree-sitter-embedded-template`,
which has a too long path to the compiled build script otherwise, and
which then fails to build on Windows in a `bzlmod` setting.
Fixes https://github.com/bazelbuild/rules_rust/issues/2520.

The cargo build script name was used to automatically derive the cargo
package name, this now went into a separate override parameter that is
generated by the crate-universe tooling.
There's never two build scripts in a single crate, so I don't see how
having a single build script target with a single name would be a
problem.
6 files changed
tree: 87922b50661f0f5aa91856d180b2d22b7a76bb11
  1. .bazelci/
  2. .bcr/
  3. .github/
  4. bindgen/
  5. cargo/
  6. crate_universe/
  7. docs/
  8. examples/
  9. ffi/
  10. nix/
  11. proto/
  12. rust/
  13. test/
  14. tools/
  15. util/
  16. wasm_bindgen/
  17. .bazelignore
  18. .bazelrc
  19. .clang-format
  20. .envrc
  21. .gitattributes
  22. .gitignore
  23. .prettierrc.toml
  24. .rustfmt.toml
  25. ARCHITECTURE.md
  26. AUTHORS
  27. BUILD.bazel
  28. CODEOWNERS
  29. COMPATIBILITY.md
  30. CONTRIBUTING.md
  31. CONTRIBUTORS
  32. LICENSE.txt
  33. MODULE.bazel
  34. README.md
  35. version.bzl
  36. WORKSPACE.bazel
README.md

Rust Rules

  • Postsubmit Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Community

General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust.

Documentation

Please refer to the full documentation.