From 8d66a4171baddcbe1569972f019e54130111202c Mon Sep 17 00:00:00 2001 From: ilist Date: Tue, 26 Oct 2021 01:50:27 -0700 Subject: [PATCH] Change host to exec configuration in builtin rules. PiperOrigin-RevId: 405592176 --- src/main/starlark/builtins_bzl/common/cc/cc_import.bzl | 2 +- src/main/starlark/builtins_bzl/common/cc/cc_library.bzl | 2 +- src/main/starlark/builtins_bzl/common/objc/attrs.bzl | 4 ++-- .../build/lib/rules/objc/AppleStaticLibraryTest.java | 9 +++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/starlark/builtins_bzl/common/cc/cc_import.bzl b/src/main/starlark/builtins_bzl/common/cc/cc_import.bzl index 10744f6e301e4f..86e70afa5181ab 100644 --- a/src/main/starlark/builtins_bzl/common/cc/cc_import.bzl +++ b/src/main/starlark/builtins_bzl/common/cc/cc_import.bzl @@ -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"), diff --git a/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl b/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl index 951b77dfe608f1..0849573bf0e62e 100644 --- a/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl +++ b/src/main/starlark/builtins_bzl/common/cc/cc_library.bzl @@ -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"), diff --git a/src/main/starlark/builtins_bzl/common/objc/attrs.bzl b/src/main/starlark/builtins_bzl/common/objc/attrs.bzl index 30c47da9397033..d5fca9352b83f4 100644 --- a/src/main/starlark/builtins_bzl/common/objc/attrs.bzl +++ b/src/main/starlark/builtins_bzl/common/objc/attrs.bzl @@ -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, ), @@ -103,7 +103,7 @@ _COPTS_RULE = { _XCRUN_RULE = { "_xcrunwrapper": attr.label( - cfg = "host", + cfg = "exec", default = "@" + semantics.get_repo() + "//tools/objc:xcrunwrapper", executable = True, ), diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java index 48e048b952347d..0da5a882795d82 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java @@ -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())) @@ -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()))