Skip to content

Commit

Permalink
fix(builtin): npm_package_bin requests target platform for its tool
Browse files Browse the repository at this point in the history
this matches the platform used for the tool, avoiding conflicts in the bazel-out tree
  • Loading branch information
alexeagle committed Oct 9, 2021
1 parent 78032be commit 5fad95a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/js_library/js_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _link_path(ctx, all_files):
prefix_contains_src = True
break
if not prefix_contains_src:
fail(" js_library %s strip_prefix path does not contain any of the provided sources" % ctx.label)
fail("js_library %s strip_prefix path does not contain any of the provided sources" % ctx.label)

return link_path

Expand Down
12 changes: 10 additions & 2 deletions internal/node/npm_package_bin.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ _ATTRS = {
"args": attr.string_list(mandatory = True),
"chdir": attr.string(),
"configuration_env_vars": attr.string_list(default = []),
"data": attr.label_list(allow_files = True, aspects = [module_mappings_aspect, node_modules_aspect]),
"data": attr.label_list(
allow_files = True,
aspects = [module_mappings_aspect, node_modules_aspect],
),
"env": attr.string_dict(default = {}),
"exit_code_out": attr.output(),
"link_workspace_root": attr.bool(),
Expand All @@ -20,7 +23,12 @@ _ATTRS = {
"stdout": attr.output(),
"tool": attr.label(
executable = True,
cfg = "host",
# TODO(5.0) this is incorrect, it should be for the "exec" configuration.
# however that requires a bunch of other rules to also collect deps in the "exec"
# configuration to avoid collisions when linking to different output trees, in
# the case where a single dependency appears in both a cfg = "target" and a
# cfg = "host" or "exec" attribute.
cfg = "target",
mandatory = True,
),
}
Expand Down

0 comments on commit 5fad95a

Please sign in to comment.