commit | 1b19a4670f8b4a44a924407ac3d162c2ed76961f | [log] [tgz] |
---|---|---|
author | Javier G. Sogo <jgsogo@gmail.com> | Sat Sep 09 17:42:30 2023 +0200 |
committer | GitHub <noreply@github.com> | Sat Sep 09 08:42:30 2023 -0700 |
tree | a4517633c599a770938804a59c5e81a683a5bd78 | |
parent | 1f9b63a408cdbd289d3289e1cf6da3abeae364e0 [diff] |
Handle files from external repos (fix breaking change in Bazel 3.7.0) (#2138) Fixes https://github.com/bazelbuild/rules_rust/issues/1780 In Bazel 3.7.0, the path returned by `build_file_path` changed (https://github.com/bazelbuild/bazel/issues/12344), it no longer contains the `external/<repo>` prefix for external files. This breaks the expectations of this rule in the [`paths.relativize` function](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/paths_doc.md#pathsrelativize) call. In this PR I prepend the `workspace_root` (`external/<repo>`) to `build_file_path` (`<path/in/the/repo>`), and use `path` (`external/<repo>/path/in/the/repo`) instead of `short_path` (`../<repo>/path/in/the/repo`). For files that are generated in different configurations I need to strip the `root` which contains the `bazel-out/darwin-fastbuild-ST-a1a0f4088294/bin/` that will never appear in the `package_root` path. ~Note.- I will probably need some help to add tests for this change~ I've tried to add one test --------- Co-authored-by: UebelAndre <github@uebelandre.com>
This repository provides rules for building Rust projects with Bazel.
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.