Skip to content

Commit

Permalink
Change host to exec configuration in builtin rules.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 405592176
  • Loading branch information
comius authored and copybara-github committed Oct 26, 2021
1 parent cbc5581 commit 8d66a41
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/starlark/builtins_bzl/common/cc/cc_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ cc_import = rule(
"_grep_includes": attr.label(
allow_files = True,
executable = True,
cfg = "host",
cfg = "exec",
default = Label("@" + semantics.get_repo() + "//tools/cpp:grep-includes"),
),
"_cc_toolchain": attr.label(default = "@" + semantics.get_repo() + "//tools/cpp:current_cc_toolchain"),
Expand Down
2 changes: 1 addition & 1 deletion src/main/starlark/builtins_bzl/common/cc/cc_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ attrs = {
"_grep_includes": attr.label(
allow_files = True,
executable = True,
cfg = "host",
cfg = "exec",
default = Label("@" + semantics.get_repo() + "//tools/cpp:grep-includes"),
),
"_cc_toolchain": attr.label(default = "@//tools/cpp:current_cc_toolchain"),
Expand Down
4 changes: 2 additions & 2 deletions src/main/starlark/builtins_bzl/common/objc/attrs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ _COMPILE_DEPENDENCY_RULE = {
_INCLUDE_SCANNING_RULE = {
"_grep_includes": attr.label(
allow_single_file = True,
cfg = "host",
cfg = "exec",
default = "@" + semantics.get_repo() + "//tools/cpp:grep-includes",
executable = True,
),
Expand All @@ -103,7 +103,7 @@ _COPTS_RULE = {

_XCRUN_RULE = {
"_xcrunwrapper": attr.label(
cfg = "host",
cfg = "exec",
default = "@" + semantics.get_repo() + "//tools/objc:xcrunwrapper",
executable = True,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ public void testLipoAction() throws Exception {
assertThat(Artifact.toRootRelativePaths(action.getInputs())).containsAtLeast(i386Lib, x8664Lib);

assertContainsSublist(
action.getArguments(),
ImmutableList.of(MOCK_XCRUNWRAPPER_EXECUTABLE_PATH, LIPO, "-create"));
removeConfigFragment(action.getArguments()),
ImmutableList.of(removeConfigFragment(MOCK_XCRUNWRAPPER_EXECUTABLE_PATH), LIPO, "-create"));
String binFragment =
removeConfigFragment(targetConfig.getBinFragment(RepositoryName.MAIN) + "/");
assertThat(removeConfigFragment(action.getArguments()))
Expand Down Expand Up @@ -223,8 +223,9 @@ public void testWatchSimulatorLipoAction() throws Exception {
assertThat(Artifact.toRootRelativePaths(action.getInputs()))
.containsAtLeast(i386Bin, armv7kBin);

assertContainsSublist(action.getArguments(), ImmutableList.of(
MOCK_XCRUNWRAPPER_EXECUTABLE_PATH, LIPO, "-create"));
assertContainsSublist(
removeConfigFragment(action.getArguments()),
ImmutableList.of(removeConfigFragment(MOCK_XCRUNWRAPPER_EXECUTABLE_PATH), LIPO, "-create"));
String binFragment =
removeConfigFragment(targetConfig.getBinFragment(RepositoryName.MAIN) + "/");
assertThat(removeConfigFragment(action.getArguments()))
Expand Down

0 comments on commit 8d66a41

Please sign in to comment.