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

[Bug]: `nodejs_repo_host_os_alias` produces dangling symlink when Bzlmod is enabled

Wyverald opened this issue · comments

What happened?

repository_ctx.symlink("../{node_repository}_{os_name}/bin/node{ext}".format(
node_repository = repository_ctx.attr.user_node_repository_name,
os_name = os_name(repository_ctx),
ext = ext,
), "bin/node" + ext)

This logic fabricates a path into another repo, but the (canonical) name of that repo is different when Bzlmod is enabled.

Ideally this should be fixed by using a label somehow, but it's hard to get right and has the side effect of causing the symlink target repo to be fetched. So maybe just appending _{os_name} to repository_ctx.name is the safest bet.

Version

present on main; only an issue with Bzlmod enabled

How to reproduce

No response

Any other information?

No response

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!

@alexeagle could you confirm if this repo rule is still used (especially by rules_js etc)? If not, we could probably close this.