Skip to content
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

Pubish runfiles package to crates.io #1592

Open
UebelAndre opened this issue Oct 12, 2022 · 5 comments
Open

Pubish runfiles package to crates.io #1592

UebelAndre opened this issue Oct 12, 2022 · 5 comments

Comments

@UebelAndre
Copy link
Collaborator

Would it be possible to publish the [runfiles|https://github.com/bazelbuild/rules_rust/blob/main/tools/runfiles/runfiles.rs] package to https://crates.io/ so it doesn't become an unnecessary forcing forcing function between the use of Bazel and Cargo? The library very rarely changes so I think it'd be fine to publish something to maintain interoperability.

@UebelAndre
Copy link
Collaborator Author

cc @krasimirgg @scentini

@krasimirgg
Copy link
Collaborator

I'm a bit doubtful about successfully using this from a cargo context: from the sources it looks like this is very specifically designed for using in bazel environments: https://github.com/bazelbuild/rules_rust/blob/main/tools/runfiles/runfiles.rs#L1. As a risk: if we publish it to crates.io, this may create unreasonable expectations that it works in cargo context.
Otherwise I think it's fine to publish in principle.

Could you say more about how this unnecessarily forces to choose between bazel and cargo? Naively, if I had a project and wanted it to support both cargo and bazel and needed the runfiles functionality for the bazel bits, I'd try and guard the bazel-specific bits that require the runfiles under a source config / conditional compilation or something like that.

@fmeum
Copy link
Contributor

fmeum commented Oct 16, 2022

While it's true that the runfiles library should change only very rarely, it actually will have to change to accommodate Bzlmod (see bazelbuild/bazel#16124 and the linked proposal). Whatever the outcome of this discussion is, I would urge you to wait until Bazel 6 has been released and the required changes have been implemented.

@UebelAndre
Copy link
Collaborator Author

Seems rules_python published their runfiles library:

I still think this should be a published crate.

@liningpan
Copy link
Contributor

I think another benefit is to have it accessible on docs.rs, although pkg.go.dev works differently.
https://pkg.go.dev/github.com/bazelbuild/rules_go@v0.39.1/go/runfiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants