bazelbuild / rules_nodejs

NodeJS toolchain for Bazel.

Home Page:https://bazelbuild.github.io/rules_nodejs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FR]: @bazel/runfiles needs to handle repo mapping

jfirebaugh opened this issue · comments

What is the current behavior?

The @bazel/runfiles library fails to find runfiles specified with apparent repository names when Bzlmod is enabled.

Describe the feature

Equivalent to bazelbuild/rules_go#3347 / bazelbuild/rules_python#998.

@fmeum I know you visited a lot of languages in the ecosystem for the other runfiles fixes. I don't recall, did you have a look here as well?

The lookup procedure itself looks sound. It's really just the repo mapping logic that is missing.

My JS is pretty rusty, so I would prefer someone else to implement this, but I can review the PR. The Python library can serve as a reference here.

The challenging part would be determining the current repo. I don't know how one would get the path of the current source file in JS. Minification and bundling could be problematic in this context. Can source maps be consumed at runtime?

@ewhauser is this something you're interested in pairing with Fabian on?

This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs in 30 days. Note as of rules_nodejs v6 the rules_nodejs repository contains only the core nodejs toolchain and @bazel/runfiles package. All rulesets are removed and unmaintained. For alternate rulesets suggestions include https://github.com/aspect-build/rules_js, https://github.com/aspect-build/rules_ts Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

Can someone please add a label to turn off the stale bot for this issue? This blocks use of bzlmod for anyone using @bazel/runfiles so it's not going to go stale.

This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs in 30 days. Note as of rules_nodejs v6 the rules_nodejs repository contains only the core nodejs toolchain and @bazel/runfiles package. All rulesets are removed and unmaintained. For alternate rulesets suggestions include https://github.com/aspect-build/rules_js, https://github.com/aspect-build/rules_ts Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

sigh Not stale.

I'm tempted to move the implementation of the runfiles library to rules_js at this point in the process of fixing it for bzlmod. rules_nodejs now only supplies the Node.js toolchain and no longer deals with the runtime js_binary / js_test implementation. I'm not sure we even have the right permissions to publish to the @bazel/runfiles npm package anymore.