From b3be32e7135895737b64e3ad8ddb09176bfc8dd5 Mon Sep 17 00:00:00 2001 From: hlopko Date: Thu, 3 Aug 2017 14:14:48 +0200 Subject: Use feature configuration to construct command line for 'strip' action This cl introduces new action_config named 'strip' for the strip action. While at it, it fixes support for executionRequirements. Fixed #209 RELNOTES: 'strip' action is now configured via feature configuration PiperOrigin-RevId: 164110478 --- .../build/lib/packages/util/MOCK_OSX_CROSSTOOL | 370 +++++++++++++++++++++ .../build/lib/packages/util/MockCcSupport.java | 6 +- 2 files changed, 374 insertions(+), 2 deletions(-) (limited to 'src/test/java/com/google/devtools/build/lib/packages') diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL index 0a87b1c73c..fb072bda32 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL +++ b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL @@ -1188,6 +1188,43 @@ toolchain { } } } + action_config { + config_name: "strip" + action_name: "strip" + tool { + tool_path: "mac/strip" + } + flag_set { + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_file}" + flag: "-R" + flag: ".gnu.switches.text.quote_paths" + flag: "-R" + flag: ".gnu.switches.text.bracket_paths" + flag: "-R" + flag: ".gnu.switches.text.system_paths" + flag: "-R" + flag: ".gnu.switches.text.cpp_defines" + flag: "-R" + flag: ".gnu.switches.text.cpp_includes" + flag: "-R" + flag: ".gnu.switches.text.cl_args" + flag: "-R" + flag: ".gnu.switches.text.lipo_info" + flag: "-R" + flag: ".gnu.switches.text.annotation" + } + flag_group { + flag: "%{stripopts}" + iterate_over: "stripopts" + } + flag_group { + flag: "%{input_file}" + } + } + } action_config { config_name: "c-compile" action_name: "c-compile" @@ -2772,6 +2809,43 @@ toolchain { } } } + action_config { + config_name: "strip" + action_name: "strip" + tool { + tool_path: "mac/strip" + } + flag_set { + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_file}" + flag: "-R" + flag: ".gnu.switches.text.quote_paths" + flag: "-R" + flag: ".gnu.switches.text.bracket_paths" + flag: "-R" + flag: ".gnu.switches.text.system_paths" + flag: "-R" + flag: ".gnu.switches.text.cpp_defines" + flag: "-R" + flag: ".gnu.switches.text.cpp_includes" + flag: "-R" + flag: ".gnu.switches.text.cl_args" + flag: "-R" + flag: ".gnu.switches.text.lipo_info" + flag: "-R" + flag: ".gnu.switches.text.annotation" + } + flag_group { + flag: "%{stripopts}" + iterate_over: "stripopts" + } + flag_group { + flag: "%{input_file}" + } + } + } action_config { config_name: "c-compile" action_name: "c-compile" @@ -4364,6 +4438,43 @@ toolchain { } } } + action_config { + config_name: "strip" + action_name: "strip" + tool { + tool_path: "iossim/strip" + } + flag_set { + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_file}" + flag: "-R" + flag: ".gnu.switches.text.quote_paths" + flag: "-R" + flag: ".gnu.switches.text.bracket_paths" + flag: "-R" + flag: ".gnu.switches.text.system_paths" + flag: "-R" + flag: ".gnu.switches.text.cpp_defines" + flag: "-R" + flag: ".gnu.switches.text.cpp_includes" + flag: "-R" + flag: ".gnu.switches.text.cl_args" + flag: "-R" + flag: ".gnu.switches.text.lipo_info" + flag: "-R" + flag: ".gnu.switches.text.annotation" + } + flag_group { + flag: "%{stripopts}" + iterate_over: "stripopts" + } + flag_group { + flag: "%{input_file}" + } + } + } action_config { config_name: "c-compile" action_name: "c-compile" @@ -5960,6 +6071,43 @@ toolchain { } } } + action_config { + config_name: "strip" + action_name: "strip" + tool { + tool_path: "watchsim/strip" + } + flag_set { + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_file}" + flag: "-R" + flag: ".gnu.switches.text.quote_paths" + flag: "-R" + flag: ".gnu.switches.text.bracket_paths" + flag: "-R" + flag: ".gnu.switches.text.system_paths" + flag: "-R" + flag: ".gnu.switches.text.cpp_defines" + flag: "-R" + flag: ".gnu.switches.text.cpp_includes" + flag: "-R" + flag: ".gnu.switches.text.cl_args" + flag: "-R" + flag: ".gnu.switches.text.lipo_info" + flag: "-R" + flag: ".gnu.switches.text.annotation" + } + flag_group { + flag: "%{stripopts}" + iterate_over: "stripopts" + } + flag_group { + flag: "%{input_file}" + } + } + } action_config { config_name: "c-compile" action_name: "c-compile" @@ -7584,6 +7732,43 @@ toolchain { } } } + action_config { + config_name: "strip" + action_name: "strip" + tool { + tool_path: "tvsim/strip" + } + flag_set { + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_file}" + flag: "-R" + flag: ".gnu.switches.text.quote_paths" + flag: "-R" + flag: ".gnu.switches.text.bracket_paths" + flag: "-R" + flag: ".gnu.switches.text.system_paths" + flag: "-R" + flag: ".gnu.switches.text.cpp_defines" + flag: "-R" + flag: ".gnu.switches.text.cpp_includes" + flag: "-R" + flag: ".gnu.switches.text.cl_args" + flag: "-R" + flag: ".gnu.switches.text.lipo_info" + flag: "-R" + flag: ".gnu.switches.text.annotation" + } + flag_group { + flag: "%{stripopts}" + iterate_over: "stripopts" + } + flag_group { + flag: "%{input_file}" + } + } + } action_config { config_name: "c-compile" action_name: "c-compile" @@ -9185,6 +9370,43 @@ toolchain { } } } + action_config { + config_name: "strip" + action_name: "strip" + tool { + tool_path: "iossim/strip" + } + flag_set { + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_file}" + flag: "-R" + flag: ".gnu.switches.text.quote_paths" + flag: "-R" + flag: ".gnu.switches.text.bracket_paths" + flag: "-R" + flag: ".gnu.switches.text.system_paths" + flag: "-R" + flag: ".gnu.switches.text.cpp_defines" + flag: "-R" + flag: ".gnu.switches.text.cpp_includes" + flag: "-R" + flag: ".gnu.switches.text.cl_args" + flag: "-R" + flag: ".gnu.switches.text.lipo_info" + flag: "-R" + flag: ".gnu.switches.text.annotation" + } + flag_group { + flag: "%{stripopts}" + iterate_over: "stripopts" + } + flag_group { + flag: "%{input_file}" + } + } + } action_config { config_name: "c-compile" action_name: "c-compile" @@ -10804,6 +11026,43 @@ toolchain { } } } + action_config { + config_name: "strip" + action_name: "strip" + tool { + tool_path: "ios/strip" + } + flag_set { + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_file}" + flag: "-R" + flag: ".gnu.switches.text.quote_paths" + flag: "-R" + flag: ".gnu.switches.text.bracket_paths" + flag: "-R" + flag: ".gnu.switches.text.system_paths" + flag: "-R" + flag: ".gnu.switches.text.cpp_defines" + flag: "-R" + flag: ".gnu.switches.text.cpp_includes" + flag: "-R" + flag: ".gnu.switches.text.cl_args" + flag: "-R" + flag: ".gnu.switches.text.lipo_info" + flag: "-R" + flag: ".gnu.switches.text.annotation" + } + flag_group { + flag: "%{stripopts}" + iterate_over: "stripopts" + } + flag_group { + flag: "%{input_file}" + } + } + } action_config { config_name: "c-compile" action_name: "c-compile" @@ -12423,6 +12682,43 @@ toolchain { } } } + action_config { + config_name: "strip" + action_name: "strip" + tool { + tool_path: "watchos/strip" + } + flag_set { + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_file}" + flag: "-R" + flag: ".gnu.switches.text.quote_paths" + flag: "-R" + flag: ".gnu.switches.text.bracket_paths" + flag: "-R" + flag: ".gnu.switches.text.system_paths" + flag: "-R" + flag: ".gnu.switches.text.cpp_defines" + flag: "-R" + flag: ".gnu.switches.text.cpp_includes" + flag: "-R" + flag: ".gnu.switches.text.cl_args" + flag: "-R" + flag: ".gnu.switches.text.lipo_info" + flag: "-R" + flag: ".gnu.switches.text.annotation" + } + flag_group { + flag: "%{stripopts}" + iterate_over: "stripopts" + } + flag_group { + flag: "%{input_file}" + } + } + } action_config { config_name: "c-compile" action_name: "c-compile" @@ -14070,6 +14366,43 @@ toolchain { } } } + action_config { + config_name: "strip" + action_name: "strip" + tool { + tool_path: "tvos/strip" + } + flag_set { + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_file}" + flag: "-R" + flag: ".gnu.switches.text.quote_paths" + flag: "-R" + flag: ".gnu.switches.text.bracket_paths" + flag: "-R" + flag: ".gnu.switches.text.system_paths" + flag: "-R" + flag: ".gnu.switches.text.cpp_defines" + flag: "-R" + flag: ".gnu.switches.text.cpp_includes" + flag: "-R" + flag: ".gnu.switches.text.cl_args" + flag: "-R" + flag: ".gnu.switches.text.lipo_info" + flag: "-R" + flag: ".gnu.switches.text.annotation" + } + flag_group { + flag: "%{stripopts}" + iterate_over: "stripopts" + } + flag_group { + flag: "%{input_file}" + } + } + } action_config { config_name: "c-compile" action_name: "c-compile" @@ -15694,6 +16027,43 @@ toolchain { } } } + action_config { + config_name: "strip" + action_name: "strip" + tool { + tool_path: "ios/strip" + } + flag_set { + flag_group { + flag: "-S" + flag: "-o" + flag: "%{output_file}" + flag: "-R" + flag: ".gnu.switches.text.quote_paths" + flag: "-R" + flag: ".gnu.switches.text.bracket_paths" + flag: "-R" + flag: ".gnu.switches.text.system_paths" + flag: "-R" + flag: ".gnu.switches.text.cpp_defines" + flag: "-R" + flag: ".gnu.switches.text.cpp_includes" + flag: "-R" + flag: ".gnu.switches.text.cl_args" + flag: "-R" + flag: ".gnu.switches.text.lipo_info" + flag: "-R" + flag: ".gnu.switches.text.annotation" + } + flag_group { + flag: "%{stripopts}" + iterate_over: "stripopts" + } + flag_group { + flag: "%{input_file}" + } + } + } action_config { config_name: "c-compile" action_name: "c-compile" diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java index a6ebc585be..7f2ab2b02a 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java +++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java @@ -448,14 +448,16 @@ public abstract class MockCcSupport { public static final String EMPTY_CLIF_MATCH_ACTION_CONFIG = emptyActionConfigFor(CppCompileAction.CLIF_MATCH); + public static final String EMPTY_STRIP_ACTION_CONFIG = + emptyActionConfigFor(CppCompileAction.STRIP_ACTION_NAME); + /** * Creates action_config for {@code actionName} action using DUMMY_TOOL that doesn't imply any * features. */ private static String emptyActionConfigFor(String actionName) { return String.format( - "" - + "action_config {" + "action_config {" + " config_name: '%s'" + " action_name: '%s'" + " tool {" -- cgit v1.2.3