Skip to content
Open
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
2 changes: 1 addition & 1 deletion internal/common/copy_to_bin.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def copy_to_bin(name, srcs, **kwargs):
name = name,
srcs = srcs,
is_windows = select({
"@bazel_tools//src/conditions:host_windows": True,
"@platforms//os:windows": True,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep Windows copy mode tied to host, not target platform

This select now uses @platforms//os:windows, which follows the target platform, but _copy_to_bin_impl uses is_windows to choose copy_cmd vs copy_bash for the action runner; copy_cmd invokes cmd.exe (third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl, copy_cmd). On a Linux/macOS host building Windows targets (for example with --platforms=@platforms//os:windows), this flips to cmd.exe even though execution is not on Windows, causing copy actions to fail. The previous host_windows condition avoided that by matching host OS.

Useful? React with 👍 / 👎.

"//conditions:default": False,
}),
**kwargs
Expand Down
2 changes: 1 addition & 1 deletion internal/common/params_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def params_file(
data = data,
newline = newline or "auto",
is_windows = select({
"@bazel_tools//src/conditions:host_windows": True,
"@platforms//os:windows": True,
"//conditions:default": False,
}),
**kwargs
Expand Down
2 changes: 1 addition & 1 deletion internal/js_library/js_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def js_library(
# TODO: remove once legacy module_mapping is removed
module_name = package_name if package_name != "$node_modules$" else None,
is_windows = select({
"@bazel_tools//src/conditions:host_windows": True,
"@platforms//os:windows": True,
"//conditions:default": False,
}),
**kwargs
Expand Down
2 changes: 1 addition & 1 deletion internal/linker/npm_link.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ set to the target's package & the files provided from the targets DefaultInfo.
package_name = package_name,
package_path = package_path,
is_windows = select({
"@bazel_tools//src/conditions:host_windows": True,
"@platforms//os:windows": True,
"//conditions:default": False,
}),
**kwargs
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg_npm/pkg_npm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,15 @@ def pkg_npm_macro(name, tgz = None, **kwargs):
native.alias(
name = name + ".pack",
actual = select({
"@bazel_tools//src/conditions:host_windows": name + ".pack.bat",
"@platforms//os:windows": name + ".pack.bat",
"//conditions:default": name + ".pack.sh",
}),
)

native.alias(
name = name + ".publish",
actual = select({
"@bazel_tools//src/conditions:host_windows": name + ".publish.bat",
"@platforms//os:windows": name + ".publish.bat",
"//conditions:default": name + ".publish.sh",
}),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def copy_file(name, src, out, is_directory = False, is_executable = False, allow
src = src,
out = out,
is_windows = select({
"@bazel_tools//src/conditions:host_windows": True,
"@platforms//os:windows": True,
"//conditions:default": False,
}),
is_executable = is_executable,
Expand Down
Loading