daml/bazel_tools/rules_nodejs_posix_path.patch
Andreas Herrmann 10031a614c Remove all instances of use_default_shell_env = True (#3597)
* use_default_shell_env = False in proto_gen

* use_default_shell_env = False in scala_source_jar

* use_default_shell_env = False in scaladoc_jar

* use_default_shell_env = False in dar_to_scala

* use_default_shell_env = False in _real_pkg_tar

* use_default_shell_env = False in client_server_build

* use_default_shell_env = False in npm_package
2019-11-25 09:15:00 +00:00

31 lines
1.2 KiB
Diff

diff --git a/internal/npm_package/npm_package.bzl b/internal/npm_package/npm_package.bzl
index 7b19296b..af1ed3b0 100644
--- a/internal/npm_package/npm_package.bzl
+++ b/internal/npm_package/npm_package.bzl
@@ -66,6 +66,7 @@ def create_package(ctx, deps_sources, nested_packages):
if ctx.version_file:
inputs.append(ctx.version_file)
+ posix = ctx.toolchains["@rules_sh//sh/posix:toolchain_type"]
ctx.actions.run(
progress_message = "Assembling npm package %s" % package_dir.short_path,
executable = ctx.executable._packager,
@@ -80,6 +81,9 @@ def create_package(ctx, deps_sources, nested_packages):
# See https://github.com/bazelbuild/rules_nodejs/issues/187
"local": "1",
},
+ env = {
+ "PATH": ctx.host_configuration.host_path_separator.join(posix.paths),
+ },
)
return package_dir
@@ -168,6 +172,7 @@ npm_package = rule(
implementation = _npm_package,
attrs = NPM_PACKAGE_ATTRS,
outputs = NPM_PACKAGE_OUTPUTS,
+ toolchains = ["@rules_sh//sh/posix:toolchain_type"],
)
"""The npm_package rule creates a directory containing a publishable npm artifact.