Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions e2e/smoke/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ diff_test(
target_compatible_with = not_windows,
)

genrule(
name = "npm_help",
outs = ["help.txt"],
cmd = "$(NPM_PATH) --help > $@ || true",
toolchains = ["@nodejs_toolchains//:resolved_toolchain"],
tools = ["@nodejs_toolchains//:resolved_toolchain"],
)

################################################
# Tests and setup for the toolchain changes

Expand Down
5 changes: 3 additions & 2 deletions nodejs/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ def _nodejs_toolchain_impl(ctx):
"NODE_PATH": ctx.file.node.path if ctx.attr.node else ctx.attr.node_path,
"NPM_PATH": ctx.file.npm.path if ctx.attr.npm else ctx.attr.npm_path,
})
files = [f for f in [ctx.file.node, ctx.file.npm] if f]
default = DefaultInfo(
files = depset([ctx.file.node]) if ctx.attr.node else depset(),
runfiles = ctx.runfiles(files = [ctx.file.node] if ctx.attr.node else []),
files = depset(files),
runfiles = ctx.runfiles(files = files),
)
npm_sources = depset([ctx.file.npm] + ctx.files.npm_srcs)
nodeinfo = NodeInfo(
Expand Down