From 3e20025423ca4e9604c9bc04673c483f34ac7e27 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:21:42 -0400 Subject: [PATCH 001/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index c52dbbb..1cbaa00 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -129,6 +129,7 @@ def _safe_flags(flags): return [flag for flag in flags if flag not in unsupported_flags] def _clang_tidy_aspect_impl(target, ctx): + print ("hi!") # if not a C/C++ target, we are not interested if not CcInfo in target: return [] From 44e58986d3e53244609ccfdddb66b4e32d5f2025 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:28:22 -0400 Subject: [PATCH 002/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 1cbaa00..ca6f7bb 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -132,7 +132,9 @@ def _clang_tidy_aspect_impl(target, ctx): print ("hi!") # if not a C/C++ target, we are not interested if not CcInfo in target: + print ("skip it") return [] + print ("keep on truckin") # Ignore external targets if target.label.workspace_root.startswith("external"): From 04103d37148f2c4d17fa3e8ec82c1aa01f27cc63 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:30:13 -0400 Subject: [PATCH 003/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index ca6f7bb..3f21243 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -140,16 +140,19 @@ def _clang_tidy_aspect_impl(target, ctx): if target.label.workspace_root.startswith("external"): return [] + print ("a!") # Targets with specific tags will not be formatted ignore_tags = [ "noclangtidy", "no-clang-tidy", ] + print ("b!") for tag in ignore_tags: if tag in ctx.rule.attr.tags: return [] + print ("c!") wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable additional_deps = ctx.attr._clang_tidy_additional_deps @@ -162,6 +165,7 @@ def _clang_tidy_aspect_impl(target, ctx): srcs = _rule_sources(ctx) + print ("d!") outputs = [ _run_tidy( ctx, @@ -177,6 +181,7 @@ def _clang_tidy_aspect_impl(target, ctx): for src in srcs ] + print ("e!") return [ OutputGroupInfo(report = depset(direct = outputs)), ] From 988377f864a39c4a318269838bf94e6571e87041 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:47:31 -0400 Subject: [PATCH 004/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 3f21243..a273365 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -65,7 +65,11 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") - + print ("run") + print (inputs) + print (outfile) + print (wrapper) + print (args) ctx.actions.run( inputs = inputs, outputs = [outfile], From 8d92d24d7a0ca42729f0e168736aa8fb9c51de91 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:48:29 -0400 Subject: [PATCH 005/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index a273365..8acea7b 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -170,6 +170,8 @@ def _clang_tidy_aspect_impl(target, ctx): srcs = _rule_sources(ctx) print ("d!") + print ("srcs:") + print (srcs) outputs = [ _run_tidy( ctx, From f5bb12fed54f8f2a96340d576c70d5ab339f2699 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:50:27 -0400 Subject: [PATCH 006/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 8acea7b..d7528eb 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -94,6 +94,8 @@ def _rule_sources(ctx): return True return False + print ("ctx.rule.attr") + print (str(ctx.rule.attr)) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From 8cd9e4191a90c9c665a1907bb6e6961ca3eb262c Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:20:39 -0400 Subject: [PATCH 007/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index d7528eb..d270417 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -96,6 +96,8 @@ def _rule_sources(ctx): print ("ctx.rule.attr") print (str(ctx.rule.attr)) + print ("ctx.rule.attr.binary_with_debug") + print (str(ctx.rule.attr.binary_with_debug)) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From d5ffa9d0ffb77ee93b72ce00d9be01450131ee37 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:23:34 -0400 Subject: [PATCH 008/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index d270417..334f1b9 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -96,8 +96,10 @@ def _rule_sources(ctx): print ("ctx.rule.attr") print (str(ctx.rule.attr)) - print ("ctx.rule.attr.binary_with_debug") - print (str(ctx.rule.attr.binary_with_debug)) + if hasattr(ctx.rule.attr, "binary_with_debug"): + print ("invoking _rule_sources() recursively") + srcs2 = _rule_sources(ctx.rule.attr.binary_with_debug) + print (f"returned: {src2}) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From 22cdba84ad9f2dc104fa6df0365c456c702bfa7c Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:44:20 -0400 Subject: [PATCH 009/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 334f1b9..ac64caf 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -99,7 +99,7 @@ def _rule_sources(ctx): if hasattr(ctx.rule.attr, "binary_with_debug"): print ("invoking _rule_sources() recursively") srcs2 = _rule_sources(ctx.rule.attr.binary_with_debug) - print (f"returned: {src2}) + print (f"returned: {src2}") srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From 495616099ec0a64101035d6bf73d21b584b40e9b Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:45:11 -0400 Subject: [PATCH 010/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index ac64caf..01915a5 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -99,7 +99,8 @@ def _rule_sources(ctx): if hasattr(ctx.rule.attr, "binary_with_debug"): print ("invoking _rule_sources() recursively") srcs2 = _rule_sources(ctx.rule.attr.binary_with_debug) - print (f"returned: {src2}") + print ("returned") + print (src2) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From ffb2876858e8f8047223232bc4d954bcb5484441 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:45:38 -0400 Subject: [PATCH 011/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 01915a5..de1132f 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -100,7 +100,7 @@ def _rule_sources(ctx): print ("invoking _rule_sources() recursively") srcs2 = _rule_sources(ctx.rule.attr.binary_with_debug) print ("returned") - print (src2) + print (srcs2) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From ba24c64aebf23590d6e837e689cb0bc8581e514f Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:48:36 -0400 Subject: [PATCH 012/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index de1132f..84b6572 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -97,10 +97,8 @@ def _rule_sources(ctx): print ("ctx.rule.attr") print (str(ctx.rule.attr)) if hasattr(ctx.rule.attr, "binary_with_debug"): - print ("invoking _rule_sources() recursively") - srcs2 = _rule_sources(ctx.rule.attr.binary_with_debug) - print ("returned") - print (srcs2) + print ("ctx.rule.attr.binary_with_debug:") + print (ctx.rule.attr.binary_with_debug.rule.attr) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From 3e70b71f2558ca6f021d5ac8b154d17d2fca9c28 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:51:12 -0400 Subject: [PATCH 013/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 84b6572..bfb7928 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -97,8 +97,8 @@ def _rule_sources(ctx): print ("ctx.rule.attr") print (str(ctx.rule.attr)) if hasattr(ctx.rule.attr, "binary_with_debug"): - print ("ctx.rule.attr.binary_with_debug:") - print (ctx.rule.attr.binary_with_debug.rule.attr) + print ("ctx.rule.attr.binary_with_debug.srcs:") + print (ctx.rule.attr.binary_with_debug.srcs) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From 0c127e0006dc1412dc693afa3cd4f438ac3a3667 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:54:46 -0400 Subject: [PATCH 014/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index bfb7928..2bb4193 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -97,8 +97,8 @@ def _rule_sources(ctx): print ("ctx.rule.attr") print (str(ctx.rule.attr)) if hasattr(ctx.rule.attr, "binary_with_debug"): - print ("ctx.rule.attr.binary_with_debug.srcs:") - print (ctx.rule.attr.binary_with_debug.srcs) + print ("dir(ctx.rule.attr.binary_with_debug)") + print (dir(ctx.rule.attr.binary_with_debug)) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From 7a64f210631747bf29048dc0d6d1d1fbe3e38ab7 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:56:33 -0400 Subject: [PATCH 015/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 2bb4193..ec826dd 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -97,8 +97,8 @@ def _rule_sources(ctx): print ("ctx.rule.attr") print (str(ctx.rule.attr)) if hasattr(ctx.rule.attr, "binary_with_debug"): - print ("dir(ctx.rule.attr.binary_with_debug)") - print (dir(ctx.rule.attr.binary_with_debug)) + print ("ctx.rule.attr.binary_with_debug.files") + print (ctx.rule.attr.binary_with_debug.files)) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From c8efd0553d75391269a0e3a8fa234ce826eb860c Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:57:04 -0400 Subject: [PATCH 016/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index ec826dd..2654c84 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -98,7 +98,7 @@ def _rule_sources(ctx): print (str(ctx.rule.attr)) if hasattr(ctx.rule.attr, "binary_with_debug"): print ("ctx.rule.attr.binary_with_debug.files") - print (ctx.rule.attr.binary_with_debug.files)) + print (ctx.rule.attr.binary_with_debug.files) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: From 79d1fd376906ac568fb95bc23ad3521becda4d8b Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 12:01:18 -0400 Subject: [PATCH 017/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 2654c84..f9e6d20 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -138,7 +138,8 @@ def _safe_flags(flags): return [flag for flag in flags if flag not in unsupported_flags] def _clang_tidy_aspect_impl(target, ctx): - print ("hi!") + print ("target") + print (target) # if not a C/C++ target, we are not interested if not CcInfo in target: print ("skip it") From 9247d49b72abe445f823b9d0b3201ec3c5f6c6f3 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 12:07:46 -0400 Subject: [PATCH 018/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index f9e6d20..3259088 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -209,4 +209,5 @@ clang_tidy_aspect = aspect( "_clang_tidy_config": attr.label(default = Label("//:clang_tidy_config")), }, toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], + apply_to_generating_rules = True, ) From c061b7130edc2526712f1efe24f58e9606363787 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:50:09 -0400 Subject: [PATCH 019/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 3259088..0da4905 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -66,9 +66,6 @@ def _run_tidy( args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") print ("run") - print (inputs) - print (outfile) - print (wrapper) print (args) ctx.actions.run( inputs = inputs, @@ -94,11 +91,6 @@ def _rule_sources(ctx): return True return False - print ("ctx.rule.attr") - print (str(ctx.rule.attr)) - if hasattr(ctx.rule.attr, "binary_with_debug"): - print ("ctx.rule.attr.binary_with_debug.files") - print (ctx.rule.attr.binary_with_debug.files) srcs = [] if hasattr(ctx.rule.attr, "srcs"): for src in ctx.rule.attr.srcs: @@ -138,31 +130,24 @@ def _safe_flags(flags): return [flag for flag in flags if flag not in unsupported_flags] def _clang_tidy_aspect_impl(target, ctx): - print ("target") - print (target) # if not a C/C++ target, we are not interested if not CcInfo in target: - print ("skip it") return [] - print ("keep on truckin") # Ignore external targets if target.label.workspace_root.startswith("external"): return [] - print ("a!") # Targets with specific tags will not be formatted ignore_tags = [ "noclangtidy", "no-clang-tidy", ] - print ("b!") for tag in ignore_tags: if tag in ctx.rule.attr.tags: return [] - print ("c!") wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable additional_deps = ctx.attr._clang_tidy_additional_deps @@ -175,9 +160,6 @@ def _clang_tidy_aspect_impl(target, ctx): srcs = _rule_sources(ctx) - print ("d!") - print ("srcs:") - print (srcs) outputs = [ _run_tidy( ctx, @@ -193,7 +175,6 @@ def _clang_tidy_aspect_impl(target, ctx): for src in srcs ] - print ("e!") return [ OutputGroupInfo(report = depset(direct = outputs)), ] From 10b0a982570a48b835382f30fd1655cf97d20d91 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:55:46 -0400 Subject: [PATCH 020/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 0da4905..84fc525 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -65,8 +65,8 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") - print ("run") - print (args) + #print ("run") + #print (args) ctx.actions.run( inputs = inputs, outputs = [outfile], From e40abcb705a8604fe0861ba6ab0a652cdbaeda72 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:04:19 -0400 Subject: [PATCH 021/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 3 --- 1 file changed, 3 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 84fc525..59d2f34 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -65,8 +65,6 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") - #print ("run") - #print (args) ctx.actions.run( inputs = inputs, outputs = [outfile], @@ -190,5 +188,4 @@ clang_tidy_aspect = aspect( "_clang_tidy_config": attr.label(default = Label("//:clang_tidy_config")), }, toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], - apply_to_generating_rules = True, ) From 940cff078c4f917619a9e68b549abc4769669ad1 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:08:25 -0400 Subject: [PATCH 022/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 59d2f34..9c2dd30 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -65,6 +65,8 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") + print("args") + print(args) ctx.actions.run( inputs = inputs, outputs = [outfile], From b883c08c1562d7a94b11bd96fb0146348998299c Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:39:56 -0400 Subject: [PATCH 023/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 9c2dd30..46ac614 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -65,6 +65,7 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") + fail(args) print("args") print(args) ctx.actions.run( From 4c5f0ad2e4cb231e990a8883df4f34471a93d24d Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:42:58 -0400 Subject: [PATCH 024/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 46ac614..2db83e4 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -160,7 +160,7 @@ def _clang_tidy_aspect_impl(target, ctx): cxx_flags = _safe_flags(_toolchain_flags(ctx, ACTION_NAMES.cpp_compile) + rule_flags) + ["-xc++"] srcs = _rule_sources(ctx) - + fail(srcs) outputs = [ _run_tidy( ctx, From f968c6a8f165ea7ea0109c4d5a6fb94bb3932589 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:45:15 -0400 Subject: [PATCH 025/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 2db83e4..908dba8 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -160,7 +160,6 @@ def _clang_tidy_aspect_impl(target, ctx): cxx_flags = _safe_flags(_toolchain_flags(ctx, ACTION_NAMES.cpp_compile) + rule_flags) + ["-xc++"] srcs = _rule_sources(ctx) - fail(srcs) outputs = [ _run_tidy( ctx, From c378044df38f80cc9d229f7f3db950e3922a6cc9 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:48:34 -0400 Subject: [PATCH 026/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 908dba8..ecc722d 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -35,7 +35,7 @@ def _run_tidy( args.add(outfile.path) # this is consumed by the wrapper script - args.add(config.path) + args.add("--config-file=" + config.path) args.add("--export-fixes", outfile.path) @@ -65,7 +65,7 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") - fail(args) + #fail(args) print("args") print(args) ctx.actions.run( From 798f7da57f441d96e7410708bdad5ccea6998697 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:59:47 -0400 Subject: [PATCH 027/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index ecc722d..c070826 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -36,6 +36,7 @@ def _run_tidy( args.add(outfile.path) # this is consumed by the wrapper script args.add("--config-file=" + config.path) + args.add("--dump-config") args.add("--export-fixes", outfile.path) @@ -65,9 +66,6 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") - #fail(args) - print("args") - print(args) ctx.actions.run( inputs = inputs, outputs = [outfile], From af4a18f5e329b9adeadd0725550993b1cd22602e Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:20:41 -0400 Subject: [PATCH 028/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index c070826..4bc39ad 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -36,7 +36,6 @@ def _run_tidy( args.add(outfile.path) # this is consumed by the wrapper script args.add("--config-file=" + config.path) - args.add("--dump-config") args.add("--export-fixes", outfile.path) From 98c239608a6aec5397d63257c6a29259a0a899da Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:32:57 -0400 Subject: [PATCH 029/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 5cddb59..cf87bb0 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -37,4 +37,7 @@ set -- \ --warnings-as-errors=-clang-diagnostic-builtin-macro-redefined \ "$@" +echo clang command +echo "${CLANG_TIDY_BIN}" "$@" + "${CLANG_TIDY_BIN}" "$@" >"$logfile" 2>&1 From 09b17e54569587981c4893947cd086f2231f345f Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:33:10 -0400 Subject: [PATCH 030/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 4bc39ad..7d22560 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -35,7 +35,7 @@ def _run_tidy( args.add(outfile.path) # this is consumed by the wrapper script - args.add("--config-file=" + config.path) + args.add(config.path) args.add("--export-fixes", outfile.path) From aeef65ca2706a7f59b27c38c45ac81d9bddd9626 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 20:31:23 -0400 Subject: [PATCH 031/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index cf87bb0..cc03389 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -40,4 +40,4 @@ set -- \ echo clang command echo "${CLANG_TIDY_BIN}" "$@" -"${CLANG_TIDY_BIN}" "$@" >"$logfile" 2>&1 +"${CLANG_TIDY_BIN}" "$@" --dump-config >"$logfile" 2>&1 From 92367c390777cf4c6915c01e15229c326d127272 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 20:40:20 -0400 Subject: [PATCH 032/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index cc03389..c439bad 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -40,4 +40,4 @@ set -- \ echo clang command echo "${CLANG_TIDY_BIN}" "$@" -"${CLANG_TIDY_BIN}" "$@" --dump-config >"$logfile" 2>&1 +"${CLANG_TIDY_BIN}" --config=.clang-tidy "$@" >"$logfile" 2>&1 From 440f50056823b0f57d7eb988f12f4da57cf7cc87 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 20:45:07 -0400 Subject: [PATCH 033/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index c439bad..9b43021 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -40,4 +40,4 @@ set -- \ echo clang command echo "${CLANG_TIDY_BIN}" "$@" -"${CLANG_TIDY_BIN}" --config=.clang-tidy "$@" >"$logfile" 2>&1 +"${CLANG_TIDY_BIN}" --config=$(eval - cat ./.clang-tidy) "$@" >"$logfile" 2>&1 From 2bac433d4e6118f2c6ec076e2abc08fee0a24fed Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 20:48:33 -0400 Subject: [PATCH 034/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 9b43021..cc16b85 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -40,4 +40,4 @@ set -- \ echo clang command echo "${CLANG_TIDY_BIN}" "$@" -"${CLANG_TIDY_BIN}" --config=$(eval - cat ./.clang-tidy) "$@" >"$logfile" 2>&1 +"${CLANG_TIDY_BIN}" --config=$(eval cat ./.clang-tidy) "$@" >"$logfile" 2>&1 From 896d2bd55e110bd1f7ac6ff0b89cd03b4b4c5cde Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 20:57:47 -0400 Subject: [PATCH 035/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index cc16b85..70e45ff 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -37,7 +37,7 @@ set -- \ --warnings-as-errors=-clang-diagnostic-builtin-macro-redefined \ "$@" -echo clang command -echo "${CLANG_TIDY_BIN}" "$@" - +# MDB's variant of clang (for llvm) uses --config different +# Per this recommendation (https://github.com/ch1bo/flycheck-clang-tidy/issues/12) we're "eval"-ing .clang-tidy +# to ensure it's properly parsed: "${CLANG_TIDY_BIN}" --config=$(eval cat ./.clang-tidy) "$@" >"$logfile" 2>&1 From 9d37d0afe6536e8af31c945906ab7c00415bfc3a Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:06:07 -0400 Subject: [PATCH 036/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 7d22560..15a6bae 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -19,6 +19,7 @@ def _run_tidy( ), transitive = [compilation_context.headers], ) + fail(inputs) args = ctx.actions.args() From 82e4ab950d437344ab58a4070317c65567ad5ec8 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:09:26 -0400 Subject: [PATCH 037/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 15a6bae..bdce2e1 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,10 +11,14 @@ def _run_tidy( compilation_context, infile, discriminator): + additional_deps_wo_3p = [ + f + for f in additional_deps.files.to_list() + if 'src/third_party' not in f] inputs = depset( direct = ( [infile, config] + - additional_deps.files.to_list() + + additional_deps_wo_3p + ([exe.files_to_run.executable] if exe.files_to_run.executable else []) ), transitive = [compilation_context.headers], From 0b989d60307d27603bdacd32cc09e5eb999a0690 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:12:25 -0400 Subject: [PATCH 038/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index bdce2e1..4812667 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -14,7 +14,7 @@ def _run_tidy( additional_deps_wo_3p = [ f for f in additional_deps.files.to_list() - if 'src/third_party' not in f] + if 'src/third_party' not in f.realpath] inputs = depset( direct = ( [infile, config] + From 4a34aa9b86926ba7a0b2a2cc3e6679dc2afe4f75 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:13:26 -0400 Subject: [PATCH 039/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 4812667..3cb17dc 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,6 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): + fail(dir(additional_deps.files.to_list())) additional_deps_wo_3p = [ f for f in additional_deps.files.to_list() From ba74834c25d57f59e6f598c92dfc161897b1d6c6 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:14:00 -0400 Subject: [PATCH 040/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 3cb17dc..7ebe23d 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,7 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): - fail(dir(additional_deps.files.to_list())) + fail(dir(additional_deps.files.to_list()[0])) additional_deps_wo_3p = [ f for f in additional_deps.files.to_list() From 0971fe16261875d1de69c9e03a528eec8d45032c Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:15:04 -0400 Subject: [PATCH 041/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 7ebe23d..ccf4b51 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,11 +11,11 @@ def _run_tidy( compilation_context, infile, discriminator): - fail(dir(additional_deps.files.to_list()[0])) + # fail(dir(additional_deps.files.to_list()[0])) additional_deps_wo_3p = [ f for f in additional_deps.files.to_list() - if 'src/third_party' not in f.realpath] + if 'src/third_party' not in f.dirname] inputs = depset( direct = ( [infile, config] + From 377328e19b1b4fe4726353a3373a4e727379c7e7 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:16:11 -0400 Subject: [PATCH 042/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index ccf4b51..a7dc67f 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -24,7 +24,7 @@ def _run_tidy( ), transitive = [compilation_context.headers], ) - fail(inputs) + #fail(inputs) args = ctx.actions.args() From de977d006a3a10f756345cf96b7a27d96fdf3b05 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:21:45 -0400 Subject: [PATCH 043/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index a7dc67f..9adda3b 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,20 +11,20 @@ def _run_tidy( compilation_context, infile, discriminator): - # fail(dir(additional_deps.files.to_list()[0])) - additional_deps_wo_3p = [ - f - for f in additional_deps.files.to_list() - if 'src/third_party' not in f.dirname] inputs = depset( direct = ( [infile, config] + - additional_deps_wo_3p + + additional_deps.files.to_list() + ([exe.files_to_run.executable] if exe.files_to_run.executable else []) ), transitive = [compilation_context.headers], ) - #fail(inputs) + inputs2 = depset([ + dep + for dep in inputs.to_list() + if 'src/third_party' not in dep]) + + fail(inputs2) args = ctx.actions.args() From aa3abdcfaf62e023985b6cf88a25056bcec7eda6 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:22:36 -0400 Subject: [PATCH 044/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 9adda3b..4fd619b 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -22,7 +22,7 @@ def _run_tidy( inputs2 = depset([ dep for dep in inputs.to_list() - if 'src/third_party' not in dep]) + if 'src/third_party' not in dep.path]) fail(inputs2) From 1daaffb71bf13db562a3a07d0e34c52cc914093c Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:23:51 -0400 Subject: [PATCH 045/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 4fd619b..f2dc86c 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,7 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): - inputs = depset( + inputs0 = depset( direct = ( [infile, config] + additional_deps.files.to_list() + @@ -19,12 +19,12 @@ def _run_tidy( ), transitive = [compilation_context.headers], ) - inputs2 = depset([ + inputs = depset([ dep - for dep in inputs.to_list() + for dep in inputs0.to_list() if 'src/third_party' not in dep.path]) - fail(inputs2) + #fail(inputs2) args = ctx.actions.args() From a16d5d3251893d0e599dc9cb9a887d5adbe5d0cc Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:32:32 -0400 Subject: [PATCH 046/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index f2dc86c..c148257 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -71,6 +71,7 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") + fail(args) ctx.actions.run( inputs = inputs, outputs = [outfile], From 1dbf7655635ce4d7064313e146f4941faa8a6f69 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:35:27 -0400 Subject: [PATCH 047/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index c148257..760755e 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -24,7 +24,7 @@ def _run_tidy( for dep in inputs0.to_list() if 'src/third_party' not in dep.path]) - #fail(inputs2) + fail(inputs2) args = ctx.actions.args() From b7f429eccaf760d6e3ce5df8c3ce41575a41b66d Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:35:49 -0400 Subject: [PATCH 048/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 760755e..bea22d2 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -24,7 +24,7 @@ def _run_tidy( for dep in inputs0.to_list() if 'src/third_party' not in dep.path]) - fail(inputs2) + fail(inputs) args = ctx.actions.args() From 4eb3559d8ea7e088bb75a3fa6e422663542980d1 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:37:39 -0400 Subject: [PATCH 049/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index bea22d2..d8fc7dd 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -22,7 +22,7 @@ def _run_tidy( inputs = depset([ dep for dep in inputs0.to_list() - if 'src/third_party' not in dep.path]) + if 'src/third_party/' not in dep.path and 'stow/' not in dep.path]) fail(inputs) From 878769e5295ada24bea3dfdcb419b2e2e16f165d Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:38:52 -0400 Subject: [PATCH 050/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index d8fc7dd..8b3356b 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -22,7 +22,7 @@ def _run_tidy( inputs = depset([ dep for dep in inputs0.to_list() - if 'src/third_party/' not in dep.path and 'stow/' not in dep.path]) + if ('.h' in dep.path or '.cpp' in dep.path) and 'src/third_party/' not in dep.path and 'stow/' not in dep.path]) fail(inputs) From 9468934986e231cf917b32f06083a05950200a17 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:40:14 -0400 Subject: [PATCH 051/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 8b3356b..41b2ad4 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -22,7 +22,7 @@ def _run_tidy( inputs = depset([ dep for dep in inputs0.to_list() - if ('.h' in dep.path or '.cpp' in dep.path) and 'src/third_party/' not in dep.path and 'stow/' not in dep.path]) + if 'src/mongo/' in dep.path]) fail(inputs) From 320578bab19d610bc9a43056aa5581613188a216 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:41:01 -0400 Subject: [PATCH 052/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 41b2ad4..d0dc2b5 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -24,7 +24,7 @@ def _run_tidy( for dep in inputs0.to_list() if 'src/mongo/' in dep.path]) - fail(inputs) + #fail(inputs) args = ctx.actions.args() From 4815e4726c8c8b200e09a74819a70fba50320b8b Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:42:05 -0400 Subject: [PATCH 053/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index d0dc2b5..b5001f3 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -71,7 +71,7 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") - fail(args) + #fail(args) ctx.actions.run( inputs = inputs, outputs = [outfile], From 6ce5aa136e91b5ca17a1ee92d95fc0fd6d282c6a Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:46:22 -0400 Subject: [PATCH 054/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 70e45ff..d0214df 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -37,6 +37,11 @@ set -- \ --warnings-as-errors=-clang-diagnostic-builtin-macro-redefined \ "$@" +echo clang_tidy_command +echo "${CLANG_TIDY_BIN}" --config=$(eval cat ./.clang-tidy) "$@" +exit 1 + + # MDB's variant of clang (for llvm) uses --config different # Per this recommendation (https://github.com/ch1bo/flycheck-clang-tidy/issues/12) we're "eval"-ing .clang-tidy # to ensure it's properly parsed: From b70b368cb9fd3dd830b7eea9802c241306d3fb7f Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:52:29 -0400 Subject: [PATCH 055/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index d0214df..00fb4ec 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -19,7 +19,8 @@ truncate -s 0 $OUTPUT # if $CONFIG is provided by some external workspace, we need to # place it in the current directory -test -e .clang-tidy || ln -s -f $CONFIG .clang-tidy +# Use "$(pwd)" per this guidance: https://www.baeldung.com/linux/too-many-levels-of-symlinks +test -e .clang-tidy || ln -s -f "$(pwd)/$CONFIG" .clang-tidy # Print output on failure only logfile="$(mktemp)" From 8e9755f88c52576f7d708182594db71544296dbd Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:58:52 -0400 Subject: [PATCH 056/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 00fb4ec..6915727 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -20,7 +20,8 @@ truncate -s 0 $OUTPUT # if $CONFIG is provided by some external workspace, we need to # place it in the current directory # Use "$(pwd)" per this guidance: https://www.baeldung.com/linux/too-many-levels-of-symlinks -test -e .clang-tidy || ln -s -f "$(pwd)/$CONFIG" .clang-tidy +#test -e .clang-tidy || ln -s -f "$(pwd)/$CONFIG" .clang-tidy +test -e .clang-tidy || cp -L $CONFIG .clang-tidy # Print output on failure only logfile="$(mktemp)" From c852d3668f815a49eea852ef1cc690033c0f7740 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:30:54 -0400 Subject: [PATCH 057/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 6915727..6315a15 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -40,7 +40,7 @@ set -- \ "$@" echo clang_tidy_command -echo "${CLANG_TIDY_BIN}" --config=$(eval cat ./.clang-tidy) "$@" +echo "${CLANG_TIDY_BIN}" --config=$(eval cat .clang-tidy) "$@" exit 1 From 1e401da6b5554ef6098bc1f7292dd011579db050 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:37:22 -0400 Subject: [PATCH 058/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index b5001f3..4af1df7 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -103,7 +103,7 @@ def _rule_sources(ctx): if hasattr(ctx.rule.attr, "hdrs"): for hdr in ctx.rule.attr.hdrs: srcs += [hdr for hdr in hdr.files.to_list() if hdr.is_source and check_valid_file_type(hdr)] - return srcs + return [src for src in srcs if 'src/mongo/' in src] def _toolchain_flags(ctx, action_name = ACTION_NAMES.cpp_compile): cc_toolchain = find_cpp_toolchain(ctx) From 326ddaceb51dacf9c940979883729f0cedc165ae Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:37:43 -0400 Subject: [PATCH 059/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 6315a15..a952094 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -20,8 +20,8 @@ truncate -s 0 $OUTPUT # if $CONFIG is provided by some external workspace, we need to # place it in the current directory # Use "$(pwd)" per this guidance: https://www.baeldung.com/linux/too-many-levels-of-symlinks -#test -e .clang-tidy || ln -s -f "$(pwd)/$CONFIG" .clang-tidy -test -e .clang-tidy || cp -L $CONFIG .clang-tidy +test -e .clang-tidy || ln -s -f "$(pwd)/$CONFIG" .clang-tidy +#test -e .clang-tidy || cp -L $CONFIG .clang-tidy # Print output on failure only logfile="$(mktemp)" From 93087b9bb23022fdc7883abfdebaf18aeb73bef8 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:39:10 -0400 Subject: [PATCH 060/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 4af1df7..4ee4ecd 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -103,7 +103,7 @@ def _rule_sources(ctx): if hasattr(ctx.rule.attr, "hdrs"): for hdr in ctx.rule.attr.hdrs: srcs += [hdr for hdr in hdr.files.to_list() if hdr.is_source and check_valid_file_type(hdr)] - return [src for src in srcs if 'src/mongo/' in src] + return [src for src in srcs if 'src/mongo/' in src.path] def _toolchain_flags(ctx, action_name = ACTION_NAMES.cpp_compile): cc_toolchain = find_cpp_toolchain(ctx) From 404c8a7522c2abc066a17dacbd1828e8b95a50c0 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:40:08 -0400 Subject: [PATCH 061/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index a952094..858798c 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -20,7 +20,7 @@ truncate -s 0 $OUTPUT # if $CONFIG is provided by some external workspace, we need to # place it in the current directory # Use "$(pwd)" per this guidance: https://www.baeldung.com/linux/too-many-levels-of-symlinks -test -e .clang-tidy || ln -s -f "$(pwd)/$CONFIG" .clang-tidy +test -e .clang-tidy || ln -s -f $CONFIG .clang-tidy #test -e .clang-tidy || cp -L $CONFIG .clang-tidy # Print output on failure only From 2eba34c5569c9d027d9aaf49fcb2ad8a24f802c2 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:43:19 -0400 Subject: [PATCH 062/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 858798c..57614fc 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -20,7 +20,7 @@ truncate -s 0 $OUTPUT # if $CONFIG is provided by some external workspace, we need to # place it in the current directory # Use "$(pwd)" per this guidance: https://www.baeldung.com/linux/too-many-levels-of-symlinks -test -e .clang-tidy || ln -s -f $CONFIG .clang-tidy +test -e .clang-tidy || ln -s -f ../$CONFIG .clang-tidy #test -e .clang-tidy || cp -L $CONFIG .clang-tidy # Print output on failure only From 6edbc19453ef71635f435361daea1726abd1d8ad Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:44:37 -0400 Subject: [PATCH 063/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 57614fc..4961fe4 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -17,6 +17,10 @@ shift touch $OUTPUT truncate -s 0 $OUTPUT +echo config is $CONFIG +cat $CONFIG +cat done catting + # if $CONFIG is provided by some external workspace, we need to # place it in the current directory # Use "$(pwd)" per this guidance: https://www.baeldung.com/linux/too-many-levels-of-symlinks From 96349ccae7ee8dfb5c4d716215db9bb578c73f2f Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:47:31 -0400 Subject: [PATCH 064/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 4ee4ecd..136301b 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -157,6 +157,8 @@ def _clang_tidy_aspect_impl(target, ctx): exe = ctx.attr._clang_tidy_executable additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] + print ("config is") + fail(config) compilation_context = target[CcInfo].compilation_context rule_flags = ctx.rule.attr.copts if hasattr(ctx.rule.attr, "copts") else [] From 4ee2f4d96d3bd35572bc788804fa6e7c7c115630 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:48:59 -0400 Subject: [PATCH 065/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 4961fe4..70b7722 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -21,6 +21,9 @@ echo config is $CONFIG cat $CONFIG cat done catting +echo find +find -L . -type f + # if $CONFIG is provided by some external workspace, we need to # place it in the current directory # Use "$(pwd)" per this guidance: https://www.baeldung.com/linux/too-many-levels-of-symlinks From 172b12158d44ea0eea0e7054f32595c7788ec0a7 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:49:20 -0400 Subject: [PATCH 066/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 136301b..6189921 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -24,8 +24,6 @@ def _run_tidy( for dep in inputs0.to_list() if 'src/mongo/' in dep.path]) - #fail(inputs) - args = ctx.actions.args() # specify the output file - twice @@ -71,7 +69,6 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") - #fail(args) ctx.actions.run( inputs = inputs, outputs = [outfile], @@ -157,8 +154,6 @@ def _clang_tidy_aspect_impl(target, ctx): exe = ctx.attr._clang_tidy_executable additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] - print ("config is") - fail(config) compilation_context = target[CcInfo].compilation_context rule_flags = ctx.rule.attr.copts if hasattr(ctx.rule.attr, "copts") else [] From d43852e62e4e3a87334415157b8958ca1d3b8ec0 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:50:03 -0400 Subject: [PATCH 067/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 70b7722..9913e41 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -17,13 +17,13 @@ shift touch $OUTPUT truncate -s 0 $OUTPUT +echo find +find -L . -type f + echo config is $CONFIG cat $CONFIG cat done catting -echo find -find -L . -type f - # if $CONFIG is provided by some external workspace, we need to # place it in the current directory # Use "$(pwd)" per this guidance: https://www.baeldung.com/linux/too-many-levels-of-symlinks From 315aa9996ac604152d2f046f9c0e88360fe517de Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:52:40 -0400 Subject: [PATCH 068/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 9913e41..3773064 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -17,6 +17,9 @@ shift touch $OUTPUT truncate -s 0 $OUTPUT +echo env +env + echo find find -L . -type f From a1e6865e322298c1d4404e1fe0781c92d80dbc96 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:57:30 -0400 Subject: [PATCH 069/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 6189921..c9951d9 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,6 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): + fail(wrapper) inputs0 = depset( direct = ( [infile, config] + From 3ef775664b6e9a6fe63d5da0c48fb13a97e24a2a Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:59:38 -0400 Subject: [PATCH 070/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index c9951d9..6b7a016 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,7 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): - fail(wrapper) + fail(exe.files_to_run.executable) inputs0 = depset( direct = ( [infile, config] + From 8f38544adbfd1e1f83097e4e2d4a2ad13e810ed3 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:02:47 -0400 Subject: [PATCH 071/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 6b7a016..91973b2 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,7 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): - fail(exe.files_to_run.executable) + fail("$0.runfiles/") inputs0 = depset( direct = ( [infile, config] + From f00745fae1d8ced3845c76a395d22dc85da07f0c Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:04:35 -0400 Subject: [PATCH 072/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 91973b2..0e94110 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,7 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): - fail("$0.runfiles/") + fail(ctx.files._data[0]) inputs0 = depset( direct = ( [infile, config] + From 63b6d97b49b32d064881622eee0b4a1a00c372c4 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:05:29 -0400 Subject: [PATCH 073/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 0e94110..999c122 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,7 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): - fail(ctx.files._data[0]) + fail(ctx.files.to_list()) inputs0 = depset( direct = ( [infile, config] + From 5f6896275f8654252321cf775246edeca0daf3d0 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:06:34 -0400 Subject: [PATCH 074/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 999c122..59a19d0 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,7 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): - fail(ctx.files.to_list()) + fail(ctx.files) inputs0 = depset( direct = ( [infile, config] + From d241fc5f7a2255ac05e40923017802683931ea68 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:08:02 -0400 Subject: [PATCH 075/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 59a19d0..1dec283 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -153,6 +153,7 @@ def _clang_tidy_aspect_impl(target, ctx): wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable + fail(exe) additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] compilation_context = target[CcInfo].compilation_context From 344fb2df12e3baa3a00ebc61e6fe486701fb6471 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:10:19 -0400 Subject: [PATCH 076/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 1dec283..fc3b8d6 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -153,7 +153,7 @@ def _clang_tidy_aspect_impl(target, ctx): wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable - fail(exe) + fail(ctx.runfiles(files = [exe]) additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] compilation_context = target[CcInfo].compilation_context From 0047af5ffa275720e1c4f56ab0b4ef2c0d73974b Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:10:51 -0400 Subject: [PATCH 077/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index fc3b8d6..0c9a66a 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -153,7 +153,7 @@ def _clang_tidy_aspect_impl(target, ctx): wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable - fail(ctx.runfiles(files = [exe]) + fail(ctx.runfiles(files = [exe])) additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] compilation_context = target[CcInfo].compilation_context From 8f25d86cc1392b01d0ad3fc67a87495b6a052c86 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:12:35 -0400 Subject: [PATCH 078/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 0c9a66a..1a61a34 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -153,7 +153,7 @@ def _clang_tidy_aspect_impl(target, ctx): wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable - fail(ctx.runfiles(files = [exe])) + fail(ctx.runfiles(files = [exe.files_to_run.executable])) additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] compilation_context = target[CcInfo].compilation_context From b16d3d0313d000b88da5283f5e342a1cf43914c8 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:13:54 -0400 Subject: [PATCH 079/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 1a61a34..6704c29 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -153,7 +153,7 @@ def _clang_tidy_aspect_impl(target, ctx): wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable - fail(ctx.runfiles(files = [exe.files_to_run.executable])) + fail(ctx.runfiles(files = [exe.files_to_run.executable]).files) additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] compilation_context = target[CcInfo].compilation_context From a28053a864a5c6c8d5926c58c8fde51edac8dc99 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:15:19 -0400 Subject: [PATCH 080/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 6704c29..0e31618 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,7 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): - fail(ctx.files) + #fail(ctx.files) inputs0 = depset( direct = ( [infile, config] + @@ -153,7 +153,7 @@ def _clang_tidy_aspect_impl(target, ctx): wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable - fail(ctx.runfiles(files = [exe.files_to_run.executable]).files) + #fail(ctx.runfiles(files = [exe.files_to_run.executable]).files) additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] compilation_context = target[CcInfo].compilation_context From 440531d9073c0773ae88e4599506836e6f710cc6 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:15:36 -0400 Subject: [PATCH 081/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 3773064..c3ad0ff 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -17,6 +17,9 @@ shift touch $OUTPUT truncate -s 0 $OUTPUT +echo CLANG_TIDY_BIN +echo $CLANG_TIDY_BIN + echo env env From 49b29da4ee3f51f3013cfdfaa33f1021e134fd6c Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:17:19 -0400 Subject: [PATCH 082/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index c3ad0ff..93d7059 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -23,6 +23,9 @@ echo $CLANG_TIDY_BIN echo env env +echo PATH +echo $PATH + echo find find -L . -type f From c0f886f2a6853bdb8610cee894a79809e1c2cecb Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:19:02 -0400 Subject: [PATCH 083/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 93d7059..0d22045 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -20,6 +20,9 @@ truncate -s 0 $OUTPUT echo CLANG_TIDY_BIN echo $CLANG_TIDY_BIN +echo which $CLANG_TIDY_BIN +which $CLANG_TIDY_BIN + echo env env From 26124026b1d25a0dfb9e51fae4c2b430ae70b40d Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:22:20 -0400 Subject: [PATCH 084/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 0d22045..65522b0 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -21,7 +21,7 @@ echo CLANG_TIDY_BIN echo $CLANG_TIDY_BIN echo which $CLANG_TIDY_BIN -which $CLANG_TIDY_BIN +which $CLANG_TIDY_BIN || true 2>&1 echo env env From 09dd7d89d4d89df9f18ad59a7f9074abef7dcbd3 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:26:39 -0400 Subject: [PATCH 085/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 65522b0..dc4f722 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -5,6 +5,9 @@ set -ue CLANG_TIDY_BIN=$1 shift +echo "${CLANG_TIDY_BIN}" -h +"${CLANG_TIDY_BIN}" -h + OUTPUT=$1 shift From feeea489453e174f49efbbafcd4d84f6cf027285 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:31:47 -0400 Subject: [PATCH 086/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index dc4f722..1f95729 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -5,9 +5,6 @@ set -ue CLANG_TIDY_BIN=$1 shift -echo "${CLANG_TIDY_BIN}" -h -"${CLANG_TIDY_BIN}" -h - OUTPUT=$1 shift @@ -20,12 +17,6 @@ shift touch $OUTPUT truncate -s 0 $OUTPUT -echo CLANG_TIDY_BIN -echo $CLANG_TIDY_BIN - -echo which $CLANG_TIDY_BIN -which $CLANG_TIDY_BIN || true 2>&1 - echo env env @@ -35,6 +26,9 @@ echo $PATH echo find find -L . -type f +echo CLANG_TIDY_BIN +echo $CLANG_TIDY_BIN + echo config is $CONFIG cat $CONFIG cat done catting From 74ee9f2a9c18839ddbc07fa02fa360112beee9e5 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:40:36 -0400 Subject: [PATCH 087/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 0e31618..c10af4a 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -150,7 +150,7 @@ def _clang_tidy_aspect_impl(target, ctx): for tag in ignore_tags: if tag in ctx.rule.attr.tags: return [] - + fail(ctx.outputs.executable.path) wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable #fail(ctx.runfiles(files = [exe.files_to_run.executable]).files) From fba0f01ed311443e6c763e445d3f37239ed6f9c0 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:47:12 -0400 Subject: [PATCH 088/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index c10af4a..a563aba 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -150,7 +150,6 @@ def _clang_tidy_aspect_impl(target, ctx): for tag in ignore_tags: if tag in ctx.rule.attr.tags: return [] - fail(ctx.outputs.executable.path) wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable #fail(ctx.runfiles(files = [exe.files_to_run.executable]).files) From a32c962abb7fb896c4981b88d4e4667fc37e2cf9 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:54:02 -0400 Subject: [PATCH 089/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 1f95729..fffba22 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -29,6 +29,10 @@ find -L . -type f echo CLANG_TIDY_BIN echo $CLANG_TIDY_BIN +REAL_CLANG_TIDY_BIN=$(find . -type f | grep "${CLANG_TIDY_BIN}$") +echo REAL_CLANG_TIDY_BIN +echo $REAL_CLANG_TIDY_BIN + echo config is $CONFIG cat $CONFIG cat done catting From b623bc4c1753ef37e5f64220780fe269041a21df Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:57:48 -0400 Subject: [PATCH 090/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index fffba22..75fccf8 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -17,31 +17,12 @@ shift touch $OUTPUT truncate -s 0 $OUTPUT -echo env -env - -echo PATH -echo $PATH - -echo find -find -L . -type f - -echo CLANG_TIDY_BIN -echo $CLANG_TIDY_BIN - -REAL_CLANG_TIDY_BIN=$(find . -type f | grep "${CLANG_TIDY_BIN}$") -echo REAL_CLANG_TIDY_BIN -echo $REAL_CLANG_TIDY_BIN - -echo config is $CONFIG -cat $CONFIG -cat done catting +echo find . -type f +find . -type f # if $CONFIG is provided by some external workspace, we need to # place it in the current directory -# Use "$(pwd)" per this guidance: https://www.baeldung.com/linux/too-many-levels-of-symlinks -test -e .clang-tidy || ln -s -f ../$CONFIG .clang-tidy -#test -e .clang-tidy || cp -L $CONFIG .clang-tidy +test -e .clang-tidy || ln -s -f $CONFIG .clang-tidy # Print output on failure only logfile="$(mktemp)" @@ -59,12 +40,4 @@ set -- \ --warnings-as-errors=-clang-diagnostic-builtin-macro-redefined \ "$@" -echo clang_tidy_command -echo "${CLANG_TIDY_BIN}" --config=$(eval cat .clang-tidy) "$@" -exit 1 - - -# MDB's variant of clang (for llvm) uses --config different -# Per this recommendation (https://github.com/ch1bo/flycheck-clang-tidy/issues/12) we're "eval"-ing .clang-tidy -# to ensure it's properly parsed: -"${CLANG_TIDY_BIN}" --config=$(eval cat ./.clang-tidy) "$@" >"$logfile" 2>&1 +"${CLANG_TIDY_BIN}" "$@" >"$logfile" 2>&1 From 261765edeb216217d5abeca0a1813e7254f3497b Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:58:02 -0400 Subject: [PATCH 091/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index a563aba..c52dbbb 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,8 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): - #fail(ctx.files) - inputs0 = depset( + inputs = depset( direct = ( [infile, config] + additional_deps.files.to_list() + @@ -20,11 +19,7 @@ def _run_tidy( ), transitive = [compilation_context.headers], ) - inputs = depset([ - dep - for dep in inputs0.to_list() - if 'src/mongo/' in dep.path]) - + args = ctx.actions.args() # specify the output file - twice @@ -70,6 +65,7 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") + ctx.actions.run( inputs = inputs, outputs = [outfile], @@ -101,7 +97,7 @@ def _rule_sources(ctx): if hasattr(ctx.rule.attr, "hdrs"): for hdr in ctx.rule.attr.hdrs: srcs += [hdr for hdr in hdr.files.to_list() if hdr.is_source and check_valid_file_type(hdr)] - return [src for src in srcs if 'src/mongo/' in src.path] + return srcs def _toolchain_flags(ctx, action_name = ACTION_NAMES.cpp_compile): cc_toolchain = find_cpp_toolchain(ctx) @@ -150,9 +146,9 @@ def _clang_tidy_aspect_impl(target, ctx): for tag in ignore_tags: if tag in ctx.rule.attr.tags: return [] + wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable - #fail(ctx.runfiles(files = [exe.files_to_run.executable]).files) additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] compilation_context = target[CcInfo].compilation_context @@ -162,6 +158,7 @@ def _clang_tidy_aspect_impl(target, ctx): cxx_flags = _safe_flags(_toolchain_flags(ctx, ACTION_NAMES.cpp_compile) + rule_flags) + ["-xc++"] srcs = _rule_sources(ctx) + outputs = [ _run_tidy( ctx, From 550e34fb074e955fb7fb5efa93793400926cc7ff Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Sat, 13 Apr 2024 23:59:39 -0400 Subject: [PATCH 092/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index c52dbbb..a563aba 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,7 +11,8 @@ def _run_tidy( compilation_context, infile, discriminator): - inputs = depset( + #fail(ctx.files) + inputs0 = depset( direct = ( [infile, config] + additional_deps.files.to_list() + @@ -19,7 +20,11 @@ def _run_tidy( ), transitive = [compilation_context.headers], ) - + inputs = depset([ + dep + for dep in inputs0.to_list() + if 'src/mongo/' in dep.path]) + args = ctx.actions.args() # specify the output file - twice @@ -65,7 +70,6 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") - ctx.actions.run( inputs = inputs, outputs = [outfile], @@ -97,7 +101,7 @@ def _rule_sources(ctx): if hasattr(ctx.rule.attr, "hdrs"): for hdr in ctx.rule.attr.hdrs: srcs += [hdr for hdr in hdr.files.to_list() if hdr.is_source and check_valid_file_type(hdr)] - return srcs + return [src for src in srcs if 'src/mongo/' in src.path] def _toolchain_flags(ctx, action_name = ACTION_NAMES.cpp_compile): cc_toolchain = find_cpp_toolchain(ctx) @@ -146,9 +150,9 @@ def _clang_tidy_aspect_impl(target, ctx): for tag in ignore_tags: if tag in ctx.rule.attr.tags: return [] - wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable + #fail(ctx.runfiles(files = [exe.files_to_run.executable]).files) additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] compilation_context = target[CcInfo].compilation_context @@ -158,7 +162,6 @@ def _clang_tidy_aspect_impl(target, ctx): cxx_flags = _safe_flags(_toolchain_flags(ctx, ACTION_NAMES.cpp_compile) + rule_flags) + ["-xc++"] srcs = _rule_sources(ctx) - outputs = [ _run_tidy( ctx, From c6d51c07fc0a333e544253e8047bed6f3d1ace01 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:29:58 -0400 Subject: [PATCH 093/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 75fccf8..318a83c 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -17,6 +17,7 @@ shift touch $OUTPUT truncate -s 0 $OUTPUT +echo PATH is $PATH echo find . -type f find . -type f From e943027742bdf0e5d12df53dad38cf6be4e213bc Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:02:26 -0400 Subject: [PATCH 094/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 318a83c..4fb5a12 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -21,6 +21,11 @@ echo PATH is $PATH echo find . -type f find . -type f +echo ls -l ./bazel-out/aarch64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy +ls -l ./bazel-out/aarch64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy +CLANG_TIDY_BIN="./bazel-out/aarch64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy" + + # if $CONFIG is provided by some external workspace, we need to # place it in the current directory test -e .clang-tidy || ln -s -f $CONFIG .clang-tidy From 8c73c3be14af47a1caa3e9bca1ad0677b05eb84d Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:09:57 -0400 Subject: [PATCH 095/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index a563aba..790e679 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -23,7 +23,8 @@ def _run_tidy( inputs = depset([ dep for dep in inputs0.to_list() - if 'src/mongo/' in dep.path]) + #if 'src/mongo/' in dep.path] + ) args = ctx.actions.args() From 32651bd6edd9c0aab8f02c8d708247d35d9dea15 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:10:24 -0400 Subject: [PATCH 096/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 790e679..0a8f0a3 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -24,7 +24,7 @@ def _run_tidy( dep for dep in inputs0.to_list() #if 'src/mongo/' in dep.path] - ) + ]) args = ctx.actions.args() From aff2269f3432edf38d5bba688dc0a9f34de60b3d Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:05:40 -0400 Subject: [PATCH 097/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 4fb5a12..21ace79 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -23,7 +23,7 @@ find . -type f echo ls -l ./bazel-out/aarch64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy ls -l ./bazel-out/aarch64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy -CLANG_TIDY_BIN="./bazel-out/aarch64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy" +# CLANG_TIDY_BIN="./bazel-out/aarch64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy" # if $CONFIG is provided by some external workspace, we need to From 3fde2e1b7b8f31a28200421332b205657ce541b0 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:29:09 -0400 Subject: [PATCH 098/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 0a8f0a3..ad1479e 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -191,6 +191,7 @@ clang_tidy_aspect = aspect( "_clang_tidy_executable": attr.label(default = Label("//:clang_tidy_executable")), "_clang_tidy_additional_deps": attr.label(default = Label("//:clang_tidy_additional_deps")), "_clang_tidy_config": attr.label(default = Label("//:clang_tidy_config")), + "_clang_tidy_src_must_contain_substring": attr.label(default = Label("//:clang_tidy_src_must_contain_substring")), }, toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], ) From 42f37efb0a4e50d20aebdf960b1f4b8aa8524a5c Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:32:03 -0400 Subject: [PATCH 099/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index ad1479e..fd6a760 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -191,7 +191,7 @@ clang_tidy_aspect = aspect( "_clang_tidy_executable": attr.label(default = Label("//:clang_tidy_executable")), "_clang_tidy_additional_deps": attr.label(default = Label("//:clang_tidy_additional_deps")), "_clang_tidy_config": attr.label(default = Label("//:clang_tidy_config")), - "_clang_tidy_src_must_contain_substring": attr.label(default = Label("//:clang_tidy_src_must_contain_substring")), + "_clang_tidy_src_must_contain_substring": attr.String(), }, toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], ) From 1750cb95cd0f0e31bbe9eb42f4939823e3f71432 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:43:18 -0400 Subject: [PATCH 100/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index fd6a760..bb25c8e 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -191,7 +191,7 @@ clang_tidy_aspect = aspect( "_clang_tidy_executable": attr.label(default = Label("//:clang_tidy_executable")), "_clang_tidy_additional_deps": attr.label(default = Label("//:clang_tidy_additional_deps")), "_clang_tidy_config": attr.label(default = Label("//:clang_tidy_config")), - "_clang_tidy_src_must_contain_substring": attr.String(), + "_clang_tidy_src_must_contain_substring": attr.string(), }, toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], ) From 30a8b555612e757a853e39367301918ad94b1309 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:48:25 -0400 Subject: [PATCH 101/104] Update run_clang_tidy.sh --- clang_tidy/run_clang_tidy.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 21ace79..5cddb59 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -17,15 +17,6 @@ shift touch $OUTPUT truncate -s 0 $OUTPUT -echo PATH is $PATH -echo find . -type f -find . -type f - -echo ls -l ./bazel-out/aarch64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy -ls -l ./bazel-out/aarch64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy -# CLANG_TIDY_BIN="./bazel-out/aarch64-fastbuild/bin/external/bazel_clang_tidy/clang_tidy/clang_tidy" - - # if $CONFIG is provided by some external workspace, we need to # place it in the current directory test -e .clang-tidy || ln -s -f $CONFIG .clang-tidy From f07e233cde83f9c4b9dab683d2ead2c2b45fbdd6 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:49:50 -0400 Subject: [PATCH 102/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index bb25c8e..5c9e5a1 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -11,8 +11,7 @@ def _run_tidy( compilation_context, infile, discriminator): - #fail(ctx.files) - inputs0 = depset( + inputs = depset( direct = ( [infile, config] + additional_deps.files.to_list() + @@ -20,11 +19,6 @@ def _run_tidy( ), transitive = [compilation_context.headers], ) - inputs = depset([ - dep - for dep in inputs0.to_list() - #if 'src/mongo/' in dep.path] - ]) args = ctx.actions.args() @@ -153,7 +147,6 @@ def _clang_tidy_aspect_impl(target, ctx): return [] wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable - #fail(ctx.runfiles(files = [exe.files_to_run.executable]).files) additional_deps = ctx.attr._clang_tidy_additional_deps config = ctx.attr._clang_tidy_config.files.to_list()[0] compilation_context = target[CcInfo].compilation_context @@ -191,7 +184,6 @@ clang_tidy_aspect = aspect( "_clang_tidy_executable": attr.label(default = Label("//:clang_tidy_executable")), "_clang_tidy_additional_deps": attr.label(default = Label("//:clang_tidy_additional_deps")), "_clang_tidy_config": attr.label(default = Label("//:clang_tidy_config")), - "_clang_tidy_src_must_contain_substring": attr.string(), }, toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], ) From c7c87ae87eb448c629aa9b45e15af6cae9d38334 Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:51:13 -0400 Subject: [PATCH 103/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 5c9e5a1..781c539 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -18,8 +18,7 @@ def _run_tidy( ([exe.files_to_run.executable] if exe.files_to_run.executable else []) ), transitive = [compilation_context.headers], - ) - + ) args = ctx.actions.args() # specify the output file - twice @@ -65,6 +64,7 @@ def _run_tidy( args.add_all(compilation_context.quote_includes.to_list(), before_each = "-iquote") args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem") + ctx.actions.run( inputs = inputs, outputs = [outfile], @@ -145,6 +145,7 @@ def _clang_tidy_aspect_impl(target, ctx): for tag in ignore_tags: if tag in ctx.rule.attr.tags: return [] + wrapper = ctx.attr._clang_tidy_wrapper.files_to_run exe = ctx.attr._clang_tidy_executable additional_deps = ctx.attr._clang_tidy_additional_deps @@ -156,6 +157,7 @@ def _clang_tidy_aspect_impl(target, ctx): cxx_flags = _safe_flags(_toolchain_flags(ctx, ACTION_NAMES.cpp_compile) + rule_flags) + ["-xc++"] srcs = _rule_sources(ctx) + outputs = [ _run_tidy( ctx, From 517a52a01cc47903b541690d174c9a94a47c47dd Mon Sep 17 00:00:00 2001 From: stevegrossmongodb <136485666+stevegrossmongodb@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:51:37 -0400 Subject: [PATCH 104/104] Update clang_tidy.bzl --- clang_tidy/clang_tidy.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl index 781c539..7ddc5c7 100644 --- a/clang_tidy/clang_tidy.bzl +++ b/clang_tidy/clang_tidy.bzl @@ -18,7 +18,8 @@ def _run_tidy( ([exe.files_to_run.executable] if exe.files_to_run.executable else []) ), transitive = [compilation_context.headers], - ) + ) + args = ctx.actions.args() # specify the output file - twice