Skip to content

Crate Universe: crate.spec() supports path #3464

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rickvanprim
Copy link
Contributor

Exposes path on crate.spec() (which just works with cargo metadata 🎉).

However if the path is outside of the Bazel workspace, it attempts to generate dependency paths in the form //<absolute path> (which don't exist), so this splits SourceAnnotation::Path into SourceAnnotation::Path (located somewhere on the file system) and SourceAnnotation::LocalPath (located relative to the Bazel workspace).

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.

The crate.bzl change looks good to me, but I'm not quite sure why the LocalPath pieces are necessary, I wouldn't expect them to be and suspect we can fix something somewhere else to obviate the need - can you put together an integration test and we can poke at what goes wrong without LocalPath?

@rickvanprim rickvanprim force-pushed the jleitch branch 13 times, most recently from fb616b4 to ba20200 Compare June 15, 2025 22:09
@rickvanprim rickvanprim changed the title Cargo Bazel: Expose path on crate.spec() and split off LocalPath from Path Crate Universe: crate.spec() supports path Jun 15, 2025
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.

2 participants