From 0fdb36f8a5cf79fda9931b6e3f119bb5f41f0701 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Wed, 16 Oct 2024 08:31:58 -0700 Subject: [PATCH] Propagate `linkopts` of header-only libraries to `cc_shared_library` Fixes #21884 Fixes #23053 Closes #23215. PiperOrigin-RevId: 686518093 Change-Id: I1a6699b169fe4291ad0dda3be7e74f38c8e37bf1 --- .../common/cc/cc_shared_library.bzl | 15 +++--- .../BUILD.builtin_test | 49 ++++++++++--------- .../a_suffix.cc | 2 +- .../a_suffix.h | 0 .../additional_script.txt | 0 .../{test_cc_shared_library => test}/bar.cc | 2 +- .../{test_cc_shared_library => test}/bar.h | 0 .../{test_cc_shared_library => test}/bar.lds | 0 .../{test_cc_shared_library => test}/bar2.cc | 2 +- .../{test_cc_shared_library => test}/bar2.h | 0 .../{test_cc_shared_library => test}/bar3.cc | 2 +- .../{test_cc_shared_library => test}/bar3.h | 0 .../{test_cc_shared_library => test}/barX.cc | 2 +- .../{test_cc_shared_library => test}/barX.h | 0 .../{test_cc_shared_library => test}/baz.cc | 2 +- .../{test_cc_shared_library => test}/baz.h | 0 .../cc_shared_library_integration_test.sh | 0 .../direct_so_file_cc_lib.cc | 2 +- .../direct_so_file_cc_lib.h | 0 .../direct_so_file_cc_lib2.cc | 2 +- .../direct_so_file_cc_lib2.h | 0 .../failing_targets/BUILD.builtin_test | 9 ++-- .../failing_targets/a.cc | 0 .../failing_targets/b.cc | 0 .../failing_targets/c.cc | 0 .../failing_targets/empty.cc | 0 .../failing_targets/main.cc | 0 .../{test_cc_shared_library => test}/foo.cc | 12 ++--- .../{test_cc_shared_library => test}/foo.h | 0 .../{test_cc_shared_library => test}/foo.lds | 0 .../indirect_dep.cc | 0 .../indirect_dep2.cc | 0 .../indirect_dep3.cc | 0 .../{test_cc_shared_library => test}/l.cc | 0 .../{test_cc_shared_library => test}/main.cc | 2 +- .../not_depended_on.cc | 2 +- .../python_test.py | 0 .../{test_cc_shared_library => test}/quux.cc | 0 .../{test_cc_shared_library => test}/qux.cc | 2 +- .../{test_cc_shared_library => test}/qux.h | 0 .../{test_cc_shared_library => test}/qux2.cc | 2 +- .../{test_cc_shared_library => test}/qux2.h | 0 .../cc/cc_shared_library/test/semantics.bzl | 19 +++++++ .../starlark_tests.bzl | 22 +++++---- .../testenv.sh | 0 .../BUILD.builtin_test | 0 .../MODULE.bazel | 0 .../WORKSPACE | 0 .../{test_cc_shared_library2 => test2}/bar.cc | 0 .../{test_cc_shared_library2 => test2}/bar.h | 0 .../BUILD.builtin_test | 0 .../{test_cc_shared_library3 => test3}/bar.cc | 0 .../{test_cc_shared_library3 => test3}/bar.h | 0 .../diff_pkg.cc | 2 +- .../diff_pkg.h | 0 .../BUILD.builtin_test | 0 .../{test_cc_shared_library4 => test4}/bar.cc | 2 +- .../{test_cc_shared_library4 => test4}/bar.h | 0 .../main.cc | 2 +- .../BUILD.builtin_test | 0 .../{test_cc_static_library => test}/bar.cc | 4 +- .../{test_cc_static_library => test}/bar.h | 0 .../cc_static_library_integration_test.sh | 0 .../{test_cc_static_library => test}/foo.cc | 2 +- .../{test_cc_static_library => test}/foo.h | 0 .../lib_only.cc | 0 .../mock_toolchain.bzl | 0 .../starlark_tests.bzl | 0 .../{test_cc_static_library => test}/test.cc | 2 +- .../tests/builtins_bzl/cc_builtin_tests.sh | 2 +- 70 files changed, 97 insertions(+), 69 deletions(-) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/BUILD.builtin_test (91%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/a_suffix.cc (94%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/a_suffix.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/additional_script.txt (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/bar.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/bar.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/bar.lds (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/bar2.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/bar2.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/bar3.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/bar3.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/barX.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/barX.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/baz.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/baz.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/cc_shared_library_integration_test.sh (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/direct_so_file_cc_lib.cc (93%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/direct_so_file_cc_lib.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/direct_so_file_cc_lib2.cc (93%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/direct_so_file_cc_lib2.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/failing_targets/BUILD.builtin_test (91%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/failing_targets/a.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/failing_targets/b.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/failing_targets/c.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/failing_targets/empty.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/failing_targets/main.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/foo.cc (82%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/foo.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/foo.lds (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/indirect_dep.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/indirect_dep2.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/indirect_dep3.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/l.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/main.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/not_depended_on.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/python_test.py (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/quux.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/qux.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/qux.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/qux2.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/qux2.h (100%) create mode 100644 src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/semantics.bzl rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/starlark_tests.bzl (96%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library => test}/testenv.sh (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library2 => test2}/BUILD.builtin_test (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library2 => test2}/MODULE.bazel (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library2 => test2}/WORKSPACE (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library2 => test2}/bar.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library2 => test2}/bar.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library3 => test3}/BUILD.builtin_test (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library3 => test3}/bar.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library3 => test3}/bar.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library3 => test3}/diff_pkg.cc (94%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library3 => test3}/diff_pkg.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library4 => test4}/BUILD.builtin_test (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library4 => test4}/bar.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library4 => test4}/bar.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/{test_cc_shared_library4 => test4}/main.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_static_library/{test_cc_static_library => test}/BUILD.builtin_test (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_static_library/{test_cc_static_library => test}/bar.cc (92%) rename src/main/starlark/tests/builtins_bzl/cc/cc_static_library/{test_cc_static_library => test}/bar.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_static_library/{test_cc_static_library => test}/cc_static_library_integration_test.sh (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_static_library/{test_cc_static_library => test}/foo.cc (95%) rename src/main/starlark/tests/builtins_bzl/cc/cc_static_library/{test_cc_static_library => test}/foo.h (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_static_library/{test_cc_static_library => test}/lib_only.cc (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_static_library/{test_cc_static_library => test}/mock_toolchain.bzl (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_static_library/{test_cc_static_library => test}/starlark_tests.bzl (100%) rename src/main/starlark/tests/builtins_bzl/cc/cc_static_library/{test_cc_static_library => test}/test.cc (95%) diff --git a/src/main/starlark/builtins_bzl/common/cc/cc_shared_library.bzl b/src/main/starlark/builtins_bzl/common/cc/cc_shared_library.bzl index 7831400e44607f..d018006b6ecf46 100644 --- a/src/main/starlark/builtins_bzl/common/cc/cc_shared_library.bzl +++ b/src/main/starlark/builtins_bzl/common/cc/cc_shared_library.bzl @@ -446,7 +446,15 @@ def _filter_inputs( continue linker_inputs_seen[stringified_linker_input] = True owner = str(linker_input.owner) - if owner in targets_to_be_linked_dynamically_set: + if semantics.is_bazel and not linker_input.libraries: + # Linker inputs that only provide flags, no code, are considered + # safe to link statically multiple times. + # TODO(bazel-team): semantics.should_create_empty_archive() should be + # cleaned up and return False in every case. cc_libraries shouldn't + # produce empty archives. For now issue #19920 is only fixed in Bazel. + _add_linker_input_to_dict(linker_input.owner, linker_input) + linker_inputs_count += 1 + elif owner in targets_to_be_linked_dynamically_set: unused_dynamic_linker_inputs[transitive_exports[owner].owner] = None # Link the library in this iteration dynamically, @@ -455,11 +463,6 @@ def _filter_inputs( _add_linker_input_to_dict(linker_input.owner, transitive_exports[owner]) linker_inputs_count += 1 elif owner in targets_to_be_linked_statically_map: - if semantics.is_bazel and not linker_input.libraries: - # TODO(bazel-team): semantics.should_create_empty_archive() should be - # cleaned up and return False in every case. cc_libraries shouldn't - # produce empty archives. For now issue #19920 is only fixed in Bazel. - continue if owner in link_once_static_libs_map: # We are building a dictionary that will allow us to give # proper errors for libraries that have been linked multiple diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/BUILD.builtin_test b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/BUILD.builtin_test similarity index 91% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/BUILD.builtin_test rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/BUILD.builtin_test index 7fb5bbf41fb32c..c212764c6cde86 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/BUILD.builtin_test +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/BUILD.builtin_test @@ -26,7 +26,7 @@ NO_BUILD_TAGS = [ licenses(["notice"]) package( - default_visibility = ["//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:__subpackages__"], + default_visibility = ["//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:__subpackages__"], ) py_test( @@ -119,7 +119,7 @@ cc_shared_library( }), dynamic_deps = [ "bar_so", - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3:diff_pkg_so", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3:diff_pkg_so", "private_lib_so", ], exports_filter = [ @@ -176,7 +176,7 @@ cc_library( # Not exported. "qux", "prebuilt", - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3:diff_pkg" + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3:diff_pkg" ], ) @@ -275,7 +275,7 @@ cc_shared_library( }), exports_filter = [ "bar3", # Exported transitive dependency - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3:bar", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3:bar", ], features = ["windows_export_all_symbols"], user_link_flags = select({ @@ -330,7 +330,7 @@ cc_library( srcs = ["bar3.cc"], hdrs = ["bar3.h"], deps = [ - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3:bar", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3:bar", ], ) @@ -371,17 +371,17 @@ additional_inputs_test( build_failure_test( name = "link_once_repeated_test_binary", messages = [ - "cc_shared_library/test_cc_shared_library:barX\",", + "cc_shared_library/test:barX\",", ], - target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets:should_fail_binary", + target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets:should_fail_binary", ) build_failure_test( name = "link_once_repeated_test_shared_lib", messages = [ - "cc_shared_library/test_cc_shared_library:barX\",", + "cc_shared_library/test:barX\",", ], - target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets:should_fail_shared_lib", + target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets:should_fail_shared_lib", ) paths_test( @@ -473,6 +473,9 @@ genrule( cc_library( name = "hdr_only", hdrs = [":hdr_only_hdr"], + linkopts = [ + "-Wl,-rpath,hdr_only", + ], ) cc_library( @@ -486,22 +489,22 @@ cc_library( cc_shared_library( name = "external_export_so", exports_filter = ["@my_test_repo//:__pkg__"], + tags = ["bazel_only"], deps = [ ":external_export", ], - tags = ["bazel_only"], ) build_failure_test( name = "two_dynamic_deps_same_export_in_so_test", message = "Two shared libraries in dependencies export the same symbols", - target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets:two_dynamic_deps_same_export_in_so", + target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets:two_dynamic_deps_same_export_in_so", ) build_failure_test( name = "two_dynamic_deps_same_export_in_binary_test", message = "Two shared libraries in dependencies link the same library statically", - target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets:two_dynamic_deps_same_export_in_binary", + target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets:two_dynamic_deps_same_export_in_binary", ) interface_library_output_group_test( @@ -532,36 +535,36 @@ check_linking_action_lib_parameters_test( build_failure_test( name = "shared_library_without_deps", message = "'cc_shared_library' must have at least one dependency in 'deps' (or 'roots')", - target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets:failing_with_no_deps_so", + target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets:failing_with_no_deps_so", ) build_failure_test( name = "direct_dep_with_only_shared_lib_file", message = "Do not place libraries which only contain a precompiled dynamic library", - target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets:failing_only_dynamic_lib", + target = "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets:failing_only_dynamic_lib", ) exports_test( name = "exports_foo_test", target = ":foo_so", targets_that_should_be_claimed_to_be_exported = [ - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:indirect_dep2", - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:baz", - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:foo", - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:cc_lib_with_no_srcs", - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:nocode_cc_lib", - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:should_not_be_linked_cc_lib", - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:a_suffix", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:indirect_dep2", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:baz", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:foo", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:cc_lib_with_no_srcs", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:nocode_cc_lib", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:should_not_be_linked_cc_lib", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:a_suffix", ], ) exports_test( name = "external_export_exports_test", - target = "external_export_so", bazel_only = True, + target = "external_export_so", targets_that_should_be_claimed_to_be_exported = [ "@@test_repo+//:bar", - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:external_export", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:external_export", ], ) diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/a_suffix.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/a_suffix.cc similarity index 94% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/a_suffix.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/a_suffix.cc index 063a1336fda8c7..9a813838fff26c 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/a_suffix.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/a_suffix.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/a_suffix.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/a_suffix.h" int a_suffix() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/a_suffix.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/a_suffix.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/a_suffix.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/a_suffix.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/additional_script.txt b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/additional_script.txt similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/additional_script.txt rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/additional_script.txt diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar.cc index 785f3ea5bda292..9ad8fc87dcca73 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar.h" int bar() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar.lds b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar.lds similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar.lds rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar.lds diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar2.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar2.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar2.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar2.cc index 89470613b7213a..b71649f5619513 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar2.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar2.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar2.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar2.h" int bar2() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar2.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar2.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar2.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar2.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar3.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar3.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar3.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar3.cc index 050254110b850c..23e48749f4dafa 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar3.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar3.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar3.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar3.h" int bar3() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar3.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar3.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar3.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar3.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/barX.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/barX.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/barX.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/barX.cc index e5b1ae1318c26b..c94b653d8a4bdd 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/barX.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/barX.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/barX.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/barX.h" int barX() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/barX.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/barX.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/barX.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/barX.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/baz.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/baz.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/baz.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/baz.cc index aef2ed5cf797c3..74736bad2277dc 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/baz.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/baz.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/baz.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/baz.h" int baz() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/baz.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/baz.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/baz.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/baz.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/cc_shared_library_integration_test.sh b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/cc_shared_library_integration_test.sh similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/cc_shared_library_integration_test.sh rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/cc_shared_library_integration_test.sh diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib.cc similarity index 93% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib.cc index c1875415cbf31c..81a6ede80fd29f 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib.cc @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib.h" int direct_so_file_cc_lib() { return 0; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib2.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib2.cc similarity index 93% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib2.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib2.cc index fe878c1ee2029d..d73f69e2af9a28 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib2.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib2.cc @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib2.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib2.h" int direct_so_file_cc_lib2() { return 0; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib2.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib2.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib2.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib2.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/BUILD.builtin_test b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/BUILD.builtin_test similarity index 91% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/BUILD.builtin_test rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/BUILD.builtin_test index 5b0b495c8ed70f..76142c446e85b0 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/BUILD.builtin_test +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/BUILD.builtin_test @@ -9,16 +9,16 @@ TAGS = [ cc_binary( name = "should_fail_binary", - dynamic_deps = ["//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:bar_so"], + dynamic_deps = ["//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:bar_so"], tags = TAGS, deps = [ - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:barX", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:barX", ], ) cc_shared_library( name = "should_fail_shared_lib", - dynamic_deps = ["//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:bar_so"], + dynamic_deps = ["//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:bar_so"], deps = [ ":intermediate", ], @@ -28,7 +28,7 @@ cc_shared_library( cc_library( name = "intermediate", deps = [ - "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library:barX", + "//src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test:barX", ], ) @@ -112,4 +112,3 @@ genrule( outs = ["libabc.so"], cmd = "touch \"$@\"", ) - diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/a.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/a.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/a.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/a.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/b.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/b.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/b.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/b.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/c.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/c.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/c.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/c.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/empty.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/empty.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/empty.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/empty.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/main.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/main.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/failing_targets/main.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/failing_targets/main.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/foo.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/foo.cc similarity index 82% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/foo.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/foo.cc index 0fd81db5253a5f..d0f89655dbc703 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/foo.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/foo.cc @@ -11,12 +11,12 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar.h" -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/baz.h" -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib.h" -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/direct_so_file_cc_lib2.h" -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux.h" -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/diff_pkg.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/baz.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/direct_so_file_cc_lib2.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/diff_pkg.h" int foo() { diff_pkg(); diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/foo.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/foo.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/foo.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/foo.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/foo.lds b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/foo.lds similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/foo.lds rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/foo.lds diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/indirect_dep.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/indirect_dep.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/indirect_dep.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/indirect_dep.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/indirect_dep2.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/indirect_dep2.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/indirect_dep2.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/indirect_dep2.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/indirect_dep3.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/indirect_dep3.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/indirect_dep3.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/indirect_dep3.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/l.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/l.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/l.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/l.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/main.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/main.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/main.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/main.cc index d7c47e9ad8f681..9de73c429efb5a 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/main.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/main.cc @@ -13,7 +13,7 @@ // limitations under the License. #include -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/foo.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/foo.h" int main() { std::cout << "hello " << foo() << std::endl; diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/not_depended_on.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/not_depended_on.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/not_depended_on.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/not_depended_on.cc index aecaa0c403e982..98b984b16fa493 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/not_depended_on.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/not_depended_on.cc @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/bar.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/bar.h" int foo() { bar(); diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/python_test.py b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/python_test.py similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/python_test.py rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/python_test.py diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/quux.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/quux.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/quux.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/quux.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux.cc index 1463ba696ed419..b6124780ee4d05 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux.h" int qux() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux2.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux2.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux2.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux2.cc index 95872ce7eef213..3e161da3b2f544 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux2.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux2.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux2.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux2.h" int qux2() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux2.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux2.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/qux2.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/qux2.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/semantics.bzl b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/semantics.bzl new file mode 100644 index 00000000000000..0a3c596964e93e --- /dev/null +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/semantics.bzl @@ -0,0 +1,19 @@ +# Copyright 2024 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Semantics for Bazel cc_shared_library integration tests.""" + +semantics = struct( + is_bazel = True, +) diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/starlark_tests.bzl b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/starlark_tests.bzl similarity index 96% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/starlark_tests.bzl rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/starlark_tests.bzl index a36187b11a8b3b..5145fe53ab6ffb 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/starlark_tests.bzl +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/starlark_tests.bzl @@ -17,6 +17,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths") load("@rules_testing//lib:analysis_test.bzl", "analysis_test") load("@rules_testing//lib:truth.bzl", "matching") +load(":semantics.bzl", "semantics") def _same_package_or_above(label_a, label_b): if label_a.workspace_name != label_b.workspace_name: @@ -61,6 +62,9 @@ def _linking_order_test_impl(env, target): env.expect.that_collection(args).contains_at_least([ "-lprivate_lib_so", + "-Wl,-rpath,hdr_only", + ] if semantics.is_bazel else [ + "-lprivate_lib_so", ]) env.expect.where( @@ -106,7 +110,7 @@ def _additional_inputs_test_impl(env, target): for arg in target_action.argv: if arg.find("-Wl,--script=") != -1: env.expect.that_str( - "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/additional_script.txt", + "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/additional_script.txt", ).equals(arg[13:]) found = True break @@ -189,19 +193,19 @@ def _runfiles_test_impl(env, target): if "python" not in file.path ] - # Match e.g. bazel-out/k8-fastbuild/bin/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/libdirect_so_file.so - path_suffix = "/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library" + # Match e.g. bazel-out/k8-fastbuild/bin/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/libdirect_so_file.so + path_suffix = "/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test" env.expect.that_collection(runfiles).contains_exactly_predicates([ matching.str_endswith(path_suffix + "/libfoo_so.so"), matching.str_endswith(path_suffix + "/libbar_so.so"), matching.str_endswith(path_suffix + "/libprivate_lib_so.so"), matching.str_endswith(path_suffix + "3/libdiff_pkg_so.so"), - matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest_Ucc_Ushared_Ulibrary/libbar_so.so"), - matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest_Ucc_Ushared_Ulibrary/libdirect_so_file.so"), - matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest_Ucc_Ushared_Ulibrary/libfoo_so.so"), - matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest_Ucc_Ushared_Ulibrary/libprivate_lib_so.so"), - matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest_Ucc_Ushared_Ulibrary/renamed_so_file_copy.so"), - matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest_Ucc_Ushared_Ulibrary3/libdiff_pkg_so.so"), + matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest/libbar_so.so"), + matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest/libdirect_so_file.so"), + matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest/libfoo_so.so"), + matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest/libprivate_lib_so.so"), + matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest/renamed_so_file_copy.so"), + matching.str_endswith("Smain_Sstarlark_Stests_Sbuiltins_Ubzl_Scc_Scc_Ushared_Ulibrary_Stest3/libdiff_pkg_so.so"), ]) def _runfiles_test_macro(name, target): diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/testenv.sh b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/testenv.sh similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library/testenv.sh rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test/testenv.sh diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2/BUILD.builtin_test b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2/BUILD.builtin_test similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2/BUILD.builtin_test rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2/BUILD.builtin_test diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2/MODULE.bazel b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2/MODULE.bazel similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2/MODULE.bazel rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2/MODULE.bazel diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2/WORKSPACE b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2/WORKSPACE similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2/WORKSPACE rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2/WORKSPACE diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2/bar.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2/bar.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2/bar.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2/bar.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2/bar.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2/bar.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2/bar.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2/bar.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/BUILD.builtin_test b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/BUILD.builtin_test similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/BUILD.builtin_test rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/BUILD.builtin_test diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/bar.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/bar.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/bar.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/bar.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/bar.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/bar.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/bar.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/bar.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/diff_pkg.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/diff_pkg.cc similarity index 94% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/diff_pkg.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/diff_pkg.cc index 70e9e53e73ef83..75fd89fb4c8f4b 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/diff_pkg.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/diff_pkg.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/diff_pkg.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/diff_pkg.h" int diff_pkg() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/diff_pkg.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/diff_pkg.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library3/diff_pkg.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test3/diff_pkg.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/BUILD.builtin_test b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/BUILD.builtin_test similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/BUILD.builtin_test rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/BUILD.builtin_test diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/bar.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/bar.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/bar.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/bar.cc index f4007bcffc2f79..66696c1129ae46 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/bar.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/bar.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/bar.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/bar.h" int bar() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/bar.h b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/bar.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/bar.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/bar.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/main.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/main.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/main.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/main.cc index 6b8f18c4843063..3a4ffe935c482e 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/main.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/main.cc @@ -13,7 +13,7 @@ // limitations under the License. #include -#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library4/bar.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test4/bar.h" int main() { std::cout << "hello " << bar() << std::endl; diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/BUILD.builtin_test b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/BUILD.builtin_test similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/BUILD.builtin_test rename to src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/BUILD.builtin_test diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/bar.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/bar.cc similarity index 92% rename from src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/bar.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/bar.cc index 79e9e0086926b7..379af79657f987 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/bar.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/bar.cc @@ -11,9 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/bar.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/bar.h" -#include "src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/foo.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/foo.h" int bar() { return 2 * foo(); } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/bar.h b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/bar.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/bar.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/bar.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/cc_static_library_integration_test.sh b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/cc_static_library_integration_test.sh similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/cc_static_library_integration_test.sh rename to src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/cc_static_library_integration_test.sh diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/foo.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/foo.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/foo.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/foo.cc index bfefab8399dae4..66ea32b9eb5a15 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/foo.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/foo.cc @@ -11,6 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/foo.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/foo.h" int foo() { return 42; } diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/foo.h b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/foo.h similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/foo.h rename to src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/foo.h diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/lib_only.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/lib_only.cc similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/lib_only.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/lib_only.cc diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/mock_toolchain.bzl b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/mock_toolchain.bzl similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/mock_toolchain.bzl rename to src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/mock_toolchain.bzl diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/starlark_tests.bzl b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/starlark_tests.bzl similarity index 100% rename from src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/starlark_tests.bzl rename to src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/starlark_tests.bzl diff --git a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/test.cc b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/test.cc similarity index 95% rename from src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/test.cc rename to src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/test.cc index 6cbbd17648b307..7bceea4bc1bc15 100644 --- a/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/test.cc +++ b/src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/test.cc @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test_cc_static_library/bar.h" +#include "src/main/starlark/tests/builtins_bzl/cc/cc_static_library/test/bar.h" int main() { if (bar() != 84) { diff --git a/src/main/starlark/tests/builtins_bzl/cc_builtin_tests.sh b/src/main/starlark/tests/builtins_bzl/cc_builtin_tests.sh index c3f4e7a2e069af..960f1934fa5412 100755 --- a/src/main/starlark/tests/builtins_bzl/cc_builtin_tests.sh +++ b/src/main/starlark/tests/builtins_bzl/cc_builtin_tests.sh @@ -66,7 +66,7 @@ function test_starlark_cc() { bazel_dep(name = "test_repo", repo_name = "my_test_repo") local_path_override( module_name = "test_repo", - path = "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test_cc_shared_library2", + path = "src/main/starlark/tests/builtins_bzl/cc/cc_shared_library/test2", ) EOF if "$is_windows"; then