This is an automated email from the ASF dual-hosted git repository.

wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 0541066e Use Hedron's Compile Commands Extractor for Bazel (#2250)
0541066e is described below

commit 0541066ef0a63b66586aa05c9610ccd6464014a4
Author: 372046933 <[email protected]>
AuthorDate: Mon May 22 15:49:35 2023 +0800

    Use Hedron's Compile Commands Extractor for Bazel (#2250)
---
 WORKSPACE         | 17 ++++++++---------
 bazel/BUILD.bazel | 20 ++++++++------------
 test/BUILD.bazel  | 28 +++++++++++-----------------
 3 files changed, 27 insertions(+), 38 deletions(-)

diff --git a/WORKSPACE b/WORKSPACE
index 9ad4ada1..b6fda836 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -283,14 +283,13 @@ perl_register_toolchains()
 #
 # Tools Dependencies
 #
-
+# Hedron's Compile Commands Extractor for Bazel
+# https://github.com/hedronvision/bazel-compile-commands-extractor
 http_archive(
-    name = "com_grail_bazel_compdb",
-    sha256 = 
"d32835b26dd35aad8fd0ba0d712265df6565a3ad860d39e4c01ad41059ea7eda",
-    strip_prefix = "bazel-compilation-database-0.5.2",
-    urls = 
["https://github.com/grailbio/bazel-compilation-database/archive/0.5.2.tar.gz";],
+    name = "hedron_compile_commands",
+    url = 
"https://github.com/hedronvision/bazel-compile-commands-extractor/archive/3dddf205a1f5cde20faf2444c1757abe0564ff4c.tar.gz";,
+    strip_prefix = 
"bazel-compile-commands-extractor-3dddf205a1f5cde20faf2444c1757abe0564ff4c",
+    sha256 = 
"3cd0e49f0f4a6d406c1d74b53b7616f5e24f5fd319eafc1bf8eee6e14124d115",
 )
-
-load("@com_grail_bazel_compdb//:deps.bzl", "bazel_compdb_deps")
-
-bazel_compdb_deps()
+load("@hedron_compile_commands//:workspace_setup.bzl", 
"hedron_compile_commands_setup")
+hedron_compile_commands_setup()
\ No newline at end of file
diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel
index 5100f2ee..c75172c7 100644
--- a/bazel/BUILD.bazel
+++ b/bazel/BUILD.bazel
@@ -13,18 +13,14 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@com_grail_bazel_compdb//:defs.bzl", "compilation_database")
-load("@com_grail_bazel_output_base_util//:defs.bzl", "OUTPUT_BASE")
+load("@hedron_compile_commands//:refresh_compile_commands.bzl", 
"refresh_compile_commands")
 
-compilation_database(
+refresh_compile_commands(
     name = "brpc_compdb",
-    # OUTPUT_BASE is a dynamic value that will vary for each user workspace.
-    # If you would like your build outputs to be the same across users, then
-    # skip supplying this value, and substitute the default constant value
-    # "__OUTPUT_BASE__" through an external tool like `sed` or `jq` (see
-    # below shell commands for usage).
-    output_base = OUTPUT_BASE,
-    targets = [
-        "//:brpc",
-    ],
+    # Specify the targets of interest.
+    # For example, specify a dict of targets and their arguments:
+    targets = {
+        "//:brpc": "",
+    },
+    # For more details, feel free to look into refresh_compile_commands.bzl if 
you want.
 )
diff --git a/test/BUILD.bazel b/test/BUILD.bazel
index a2eea9cf..82dcd882 100644
--- a/test/BUILD.bazel
+++ b/test/BUILD.bazel
@@ -15,8 +15,7 @@
 
 load("@rules_proto//proto:defs.bzl", "proto_library")
 load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library", "cc_test")
-load("@com_grail_bazel_compdb//:defs.bzl", "compilation_database")
-load("@com_grail_bazel_output_base_util//:defs.bzl", "OUTPUT_BASE")
+load("@hedron_compile_commands//:refresh_compile_commands.bzl", 
"refresh_compile_commands")
 
 COPTS = [
     "-D__STDC_FORMAT_MACROS",
@@ -236,20 +235,15 @@ cc_test(
     ],
 )
 
-compilation_database(
+refresh_compile_commands(
     name = "brpc_test_compdb",
-    # Use test profile
-    testonly = True,
-    # OUTPUT_BASE is a dynamic value that will vary for each user workspace.
-    # If you would like your build outputs to be the same across users, then
-    # skip supplying this value, and substitute the default constant value
-    # "__OUTPUT_BASE__" through an external tool like `sed` or `jq` (see
-    # below shell commands for usage).
-    output_base = OUTPUT_BASE,
-    targets = [
-        "//:brpc",
-        ":bvar_test",
-        ":bthread_test",
-        ":butil_test",
-    ],
+    # Specify the targets of interest.
+    # For example, specify a dict of targets and their arguments:
+    targets = {
+        "//:brpc": "",
+        ":bvar_test": "",
+        ":bthread_test": "",
+        ":butil_test": "",
+    },
+    # For more details, feel free to look into refresh_compile_commands.bzl if 
you want.
 )


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to