From b4f14673ce020c6ce7c39aea354eadbcebfed8bd Mon Sep 17 00:00:00 2001 From: hlopko Date: Tue, 12 Mar 2019 04:03:29 -0700 Subject: [PATCH] Fix all the remaining tests as a preparation for --incompatible_disable_legacy_crosstool_fields flip #7008 #6861 RELNOTES: PiperOrigin-RevId: 237987653 --- .../lib/packages/util/MOCK_OSX_CROSSTOOL | 1208 ++++++++--------- .../lib/packages/util/MockCcSupport.java | 4 +- .../rules/cpp/CcToolchainFeaturesTest.java | 44 +- 3 files changed, 630 insertions(+), 626 deletions(-) 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 6da44d42a04ad5..31e5dcfc7522c4 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 @@ -83,48 +83,6 @@ toolchain { cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" cxx_builtin_include_directory: "/usr/include" builtin_sysroot: "" - feature { - name: "no_legacy_features" - } - feature { - name: "fastbuild" - implies: "fastbuild_only_flag" - } - feature { - name: "opt" - flag_set { - action: "c-compile" - action: "c++-compile" - action: "objc-compile" - action: "objc++-compile" - flag_group { - flag: "-g0" - } - with_feature { - feature: "no_generate_debug_symbols" - } - } - implies: "opt_only_flag" - } - feature { - name: "dbg" - implies: "dbg_only_flag" - } - feature { - name: "compile_all_modules" - } - feature { - name: "exclude_private_headers_in_module_maps" - } - feature { - name: "has_configured_linker_path" - } - feature { - name: "only_doth_headers_in_module_maps" - } - feature { - name: "is_not_test_target" - } feature { name: "default_compile_flags" flag_set { @@ -229,6 +187,62 @@ toolchain { } enabled: true } + feature { + name: "default_link_flags" + flag_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "objc-executable" + action: "objc++-executable" + flag_group { + flag: "-lc++" + } + } + enabled: true + } + feature { + name: "no_legacy_features" + } + feature { + name: "fastbuild" + implies: "fastbuild_only_flag" + } + feature { + name: "opt" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-g0" + } + with_feature { + feature: "no_generate_debug_symbols" + } + } + implies: "opt_only_flag" + } + feature { + name: "dbg" + implies: "dbg_only_flag" + } + feature { + name: "compile_all_modules" + } + feature { + name: "exclude_private_headers_in_module_maps" + } + feature { + name: "has_configured_linker_path" + } + feature { + name: "only_doth_headers_in_module_maps" + } + feature { + name: "is_not_test_target" + } feature { name: "generate_dsym_file" flag_set { @@ -808,20 +822,6 @@ toolchain { } enabled: true } - feature { - name: "default_link_flags" - flag_set { - action: "c++-link-executable" - action: "c++-link-dynamic-library" - action: "c++-link-nodeps-dynamic-library" - action: "objc-executable" - action: "objc++-executable" - flag_group { - flag: "-lc++" - } - } - enabled: true - } feature { name: "version_min" flag_set { @@ -1867,48 +1867,6 @@ toolchain { cxx_builtin_include_directory: "/Applications//Contents/Developer/Platforms/.platform/Developer/SDKs" cxx_builtin_include_directory: "/usr/include" builtin_sysroot: "" - feature { - name: "no_legacy_features" - } - feature { - name: "fastbuild" - implies: "fastbuild_only_flag" - } - feature { - name: "opt" - flag_set { - action: "c-compile" - action: "c++-compile" - action: "objc-compile" - action: "objc++-compile" - flag_group { - flag: "-g0" - } - with_feature { - feature: "no_generate_debug_symbols" - } - } - implies: "opt_only_flag" - } - feature { - name: "dbg" - implies: "dbg_only_flag" - } - feature { - name: "compile_all_modules" - } - feature { - name: "exclude_private_headers_in_module_maps" - } - feature { - name: "has_configured_linker_path" - } - feature { - name: "only_doth_headers_in_module_maps" - } - feature { - name: "is_not_test_target" - } feature { name: "default_compile_flags" flag_set { @@ -2014,6 +1972,62 @@ toolchain { } enabled: true } + feature { + name: "default_link_flags" + flag_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "objc-executable" + action: "objc++-executable" + flag_group { + flag: "-lc++" + } + } + enabled: true + } + feature { + name: "no_legacy_features" + } + feature { + name: "fastbuild" + implies: "fastbuild_only_flag" + } + feature { + name: "opt" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-g0" + } + with_feature { + feature: "no_generate_debug_symbols" + } + } + implies: "opt_only_flag" + } + feature { + name: "dbg" + implies: "dbg_only_flag" + } + feature { + name: "compile_all_modules" + } + feature { + name: "exclude_private_headers_in_module_maps" + } + feature { + name: "has_configured_linker_path" + } + feature { + name: "only_doth_headers_in_module_maps" + } + feature { + name: "is_not_test_target" + } feature { name: "generate_dsym_file" flag_set { @@ -2593,20 +2607,6 @@ toolchain { } enabled: true } - feature { - name: "default_link_flags" - flag_set { - action: "c++-link-executable" - action: "c++-link-dynamic-library" - action: "c++-link-nodeps-dynamic-library" - action: "objc-executable" - action: "objc++-executable" - flag_group { - flag: "-lc++" - } - } - enabled: true - } feature { name: "version_min" flag_set { @@ -3660,48 +3660,6 @@ toolchain { cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs" cxx_builtin_include_directory: "/usr/include" builtin_sysroot: "" - feature { - name: "no_legacy_features" - } - feature { - name: "fastbuild" - implies: "fastbuild_only_flag" - } - feature { - name: "opt" - flag_set { - action: "c-compile" - action: "c++-compile" - action: "objc-compile" - action: "objc++-compile" - flag_group { - flag: "-g0" - } - with_feature { - feature: "no_generate_debug_symbols" - } - } - implies: "opt_only_flag" - } - feature { - name: "dbg" - implies: "dbg_only_flag" - } - feature { - name: "compile_all_modules" - } - feature { - name: "exclude_private_headers_in_module_maps" - } - feature { - name: "has_configured_linker_path" - } - feature { - name: "only_doth_headers_in_module_maps" - } - feature { - name: "is_not_test_target" - } feature { name: "default_compile_flags" flag_set { @@ -3806,6 +3764,64 @@ toolchain { } enabled: true } + feature { + name: "default_link_flags" + flag_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "objc-executable" + action: "objc++-executable" + flag_group { + flag: "-lc++" + flag: "-target" + flag: "x86_64-apple-ios" + } + } + enabled: true + } + feature { + name: "no_legacy_features" + } + feature { + name: "fastbuild" + implies: "fastbuild_only_flag" + } + feature { + name: "opt" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-g0" + } + with_feature { + feature: "no_generate_debug_symbols" + } + } + implies: "opt_only_flag" + } + feature { + name: "dbg" + implies: "dbg_only_flag" + } + feature { + name: "compile_all_modules" + } + feature { + name: "exclude_private_headers_in_module_maps" + } + feature { + name: "has_configured_linker_path" + } + feature { + name: "only_doth_headers_in_module_maps" + } + feature { + name: "is_not_test_target" + } feature { name: "generate_dsym_file" flag_set { @@ -4385,22 +4401,6 @@ toolchain { } enabled: true } - feature { - name: "default_link_flags" - flag_set { - action: "c++-link-executable" - action: "c++-link-dynamic-library" - action: "c++-link-nodeps-dynamic-library" - action: "objc-executable" - action: "objc++-executable" - flag_group { - flag: "-lc++" - flag: "-target" - flag: "x86_64-apple-ios" - } - } - enabled: true - } feature { name: "version_min" flag_set { @@ -5468,48 +5468,6 @@ toolchain { cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs" cxx_builtin_include_directory: "/usr/include" builtin_sysroot: "" - feature { - name: "no_legacy_features" - } - feature { - name: "fastbuild" - implies: "fastbuild_only_flag" - } - feature { - name: "opt" - flag_set { - action: "c-compile" - action: "c++-compile" - action: "objc-compile" - action: "objc++-compile" - flag_group { - flag: "-g0" - } - with_feature { - feature: "no_generate_debug_symbols" - } - } - implies: "opt_only_flag" - } - feature { - name: "dbg" - implies: "dbg_only_flag" - } - feature { - name: "compile_all_modules" - } - feature { - name: "exclude_private_headers_in_module_maps" - } - feature { - name: "has_configured_linker_path" - } - feature { - name: "only_doth_headers_in_module_maps" - } - feature { - name: "is_not_test_target" - } feature { name: "default_compile_flags" flag_set { @@ -5579,40 +5537,98 @@ toolchain { } } flag_set { - action: "assemble" - action: "preprocess-assemble" - action: "linkstamp-compile" + action: "assemble" + action: "preprocess-assemble" + action: "linkstamp-compile" + action: "c-compile" + action: "c++-compile" + action: "c++-header-parsing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "lto-backend" + action: "clif-match" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-g" + flag: "-DDEBUG" + } + with_feature { + feature: "dbg" + } + } + flag_set { + action: "linkstamp-compile" + action: "c++-compile" + action: "c++-header-parsing" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "lto-backend" + action: "clif-match" + flag_group { + flag: "-std=gnu++11" + flag: "-stdlib=libc++" + } + } + enabled: true + } + feature { + name: "default_link_flags" + flag_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "objc-executable" + action: "objc++-executable" + flag_group { + flag: "-lc++" + flag: "-target" + flag: "i386-apple-ios" + } + } + enabled: true + } + feature { + name: "no_legacy_features" + } + feature { + name: "fastbuild" + implies: "fastbuild_only_flag" + } + feature { + name: "opt" + flag_set { action: "c-compile" action: "c++-compile" - action: "c++-header-parsing" - action: "c++-module-compile" - action: "c++-module-codegen" - action: "lto-backend" - action: "clif-match" action: "objc-compile" action: "objc++-compile" flag_group { - flag: "-g" - flag: "-DDEBUG" + flag: "-g0" } with_feature { - feature: "dbg" - } - } - flag_set { - action: "linkstamp-compile" - action: "c++-compile" - action: "c++-header-parsing" - action: "c++-module-compile" - action: "c++-module-codegen" - action: "lto-backend" - action: "clif-match" - flag_group { - flag: "-std=gnu++11" - flag: "-stdlib=libc++" + feature: "no_generate_debug_symbols" } } - enabled: true + implies: "opt_only_flag" + } + feature { + name: "dbg" + implies: "dbg_only_flag" + } + feature { + name: "compile_all_modules" + } + feature { + name: "exclude_private_headers_in_module_maps" + } + feature { + name: "has_configured_linker_path" + } + feature { + name: "only_doth_headers_in_module_maps" + } + feature { + name: "is_not_test_target" } feature { name: "generate_dsym_file" @@ -6195,22 +6211,6 @@ toolchain { } enabled: true } - feature { - name: "default_link_flags" - flag_set { - action: "c++-link-executable" - action: "c++-link-dynamic-library" - action: "c++-link-nodeps-dynamic-library" - action: "objc-executable" - action: "objc++-executable" - flag_group { - flag: "-lc++" - flag: "-target" - flag: "i386-apple-ios" - } - } - enabled: true - } feature { name: "version_min" flag_set { @@ -7278,48 +7278,6 @@ toolchain { cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs" cxx_builtin_include_directory: "/usr/include" builtin_sysroot: "" - feature { - name: "no_legacy_features" - } - feature { - name: "fastbuild" - implies: "fastbuild_only_flag" - } - feature { - name: "opt" - flag_set { - action: "c-compile" - action: "c++-compile" - action: "objc-compile" - action: "objc++-compile" - flag_group { - flag: "-g0" - } - with_feature { - feature: "no_generate_debug_symbols" - } - } - implies: "opt_only_flag" - } - feature { - name: "dbg" - implies: "dbg_only_flag" - } - feature { - name: "compile_all_modules" - } - feature { - name: "exclude_private_headers_in_module_maps" - } - feature { - name: "has_configured_linker_path" - } - feature { - name: "only_doth_headers_in_module_maps" - } - feature { - name: "is_not_test_target" - } feature { name: "default_compile_flags" flag_set { @@ -7425,6 +7383,64 @@ toolchain { } enabled: true } + feature { + name: "default_link_flags" + flag_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "objc-executable" + action: "objc++-executable" + flag_group { + flag: "-lc++" + flag: "-target" + flag: "x86_64-apple-tvos" + } + } + enabled: true + } + feature { + name: "no_legacy_features" + } + feature { + name: "fastbuild" + implies: "fastbuild_only_flag" + } + feature { + name: "opt" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-g0" + } + with_feature { + feature: "no_generate_debug_symbols" + } + } + implies: "opt_only_flag" + } + feature { + name: "dbg" + implies: "dbg_only_flag" + } + feature { + name: "compile_all_modules" + } + feature { + name: "exclude_private_headers_in_module_maps" + } + feature { + name: "has_configured_linker_path" + } + feature { + name: "only_doth_headers_in_module_maps" + } + feature { + name: "is_not_test_target" + } feature { name: "generate_dsym_file" flag_set { @@ -8004,22 +8020,6 @@ toolchain { } enabled: true } - feature { - name: "default_link_flags" - flag_set { - action: "c++-link-executable" - action: "c++-link-dynamic-library" - action: "c++-link-nodeps-dynamic-library" - action: "objc-executable" - action: "objc++-executable" - flag_group { - flag: "-lc++" - flag: "-target" - flag: "x86_64-apple-tvos" - } - } - enabled: true - } feature { name: "version_min" flag_set { @@ -9117,48 +9117,6 @@ toolchain { cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs" cxx_builtin_include_directory: "/usr/include" builtin_sysroot: "" - feature { - name: "no_legacy_features" - } - feature { - name: "fastbuild" - implies: "fastbuild_only_flag" - } - feature { - name: "opt" - flag_set { - action: "c-compile" - action: "c++-compile" - action: "objc-compile" - action: "objc++-compile" - flag_group { - flag: "-g0" - } - with_feature { - feature: "no_generate_debug_symbols" - } - } - implies: "opt_only_flag" - } - feature { - name: "dbg" - implies: "dbg_only_flag" - } - feature { - name: "compile_all_modules" - } - feature { - name: "exclude_private_headers_in_module_maps" - } - feature { - name: "has_configured_linker_path" - } - feature { - name: "only_doth_headers_in_module_maps" - } - feature { - name: "is_not_test_target" - } feature { name: "default_compile_flags" flag_set { @@ -9257,11 +9215,69 @@ toolchain { action: "lto-backend" action: "clif-match" flag_group { - flag: "-std=gnu++11" - flag: "-stdlib=libc++" + flag: "-std=gnu++11" + flag: "-stdlib=libc++" + } + } + enabled: true + } + feature { + name: "default_link_flags" + flag_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "objc-executable" + action: "objc++-executable" + flag_group { + flag: "-lc++" + flag: "-target" + flag: "i386-apple-ios" + } + } + enabled: true + } + feature { + name: "no_legacy_features" + } + feature { + name: "fastbuild" + implies: "fastbuild_only_flag" + } + feature { + name: "opt" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-g0" + } + with_feature { + feature: "no_generate_debug_symbols" } } - enabled: true + implies: "opt_only_flag" + } + feature { + name: "dbg" + implies: "dbg_only_flag" + } + feature { + name: "compile_all_modules" + } + feature { + name: "exclude_private_headers_in_module_maps" + } + feature { + name: "has_configured_linker_path" + } + feature { + name: "only_doth_headers_in_module_maps" + } + feature { + name: "is_not_test_target" } feature { name: "generate_dsym_file" @@ -9842,22 +9858,6 @@ toolchain { } enabled: true } - feature { - name: "default_link_flags" - flag_set { - action: "c++-link-executable" - action: "c++-link-dynamic-library" - action: "c++-link-nodeps-dynamic-library" - action: "objc-executable" - action: "objc++-executable" - flag_group { - flag: "-lc++" - flag: "-target" - flag: "i386-apple-ios" - } - } - enabled: true - } feature { name: "version_min" flag_set { @@ -10925,48 +10925,6 @@ toolchain { cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs" cxx_builtin_include_directory: "/usr/include" builtin_sysroot: "" - feature { - name: "no_legacy_features" - } - feature { - name: "fastbuild" - implies: "fastbuild_only_flag" - } - feature { - name: "opt" - flag_set { - action: "c-compile" - action: "c++-compile" - action: "objc-compile" - action: "objc++-compile" - flag_group { - flag: "-g0" - } - with_feature { - feature: "no_generate_debug_symbols" - } - } - implies: "opt_only_flag" - } - feature { - name: "dbg" - implies: "dbg_only_flag" - } - feature { - name: "compile_all_modules" - } - feature { - name: "exclude_private_headers_in_module_maps" - } - feature { - name: "has_configured_linker_path" - } - feature { - name: "only_doth_headers_in_module_maps" - } - feature { - name: "is_not_test_target" - } feature { name: "default_compile_flags" flag_set { @@ -11071,6 +11029,64 @@ toolchain { } enabled: true } + feature { + name: "default_link_flags" + flag_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "objc-executable" + action: "objc++-executable" + flag_group { + flag: "-lc++" + flag: "-target" + flag: "armv7-apple-ios" + } + } + enabled: true + } + feature { + name: "no_legacy_features" + } + feature { + name: "fastbuild" + implies: "fastbuild_only_flag" + } + feature { + name: "opt" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-g0" + } + with_feature { + feature: "no_generate_debug_symbols" + } + } + implies: "opt_only_flag" + } + feature { + name: "dbg" + implies: "dbg_only_flag" + } + feature { + name: "compile_all_modules" + } + feature { + name: "exclude_private_headers_in_module_maps" + } + feature { + name: "has_configured_linker_path" + } + feature { + name: "only_doth_headers_in_module_maps" + } + feature { + name: "is_not_test_target" + } feature { name: "generate_dsym_file" flag_set { @@ -11650,22 +11666,6 @@ toolchain { } enabled: true } - feature { - name: "default_link_flags" - flag_set { - action: "c++-link-executable" - action: "c++-link-dynamic-library" - action: "c++-link-nodeps-dynamic-library" - action: "objc-executable" - action: "objc++-executable" - flag_group { - flag: "-lc++" - flag: "-target" - flag: "armv7-apple-ios" - } - } - enabled: true - } feature { name: "version_min" flag_set { @@ -12753,48 +12753,6 @@ toolchain { cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs" cxx_builtin_include_directory: "/usr/include" builtin_sysroot: "" - feature { - name: "no_legacy_features" - } - feature { - name: "fastbuild" - implies: "fastbuild_only_flag" - } - feature { - name: "opt" - flag_set { - action: "c-compile" - action: "c++-compile" - action: "objc-compile" - action: "objc++-compile" - flag_group { - flag: "-g0" - } - with_feature { - feature: "no_generate_debug_symbols" - } - } - implies: "opt_only_flag" - } - feature { - name: "dbg" - implies: "dbg_only_flag" - } - feature { - name: "compile_all_modules" - } - feature { - name: "exclude_private_headers_in_module_maps" - } - feature { - name: "has_configured_linker_path" - } - feature { - name: "only_doth_headers_in_module_maps" - } - feature { - name: "is_not_test_target" - } feature { name: "default_compile_flags" flag_set { @@ -12899,6 +12857,64 @@ toolchain { } enabled: true } + feature { + name: "default_link_flags" + flag_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "objc-executable" + action: "objc++-executable" + flag_group { + flag: "-lc++" + flag: "-target" + flag: "armv7-apple-watchos" + } + } + enabled: true + } + feature { + name: "no_legacy_features" + } + feature { + name: "fastbuild" + implies: "fastbuild_only_flag" + } + feature { + name: "opt" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-g0" + } + with_feature { + feature: "no_generate_debug_symbols" + } + } + implies: "opt_only_flag" + } + feature { + name: "dbg" + implies: "dbg_only_flag" + } + feature { + name: "compile_all_modules" + } + feature { + name: "exclude_private_headers_in_module_maps" + } + feature { + name: "has_configured_linker_path" + } + feature { + name: "only_doth_headers_in_module_maps" + } + feature { + name: "is_not_test_target" + } feature { name: "generate_dsym_file" flag_set { @@ -13480,22 +13496,6 @@ toolchain { } enabled: true } - feature { - name: "default_link_flags" - flag_set { - action: "c++-link-executable" - action: "c++-link-dynamic-library" - action: "c++-link-nodeps-dynamic-library" - action: "objc-executable" - action: "objc++-executable" - flag_group { - flag: "-lc++" - flag: "-target" - flag: "armv7-apple-watchos" - } - } - enabled: true - } feature { name: "version_min" flag_set { @@ -14583,48 +14583,6 @@ toolchain { cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs" cxx_builtin_include_directory: "/usr/include" builtin_sysroot: "" - feature { - name: "no_legacy_features" - } - feature { - name: "fastbuild" - implies: "fastbuild_only_flag" - } - feature { - name: "opt" - flag_set { - action: "c-compile" - action: "c++-compile" - action: "objc-compile" - action: "objc++-compile" - flag_group { - flag: "-g0" - } - with_feature { - feature: "no_generate_debug_symbols" - } - } - implies: "opt_only_flag" - } - feature { - name: "dbg" - implies: "dbg_only_flag" - } - feature { - name: "compile_all_modules" - } - feature { - name: "exclude_private_headers_in_module_maps" - } - feature { - name: "has_configured_linker_path" - } - feature { - name: "only_doth_headers_in_module_maps" - } - feature { - name: "is_not_test_target" - } feature { name: "default_compile_flags" flag_set { @@ -14730,6 +14688,64 @@ toolchain { } enabled: true } + feature { + name: "default_link_flags" + flag_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "objc-executable" + action: "objc++-executable" + flag_group { + flag: "-lc++" + flag: "-target" + flag: "arm64-apple-tvos" + } + } + enabled: true + } + feature { + name: "no_legacy_features" + } + feature { + name: "fastbuild" + implies: "fastbuild_only_flag" + } + feature { + name: "opt" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-g0" + } + with_feature { + feature: "no_generate_debug_symbols" + } + } + implies: "opt_only_flag" + } + feature { + name: "dbg" + implies: "dbg_only_flag" + } + feature { + name: "compile_all_modules" + } + feature { + name: "exclude_private_headers_in_module_maps" + } + feature { + name: "has_configured_linker_path" + } + feature { + name: "only_doth_headers_in_module_maps" + } + feature { + name: "is_not_test_target" + } feature { name: "generate_dsym_file" flag_set { @@ -15309,22 +15325,6 @@ toolchain { } enabled: true } - feature { - name: "default_link_flags" - flag_set { - action: "c++-link-executable" - action: "c++-link-dynamic-library" - action: "c++-link-nodeps-dynamic-library" - action: "objc-executable" - action: "objc++-executable" - flag_group { - flag: "-lc++" - flag: "-target" - flag: "arm64-apple-tvos" - } - } - enabled: true - } feature { name: "version_min" flag_set { @@ -16442,48 +16442,6 @@ toolchain { cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs" cxx_builtin_include_directory: "/usr/include" builtin_sysroot: "" - feature { - name: "no_legacy_features" - } - feature { - name: "fastbuild" - implies: "fastbuild_only_flag" - } - feature { - name: "opt" - flag_set { - action: "c-compile" - action: "c++-compile" - action: "objc-compile" - action: "objc++-compile" - flag_group { - flag: "-g0" - } - with_feature { - feature: "no_generate_debug_symbols" - } - } - implies: "opt_only_flag" - } - feature { - name: "dbg" - implies: "dbg_only_flag" - } - feature { - name: "compile_all_modules" - } - feature { - name: "exclude_private_headers_in_module_maps" - } - feature { - name: "has_configured_linker_path" - } - feature { - name: "only_doth_headers_in_module_maps" - } - feature { - name: "is_not_test_target" - } feature { name: "default_compile_flags" flag_set { @@ -16588,6 +16546,64 @@ toolchain { } enabled: true } + feature { + name: "default_link_flags" + flag_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "objc-executable" + action: "objc++-executable" + flag_group { + flag: "-lc++" + flag: "-target" + flag: "arm64-apple-ios" + } + } + enabled: true + } + feature { + name: "no_legacy_features" + } + feature { + name: "fastbuild" + implies: "fastbuild_only_flag" + } + feature { + name: "opt" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-g0" + } + with_feature { + feature: "no_generate_debug_symbols" + } + } + implies: "opt_only_flag" + } + feature { + name: "dbg" + implies: "dbg_only_flag" + } + feature { + name: "compile_all_modules" + } + feature { + name: "exclude_private_headers_in_module_maps" + } + feature { + name: "has_configured_linker_path" + } + feature { + name: "only_doth_headers_in_module_maps" + } + feature { + name: "is_not_test_target" + } feature { name: "generate_dsym_file" flag_set { @@ -17167,22 +17183,6 @@ toolchain { } enabled: true } - feature { - name: "default_link_flags" - flag_set { - action: "c++-link-executable" - action: "c++-link-dynamic-library" - action: "c++-link-nodeps-dynamic-library" - action: "objc-executable" - action: "objc++-executable" - flag_group { - flag: "-lc++" - flag: "-target" - flag: "arm64-apple-ios" - } - } - enabled: true - } feature { name: "version_min" flag_set { 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 b4adb2611a0a6d..5f7e5073413a71 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 @@ -547,12 +547,12 @@ public boolean apply(Artifact artifact) { + " name: 'thin_lto'" + " requires { feature: 'nonhost' }" + " flag_set {" - + " expand_if_all_available: 'thinlto_param_file'" + " action: 'c++-link-executable'" + " action: 'c++-link-dynamic-library'" + " action: 'c++-link-nodeps-dynamic-library'" + " action: 'c++-link-static-library'" + " flag_group {" + + " expand_if_all_available: 'thinlto_param_file'" + " flag: 'thinlto_param_file=%{thinlto_param_file}'" + " }" + " }" @@ -806,8 +806,8 @@ public boolean apply(Artifact artifact) { + " action: 'c-compile'" + " action: 'c++-compile'" + " action: 'lto-backend'" - + " expand_if_all_available: 'fdo_profile_path'" + " flag_group {" + + " expand_if_all_available: 'fdo_profile_path'" + " flag: '-fauto-profile=%{fdo_profile_path}'" + " flag: '-fprofile-correction'" + " }" diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesTest.java index c9f7baf7c0da60..cf6af681a2a4fe 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesTest.java @@ -1141,7 +1141,7 @@ public void testRequiresOneEnabledAndOneUnsupportedFeature() throws Exception { } @Test - public void testFlagSetWithMissingVariableIsNotExpanded() throws Exception { + public void testFlagGroupsWithMissingVariableIsNotExpanded() throws Exception { FeatureConfiguration configuration = buildFeatures( ruleContext, @@ -1149,8 +1149,7 @@ public void testFlagSetWithMissingVariableIsNotExpanded() throws Exception { " name: 'a'", " flag_set {", " action: 'c++-compile'", - " expand_if_all_available: 'v'", - " flag_group { flag: '%{v}' }", + " flag_group { expand_if_all_available: 'v' flag: '%{v}' }", " }", " flag_set {", " action: 'c++-compile'", @@ -1164,7 +1163,7 @@ public void testFlagSetWithMissingVariableIsNotExpanded() throws Exception { } @Test - public void testOnlyFlagSetsWithAllVariablesPresentAreExpanded() throws Exception { + public void testOnlyFlagGroupsWithAllVariablesPresentAreExpanded() throws Exception { FeatureConfiguration configuration = buildFeatures( ruleContext, @@ -1172,14 +1171,15 @@ public void testOnlyFlagSetsWithAllVariablesPresentAreExpanded() throws Exceptio " name: 'a'", " flag_set {", " action: 'c++-compile'", - " expand_if_all_available: 'v'", - " flag_group { flag: '%{v}' }", + " flag_group { expand_if_all_available: 'v' flag: '%{v}' }", " }", " flag_set {", " action: 'c++-compile'", - " expand_if_all_available: 'v'", - " expand_if_all_available: 'w'", - " flag_group { flag: '%{v}%{w}' }", + " flag_group {", + " expand_if_all_available: 'v'", + " expand_if_all_available: 'w'", + " flag: '%{v}%{w}'", + " }", " }", " flag_set {", " action: 'c++-compile'", @@ -1193,7 +1193,7 @@ public void testOnlyFlagSetsWithAllVariablesPresentAreExpanded() throws Exceptio } @Test - public void testOnlyInnerFlagSetIsIteratedWithSequenceVariable() throws Exception { + public void testOnlyInnerFlagGroupIsIteratedWithSequenceVariable() throws Exception { FeatureConfiguration configuration = buildFeatures( ruleContext, @@ -1201,14 +1201,16 @@ public void testOnlyInnerFlagSetIsIteratedWithSequenceVariable() throws Exceptio " name: 'a'", " flag_set {", " action: 'c++-compile'", - " expand_if_all_available: 'v'", - " flag_group { iterate_over: 'v' flag: '%{v}' }", + " flag_group { expand_if_all_available: 'v' iterate_over: 'v' flag: '%{v}' }", " }", " flag_set {", " action: 'c++-compile'", - " expand_if_all_available: 'v'", - " expand_if_all_available: 'w'", - " flag_group { iterate_over: 'v' flag: '%{v}%{w}' }", + " flag_group { ", + " iterate_over: 'v'", + " expand_if_all_available: 'v'", + " expand_if_all_available: 'w'", + " flag: '%{v}%{w}'", + " }", " }", " flag_set {", " action: 'c++-compile'", @@ -1233,14 +1235,16 @@ public void testFlagSetsAreIteratedIndividuallyForSequenceVariables() throws Exc " name: 'a'", " flag_set {", " action: 'c++-compile'", - " expand_if_all_available: 'v'", - " flag_group { iterate_over: 'v' flag: '%{v}' }", + " flag_group { expand_if_all_available: 'v' iterate_over: 'v' flag: '%{v}' }", " }", " flag_set {", " action: 'c++-compile'", - " expand_if_all_available: 'v'", - " expand_if_all_available: 'w'", - " flag_group { iterate_over: 'v' flag: '%{v}%{w}' }", + " flag_group { ", + " iterate_over: 'v'", + " expand_if_all_available: 'v'", + " expand_if_all_available: 'w'", + " flag: '%{v}%{w}'", + " }", " }", " flag_set {", " action: 'c++-compile'",