diff --git a/js/private/js_binary.bzl b/js/private/js_binary.bzl index d4e939f7d..b44f59baf 100644 --- a/js/private/js_binary.bzl +++ b/js/private/js_binary.bzl @@ -249,6 +249,7 @@ def _bash_launcher(ctx, entry_point_path, log_prefix_rule_set, log_prefix_rule, "{{node}}": _target_tool_short_path(node_bin.target_tool_path), "{{rlocation_function}}": BASH_RLOCATION_FUNCTION, "{{workspace_name}}": ctx.workspace_name, + "{{node_patches_entry_short_path}}": ctx.file._node_patches_entry.short_path, } ctx.actions.expand_template( diff --git a/js/private/js_binary.sh.tpl b/js/private/js_binary.sh.tpl index 5a3d4536f..1ff18be62 100644 --- a/js/private/js_binary.sh.tpl +++ b/js/private/js_binary.sh.tpl @@ -304,7 +304,7 @@ done export JS_BINARY__FS_PATH_ROOTS="$execroot:$RUNFILES" if [ -z "${JS_BINARY__DISABLE_NODE_PATCHES:-}" ] && [ "${JS_BINARY__FS_PATH_ROOTS:-}" ]; then logf_debug "adding node fs patches with roots: %s" "$JS_BINARY__FS_PATH_ROOTS" - NODE_OPTIONS+=( "--require" "$RUNFILES/aspect_rules_js/js/private/node-patches/register" ) + NODE_OPTIONS+=( "--require" "$RUNFILES/{{workspace_name}}/{{node_patches_entry_short_path}}" ) fi # Put bazel managed node on the path diff --git a/js/private/test/shellcheck_launcher.sh b/js/private/test/shellcheck_launcher.sh index 4140b2b37..372271621 100755 --- a/js/private/test/shellcheck_launcher.sh +++ b/js/private/test/shellcheck_launcher.sh @@ -321,7 +321,7 @@ done export JS_BINARY__FS_PATH_ROOTS="$execroot:$RUNFILES" if [ -z "${JS_BINARY__DISABLE_NODE_PATCHES:-}" ] && [ "${JS_BINARY__FS_PATH_ROOTS:-}" ]; then logf_debug "adding node fs patches with roots: %s" "$JS_BINARY__FS_PATH_ROOTS" - NODE_OPTIONS+=( "--require" "$RUNFILES/aspect_rules_js/js/private/node-patches/register" ) + NODE_OPTIONS+=( "--require" "$RUNFILES/aspect_rules_js/js/private/node-patches/register.js" ) fi # Put bazel managed node on the path