From 6c9eea97da18c062666cfbad639338a39be2bc13 Mon Sep 17 00:00:00 2001 From: Leo Ghafari Date: Fri, 23 Jan 2026 14:56:03 +0900 Subject: [PATCH] Update repo to use a registry for build_utils --- .bazelrc | 7 +- .clang-format | 93 ------------------- .clang-tidy | 29 ------ BUILD.bazel | 12 +-- MODULE.bazel | 4 - MODULE.bazel.lock | 154 +++++++++++++++++++++++++++++++- build_utils_module/BUILD.bazel | 4 - build_utils_module/MODULE.bazel | 9 -- build_utils_module/README.md | 80 ----------------- build_utils_module/defs.bzl | 46 ---------- 10 files changed, 159 insertions(+), 279 deletions(-) delete mode 100644 .clang-format delete mode 100644 .clang-tidy delete mode 100644 build_utils_module/BUILD.bazel delete mode 100644 build_utils_module/MODULE.bazel delete mode 100644 build_utils_module/README.md delete mode 100644 build_utils_module/defs.bzl diff --git a/.bazelrc b/.bazelrc index c29fb6d..b01fe47 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,14 +1,17 @@ +# Custom registry +common --registry=https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main +common --registry=https://bcr.bazel.build # Clang-tidy configuration build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect build:clang-tidy --output_groups=report -build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config +build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=@build_utils//:clang_tidy_config build:clang-tidy --@bazel_clang_tidy//:clang_tidy_executable=@llvm_toolchain//:clang-tidy # Clang-format configuration # Setting up clang-format and clang-tidy build:clang-format-base --output_groups=report -build:clang-format-base --@bazel_clang_format//:config=//:clang-format-config +build:clang-format-base --@bazel_clang_format//:config=@build_utils//:clang-format-config build:clang-format-base --@bazel_clang_format//:binary=@llvm_toolchain//:clang-format diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 4fb4f52..0000000 --- a/.clang-format +++ /dev/null @@ -1,93 +0,0 @@ ---- -BasedOnStyle: Google -Standard: Auto -UseTab: Never -ColumnLimit: 100 -MaxEmptyLinesToKeep: 1 - -# Indent length values -IndentWidth: 4 -AccessModifierOffset: -2 -ContinuationIndentWidth: 4 -ConstructorInitializerIndentWidth: 2 - -#Indent rules -IndentCaseLabels: true -IndentFunctionDeclarationAfterType: false -NamespaceIndentation: None - -#Spacing rules -SpaceAfterControlStatementKeyword: true -SpaceAfterCStyleCast: false -SpaceBeforeAssignmentOperators: true -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 2 -SpacesInContainerLiterals: false -SpacesInAngles: false -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false -Cpp11BracedListStyle: false -PointerBindsToType: true - -#Line break rules -BreakConstructorInitializers: AfterColon -AllowAllParametersOfDeclarationOnNextLine: false -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLoopsOnASingleLine: false -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: true -BreakBeforeBinaryOperators: false -BreakBeforeTernaryOperators: false -BreakConstructorInitializersBeforeComma: false -BreakBeforeConceptDeclarations: true -IndentRequires: true -ConstructorInitializerAllOnOneLineOrOnePerLine: true - -BinPackArguments: false -BinPackParameters: false -ExperimentalAutoDetectBinPacking: false - -PenaltyBreakBeforeFirstCallParameter: 19 -PenaltyBreakComment: 60 -PenaltyBreakFirstLessLess: 1000 -PenaltyBreakString: 1 -PenaltyExcessCharacter: 1000 -PenaltyReturnTypeOnItsOwnLine: 90 - -# Brace wrapping rules -BreakBeforeBraces: Custom -BraceWrapping: - AfterClass: 'true' - AfterControlStatement: 'true' - AfterEnum : 'true' - AfterFunction : 'true' - AfterNamespace : 'true' - AfterStruct : 'true' - AfterUnion : 'true' - BeforeCatch : 'true' - BeforeElse : 'true' - # BeforeLambdaBody : 'true' - IndentBraces : 'false' - SplitEmptyFunction: 'false' - SplitEmptyRecord: 'false' - SplitEmptyNamespace: 'false' - - -# Include sorting rules -IncludeBlocks: Regroup -SortIncludes: true -IncludeCategories: - - Regex: '^<[a-z_]+>' - Priority: 1 - - Regex: '^<(.*\.(h|hpp)|[[:alnum:]\/_]*)>' - Priority: 2 - - Regex: '^".*\.(h|hpp)"' - Priority: 3 - -#Misc rules -AlignEscapedNewlinesLeft: false -AlignTrailingComments: true -AlignAfterOpenBracket: Align -DerivePointerBinding: false -FixNamespaceComments: true diff --git a/.clang-tidy b/.clang-tidy deleted file mode 100644 index afaedfa..0000000 --- a/.clang-tidy +++ /dev/null @@ -1,29 +0,0 @@ -WarningsAsErrors: '-*, -bugprone-*, -performance-*, -misc-*, --misc-include-cleaner, -cppcoreguidelines-avoid-non-const-global-variables, -cppcoreguidelines-avoid-goto, -readability-qualified-auto, -readability-identifier-naming, -readability-make-member-function-const, -readability-const-return-type, -readability-inconsistent-declaration-parameter-name' -CheckOptions: - - { key: readability-identifier-naming.ClassCase, value: CamelCase } - - { key: readability-identifier-naming.UnionCase, value: CamelCase } - - { key: readability-identifier-naming.EnumCase, value: CamelCase } - - { key: readability-identifier-naming.EnumConstantCase, value: lower_case } - - { key: readability-identifier-naming.TypeAliasCase, value: CamelCase } - - { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase } - - { key: readability-identifier-naming.TypeTemplateParameterCase, value: CamelCase } - - { key: readability-identifier-naming.TemplateTemplateParameterCase, value: CamelCase } - - { key: readability-identifier-naming.MemberCase, value: lower_case } - - { key: readability-identifier-naming.MemberSuffix, value: _ } - - { key: readability-identifier-naming.NamespaceCase, value: lower_case } - - { key: readability-identifier-naming.VariableCase, value: lower_case } - - { key: readability-identifier-naming.FunctionCase, value: lower_case } - - { key: readability-identifier-naming.ParameterCase, value: lower_case } - - { key: performance-unnecessary-value-param.AllowedTypes, value: '[Rr]ef(erence)?$;Ptr$;ptr$'} - - { key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: 1} diff --git a/BUILD.bazel b/BUILD.bazel index b0fc813..f3b9499 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -6,14 +6,4 @@ refresh_compile_commands( targets = { "//...": "", }, -) - -filegroup( - name = "clang-format-config", - srcs = [".clang-format"], -) - -filegroup( - name = "clang_tidy_config", - srcs = [".clang-tidy"], -) +) \ No newline at end of file diff --git a/MODULE.bazel b/MODULE.bazel index 389dee1..6fdf1b7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -15,10 +15,6 @@ bazel_dep(name = "bazel_clang_tidy", version = "0.0.1", dev_dependency = True) # Build Utils bazel_dep(name = "build_utils", version = "0.0.1") -local_path_override( - module_name = "build_utils", - path = "build_utils_module", -) # LLVM Setup llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index e74db2c..88e478a 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -186,7 +186,159 @@ "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "eec517b5bbe5492629466e11dae908d043364302283de25581e3eb944326c4ca", "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.6/MODULE.bazel": "e937cf0a3772f93ad91f3c7af4f330b76a878bbfee06527ca1a9673b790eb896", "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.6/source.json": "5f397158198f338129c865a4c3ae21bc5626a9664b3c3b40fa3b3c2ec1ff83bf", - "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198" + "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/abseil-cpp/20210324.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/abseil-cpp/20211102.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/abseil-cpp/20230125.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/abseil-cpp/20230802.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/abseil-cpp/20230802.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/abseil-cpp/20240116.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/abseil-cpp/20240116.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/abseil-cpp/20250127.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/apple_support/1.15.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/apple_support/1.23.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/aspect_bazel_lib/2.14.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/aspect_bazel_lib/2.19.3/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/aspect_bazel_lib/2.8.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.1.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.11.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.15.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.17.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.18.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.19.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.27.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.28.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.30.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.34.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.38.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.4.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.9.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_features/1.9.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.0.3/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.1.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.2.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.2.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.3.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.4.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.4.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.5.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.6.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.7.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.7.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/bazel_skylib/1.8.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/boringssl/0.0.0-20240530-2db0eb3/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/build_utils/0.0.1/MODULE.bazel": "4c5c0bbab146d9ac8d5b5fab13b728e360086fc6e6c2da1822d5916d0d099705", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/build_utils/0.0.1/source.json": "683e8ea2de4a5b6b75a3ff79f4440826c496a4f163185c2c487156cf10a5981d", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/buildozer/7.1.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/cpp-httplib/0.22.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/gawk/5.3.2.bcr.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/google_benchmark/1.8.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/googletest/1.11.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/googletest/1.14.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/googletest/1.15.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/googletest/1.17.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/helly25_bzl/0.3.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/jq.bzl/0.1.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/jsoncpp/1.9.5/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/libpfm/4.11.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/nlohmann_json/3.12.0.bcr.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/package_metadata/0.0.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/platforms/0.0.10/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/platforms/0.0.11/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/platforms/0.0.4/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/platforms/0.0.5/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/platforms/0.0.6/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/platforms/0.0.7/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/platforms/0.0.8/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/platforms/0.0.9/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/platforms/1.0.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/protobuf/21.7/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/protobuf/27.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/protobuf/27.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/protobuf/29.0-rc2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/protobuf/29.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/protobuf/3.19.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/pybind11_bazel/2.11.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/pybind11_bazel/2.12.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/re2/2023-09-01/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/re2/2024-07-02.bcr.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/re2/2024-07-02/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_android/0.1.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.10/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.13/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.14/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.15/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.16/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.17/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.6/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.8/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.0.9/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.1.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.1.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.2.14/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_cc/0.2.16/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_fuzzing/0.5.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/4.0.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/5.3.5/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/6.0.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/6.3.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/6.4.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/6.5.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/7.10.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/7.12.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/7.2.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/7.3.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/7.6.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_java/8.14.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_jvm_external/4.4.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_jvm_external/5.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_jvm_external/5.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_jvm_external/5.3/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_jvm_external/6.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_jvm_external/6.3/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_kotlin/1.9.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_kotlin/1.9.6/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_license/0.0.3/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_license/0.0.7/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_license/1.0.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_pkg/0.7.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_pkg/1.0.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_proto/4.0.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_proto/6.0.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_proto/7.0.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_python/0.10.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_python/0.23.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_python/0.25.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_python/0.28.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_python/0.31.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_python/0.33.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_python/0.4.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_python/0.40.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_shell/0.2.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_shell/0.4.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/rules_shell/0.6.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/stardoc/0.5.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/stardoc/0.5.3/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/stardoc/0.5.6/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/stardoc/0.6.2/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/stardoc/0.7.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/stardoc/0.7.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/tar.bzl/0.2.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/tar.bzl/0.6.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/toolchains_llvm/1.6.0/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/yq.bzl/0.1.1/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/zlib/1.2.11/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/zlib/1.3.1.bcr.6/MODULE.bazel": "not found", + "https://raw.githubusercontent.com/Yuki-cpp-Lab/bazel-registry/main/modules/zlib/1.3.1/MODULE.bazel": "not found" }, "selectedYankedVersions": {}, "moduleExtensions": { diff --git a/build_utils_module/BUILD.bazel b/build_utils_module/BUILD.bazel deleted file mode 100644 index 16b9bec..0000000 --- a/build_utils_module/BUILD.bazel +++ /dev/null @@ -1,4 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -# Export defs.bzl so it can be loaded by other modules -exports_files(["defs.bzl"]) diff --git a/build_utils_module/MODULE.bazel b/build_utils_module/MODULE.bazel deleted file mode 100644 index d2d18b1..0000000 --- a/build_utils_module/MODULE.bazel +++ /dev/null @@ -1,9 +0,0 @@ -module( - name = "build_utils", - version = "0.0.1", -) - -bazel_dep(name = "platforms", version = "1.0.0") -bazel_dep(name = "rules_cc", version = "0.2.16") -bazel_dep(name = "bazel_clang_format", version = "0.0.1") -bazel_dep(name = "bazel_clang_tidy", version = "0.0.1") diff --git a/build_utils_module/README.md b/build_utils_module/README.md deleted file mode 100644 index ebd53b6..0000000 --- a/build_utils_module/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# Build Utils Module - -This module provides common build utilities and macros for strict C++ development using Bazel. - -## Features - -- **Strict C++ Macros**: Wrappers around `cc_library`, `cc_binary`, and `cc_test` that enforce C++20 and warnings-as-errors. -- **Dependencies**: It declares dependencies on `bazel_clang_format` and `bazel_clang_tidy`, simplifying version management (though root module overrides may still be needed). - -## Usage - -### 1. Add dependency in `MODULE.bazel` - -```starlark -bazel_dep(name = "build_utils", version = "0.0.1") -``` - -If you are using it locally: - -```starlark -local_path_override( - module_name = "build_utils", - path = "path/to/build_utils", -) -``` - -### 2. Configure Toolchains (Required in Root Module) - -Due to Bazel restrictions (`toolchains_llvm` must be used by the root module), you must configure the toolchain in your project's `MODULE.bazel`: - -```starlark -bazel_dep(name = "toolchains_llvm", version = "1.6.0", dev_dependency = True) - -llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True) -llvm.toolchain( - llvm_version = "21.1.6", -) -use_repo(llvm, "llvm_toolchain") -register_toolchains("@llvm_toolchain//:all", dev_dependency = True) -``` - -### 3. Configure `.bazelrc` - -To use `clang-format` and `clang-tidy` with the LLVM toolchain: - -```bash -# Clang-tidy configuration -build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect -build:clang-tidy --output_groups=report -build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config -build:clang-tidy --@bazel_clang_tidy//:clang_tidy_executable=@llvm_toolchain//:clang-tidy - -# Clang-format configuration -build:clang-format-base --output_groups=report -build:clang-format-base --@bazel_clang_format//:config=//:clang-format-config -build:clang-format-base --@bazel_clang_format//:binary=@llvm_toolchain//:clang-format - -# Check-only mode -build:clang-format --config=clang-format-base \ - --aspects=@bazel_clang_format//:defs.bzl%check_aspect - -# Fix mode -build:clang-format-fix --config=clang-format-base \ - --aspects=@bazel_clang_format//:defs.bzl%fix_aspect \ - --use_action_cache=false -``` - -### 4. Use Strict Macros - -In your `BUILD.bazel` files: - -```starlark -load("@build_utils//:defs.bzl", "strict_cc_library", "strict_cc_binary", "strict_cc_test") - -strict_cc_library( - name = "my_lib", - srcs = ["my_lib.cpp"], - hdrs = ["my_lib.hpp"], -) -``` diff --git a/build_utils_module/defs.bzl b/build_utils_module/defs.bzl deleted file mode 100644 index 4bf9c4e..0000000 --- a/build_utils_module/defs.bzl +++ /dev/null @@ -1,46 +0,0 @@ -load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") - -_LINUX_FLAGS = [ - "-std=c++20", - "-Wall", - "-Wextra", - "-Wpedantic", - "-Werror", -] - -_WINDOWS_FLAGS = [ - "/std:c++20", - "/WX", - "/W4", -] - -def _strict_copts(): - return select({ - "@platforms//os:linux": _LINUX_FLAGS, - "@platforms//os:windows": _WINDOWS_FLAGS, - "//conditions:default": _LINUX_FLAGS, - }) - -def strict_cc_library(name, copts = [], **kwargs): - """Wrapper around cc_library that enforces C++20 and warnings as errors.""" - cc_library( - name = name, - copts = _strict_copts() + copts, - **kwargs - ) - -def strict_cc_binary(name, copts = [], **kwargs): - """Wrapper around cc_binary that enforces C++20 and warnings as errors.""" - cc_binary( - name = name, - copts = _strict_copts() + copts, - **kwargs - ) - -def strict_cc_test(name, copts = [], **kwargs): - """Wrapper around cc_test that enforces C++20 and warnings as errors.""" - cc_test( - name = name, - copts = _strict_copts() + copts, - **kwargs - )