From c460f83acb87976b6728a715b575304bb422c858 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 16 Feb 2022 13:42:29 -0800 Subject: [PATCH] Include more information about configurations in cquery proto formatted outout 1. Add a repeated Configuration field to CqueryResult, and fill in the checksum, platform, and mnemonic fields. 2. Add a configuration_id field to ConfiguredTarget, and deprecate the existing configuration field in ConfiguredTarget. The configuration_id field is an index that points to the Configuration message stored in CqueryResult, following the same pattern as ActionGraphContainer. This avoids duplicating the same Configuration message for each ConfiguredTarget. RELNOTES: Include more information about configurations in cquery proto formatted output. This deprecates the configuration field of AnalysisProtosV2.ConfiguredTarget, and adds a new field, configuration_id, to be used instead. PiperOrigin-RevId: 429129916 Change-Id: Id048229a6872e6462b67cfe3041cdc907967d7bf --- .../{BUILD => BUILD.oss} | 36 +++++++++---------- .../failing_targets/{BUILD => BUILD.oss} | 0 .../{BUILD => BUILD.oss} | 0 .../{BUILD => BUILD.oss} | 0 4 files changed, 18 insertions(+), 18 deletions(-) rename examples/test_cc_shared_library/{BUILD => BUILD.oss} (70%) rename examples/test_cc_shared_library/failing_targets/{BUILD => BUILD.oss} (100%) rename examples/test_cc_shared_library2/{BUILD => BUILD.oss} (100%) rename examples/test_cc_shared_library3/{BUILD => BUILD.oss} (100%) diff --git a/examples/test_cc_shared_library/BUILD b/examples/test_cc_shared_library/BUILD.oss similarity index 70% rename from examples/test_cc_shared_library/BUILD rename to examples/test_cc_shared_library/BUILD.oss index fe315ed..3d76fb7 100644 --- a/examples/test_cc_shared_library/BUILD +++ b/examples/test_cc_shared_library/BUILD.oss @@ -1,10 +1,10 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("//third_party/bazel_skylib:bzl_library.bzl", "bzl_library") load("//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") -load("//examples:experimental_cc_shared_library.bzl", "LINKABLE_MORE_THAN_ONCE") +load("//third_party/bazel_rules/rules_cc/examples:experimental_cc_shared_library.bzl", "LINKABLE_MORE_THAN_ONCE") load(":starlark_tests.bzl", "additional_inputs_test", "build_failure_test", "linking_suffix_test", "paths_test") package( - default_visibility = ["//examples/test_cc_shared_library:__subpackages__"], + default_visibility = ["//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library:__subpackages__"], ) cc_test( @@ -45,8 +45,8 @@ cc_shared_library( "a_suffix", ], static_deps = [ - "//examples/test_cc_shared_library:qux", - "//examples/test_cc_shared_library:qux2", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library:qux", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library:qux2", ], user_link_flags = [ "-Wl,-rpath,kittens", @@ -108,10 +108,10 @@ cc_shared_library( ], exports_filter = [ "bar3", # Exported transitive dependency - "//examples/test_cc_shared_library3:bar", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library3:bar", ], permissions = [ - "//examples/test_cc_shared_library3:permissions", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library3:permissions", ], roots = [ "bar", @@ -119,9 +119,9 @@ cc_shared_library( "@test_repo//:bar", ], static_deps = [ - "//examples/test_cc_shared_library:barX", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library:barX", "@test_repo//:bar", - "//examples/test_cc_shared_library:qux2", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library:qux2", ], user_link_flags = [ "-Wl,--version-script=$(location :bar.lds)", @@ -159,7 +159,7 @@ cc_library( srcs = ["bar3.cc"], hdrs = ["bar3.h"], deps = [ - "//examples/test_cc_shared_library3:bar", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library3:bar", ], ) @@ -187,8 +187,8 @@ additional_inputs_test( build_failure_test( name = "link_once_repeated_test", message = "already linked statically in " + - "//examples/test_cc_shared_library:foo_so but not exported.", - target_under_test = "//examples/test_cc_shared_library/failing_targets:should_fail_binary", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library:foo_so but not exported.", + target_under_test = "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library/failing_targets:should_fail_binary", ) paths_test( @@ -198,13 +198,13 @@ paths_test( build_failure_test( name = "export_without_permissions_test", message = "doesn't have the necessary permissions", - target_under_test = "//examples/test_cc_shared_library/failing_targets:permissions_fail_so", + target_under_test = "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library/failing_targets:permissions_fail_so", ) build_failure_test( name = "forbidden_target_permissions_test", message = "can only list targets that are in the same package or a sub-package", - target_under_test = "//examples/test_cc_shared_library/failing_targets:permissions_fail", + target_under_test = "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library/failing_targets:permissions_fail", ) bzl_library( @@ -216,11 +216,11 @@ bzl_library( cc_shared_library_permissions( name = "permissions", targets = [ - "//examples/test_cc_shared_library:a_suffix", - "//examples/test_cc_shared_library:qux", - "//examples/test_cc_shared_library:qux2", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library:a_suffix", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library:qux", + "//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library:qux2", ], - visibility = ["//examples/test_cc_shared_library/diamond_inheritance:__pkg__"], + visibility = ["//third_party/bazel_rules/rules_cc/examples/test_cc_shared_library/diamond_inheritance:__pkg__"], ) build_failure_test( diff --git a/examples/test_cc_shared_library/failing_targets/BUILD b/examples/test_cc_shared_library/failing_targets/BUILD.oss similarity index 100% rename from examples/test_cc_shared_library/failing_targets/BUILD rename to examples/test_cc_shared_library/failing_targets/BUILD.oss diff --git a/examples/test_cc_shared_library2/BUILD b/examples/test_cc_shared_library2/BUILD.oss similarity index 100% rename from examples/test_cc_shared_library2/BUILD rename to examples/test_cc_shared_library2/BUILD.oss diff --git a/examples/test_cc_shared_library3/BUILD b/examples/test_cc_shared_library3/BUILD.oss similarity index 100% rename from examples/test_cc_shared_library3/BUILD rename to examples/test_cc_shared_library3/BUILD.oss