bazelbuild / rules_java

Java rules for Bazel
Apache License 2.0
73 stars 66 forks source link

Adding `@bazel_tools//tools/java/runfiles` to `rules_java` #46

Open fmeum opened 2 years ago

fmeum commented 2 years ago

Would you welcome a PR that adds the Bazel Java runfiles library, which is available at @bazel_tools//tools/java/runfiles, to rules_java? According to the Starlark "Deploying rules" guide, it should be available at @rules_java//java/runfiles.

I am specifically asking this because I found an issue with the version of the runfiles libraries currently bundled with Bazel and am wondering about how future improvements to these libraries could be published so that users on older Bazel versions could still use them. Especially now that modules exist, rules_java is bound to get far more commonly used and would be a more natural place for modules to get the runfiles library from than @bazel_tools.

comius commented 2 years ago

It makes sense to put @bazel_tools//tools/java/runfiles here, because it's only needed by Java projects.

We'd actually want @bazel_tools removed one day, so it's a welcome change. The tricky part is probably how to add it here and then remove it from @bazel_tools. Not to have duplicated code.