Skip to content

Support local path patching in vendor mode #3274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 10, 2025

Conversation

jayzhuang
Copy link
Contributor

Support path patches in Cargo.toml in crate_vendor. See #3241

@jayzhuang
Copy link
Contributor Author

jayzhuang commented Mar 6, 2025

@illicitonion Friendly ping, an initial round of opinions would be appreciated.

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in review here, and thanks so much for tracking this down! This looks great, a copy of tiny things and then let's get this merged! 🎉

Change-Id: I373b86e6af244ec5f7a79a41b6dc12b057ae97db
Tested with:

cd examples/crate_universe
bazelisk run //vendor_local_patching:crates_vendor
bazelisk test //vendor_local_patching:test

Change-Id: Icc449d34dc6eb97f7a76132bbe4bdb9ae044061f
@jayzhuang jayzhuang force-pushed the patching branch 4 times, most recently from af4dae8 to a53dba8 Compare March 10, 2025 02:52
1. Address review comment
2. Fix/add unit tests: bazelisk test //...
3. Fix clippy: bazelisk build //... --config=clippy
4. Fix path patching tests: bazelisk run //:vendor_edit_test_out_of_tree
   a. Recognize when patched path is from a temporary Bazel dir, and
      rebase properly back to Bazel workspace (previous logic).
   b. Don't try to read BUILD.bazel when path patching in
      extensions.bzl, since the BUILD file is writted directly to
      patched path, which does not necessarily follow the convention
      (naming and location) of other generated build files.

Change-Id: Ie3cddbafb7b524c0ea70494d76905475be1fc742
@jayzhuang
Copy link
Contributor Author

Addressed comments and fixed tests. Now CI is passing. PTAL!

@illicitonion illicitonion added this pull request to the merge queue Mar 10, 2025
Merged via the queue into bazelbuild:main with commit 77eec0c Mar 10, 2025
3 checks passed
@jayzhuang jayzhuang deleted the patching branch March 12, 2025 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants