-
-
Notifications
You must be signed in to change notification settings - Fork 723
Open
Description
When trying to create a cross-platform go_binary target that works for Linux/Android and 32/64 bits, the standard approach would be to use a select (unless #4478 is fixed):
config_setting(
name = "armv7_linux",
constraint_values = [
"@platforms//cpu:armv7",
"@platforms//os:linux",
],
)
go_binary(
name = "run",
srcs = ["run.go"],
linkmode = select({
":armv7_linux": "normal",
"//conditions:default": "pie",
}),
pure = "on",
)
However, this fails with:
ERROR: (...): in go_non_executable_binary rule //:run: Returning RunEnvironmentInfo from a non-executable, non-test target has no effect
It looks like the issue is that you're not handling a select in go_binary_macro:
rules_go/go/private/rules/wrappers.bzl
Lines 42 to 45 in 74199c9
| if kwargs.get("linkmode", LINKMODE_NORMAL) in LINKMODES_EXECUTABLE: | |
| go_binary(name = name, **kwargs) | |
| else: | |
| go_non_executable_binary(name = name, **kwargs) |
Metadata
Metadata
Assignees
Labels
No labels