From 7c95b54add25f00633678c0aaa81e3847ce0de22 Mon Sep 17 00:00:00 2001 From: tzaeschke Date: Thu, 5 Mar 2026 18:35:19 +0100 Subject: [PATCH 1/7] Clean up build files --- BUILD | 24 ++++++++++++++---------- MODULE.bazel | 35 +---------------------------------- MODULE.bazel.lock | 2 ++ 3 files changed, 17 insertions(+), 44 deletions(-) diff --git a/BUILD b/BUILD index 4dff90b0..61c79054 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,4 @@ -load("@rules_shell//shell:sh_binary.bzl", "sh_binary") +load("@buildifier_prebuilt//:rules.bzl", "buildifier") load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) @@ -54,16 +54,20 @@ config_setting( ) # Buildifier +buildifier( + name = "buildifier.fix", + exclude_patterns = ["./.git/*"], + lint_mode = "fix", + mode = "fix", +) -sh_binary( - name = "buildifier", - srcs = select( - { - ":linux": ["@buildifier_linux//file"], - ":macos": ["@buildifier_macos//file"], - ":windows": ["@buildifier_windows//file"], - }, - ), +buildifier( + name = "buildifier.check", + exclude_patterns = [ + "./.git/*", + ], + lint_mode = "warn", + mode = "diff", ) # Aspect-based clang-format diff --git a/MODULE.bazel b/MODULE.bazel index b7b0bdc9..8606a184 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -13,37 +13,4 @@ bazel_dep(name = "googletest", version = "1.17.0.bcr.2") bazel_dep(name = "spdlog", version = "1.17.0") bazel_dep(name = "google_benchmark", version = "1.9.5") -# Development environment tooling -http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") - -BUILDIFIER_VERSION = "0.29.0" - -http_file( - name = "buildifier_linux", - executable = True, - sha256 = "4c985c883eafdde9c0e8cf3c8595b8bfdf32e77571c369bf8ddae83b042028d6", - urls = ["https://github.com/bazelbuild/buildtools/releases/download/{version}/buildifier".format(version = BUILDIFIER_VERSION)], -) - -http_file( - name = "buildifier_macos", - executable = True, - sha256 = "9b108decaa9a624fbac65285e529994088c5d15fecc1a30866afc03a48619245", - urls = ["https://github.com/bazelbuild/buildtools/releases/download/{version}/buildifier.mac".format(version = BUILDIFIER_VERSION)], -) - -http_file( - name = "buildifier_windows", - executable = True, - sha256 = "dc5d6ed5e3e0dbe9955f7606939c627af5a2be7f9bdd8814e77a22109164394f", - urls = ["https://github.com/bazelbuild/buildtools/releases/download/{version}/buildifier.exe".format(version = BUILDIFIER_VERSION)], -) - -http_archive( - name = "bazel_compilation_database", - sha256 = "bb1b812396e2ee36a50a13b03ae6833173ce643e8a4bd50731067d0b4e5c6e86", - strip_prefix = "bazel-compilation-database-0.3.5", - url = "https://github.com/grailbio/bazel-compilation-database/archive/0.3.5.tar.gz", -) +bazel_dep(name = "buildifier_prebuilt", version = "8.2.1", dev_dependency = True) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index fcd2cbbc..24a31888 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -53,6 +53,8 @@ "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7", "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0", + "https://bcr.bazel.build/modules/buildifier_prebuilt/8.2.1/MODULE.bazel": "57f2736616367163651d9d3e918cddfd6c67ec7a541d924f2c4544d3fae8630e", + "https://bcr.bazel.build/modules/buildifier_prebuilt/8.2.1/source.json": "a3e79a347f9d8256d83eba2b621b5b6affa17c8b3236127f030db03b72a44a91", "https://bcr.bazel.build/modules/buildozer/8.2.1/MODULE.bazel": "61e9433c574c2bd9519cad7fa66b9c1d2b8e8d5f3ae5d6528a2c2d26e68d874d", "https://bcr.bazel.build/modules/buildozer/8.2.1/source.json": "7c33f6a26ee0216f85544b4bca5e9044579e0219b6898dd653f5fb449cf2e484", "https://bcr.bazel.build/modules/fmt/12.1.0/MODULE.bazel": "c6b460c936f408b371bf12ccee5ecbd5aed8f6abfb6e8b63fad0c622715fd458", From 9e8968cbe1da25aa1f3abf2e86340d42c6f55dfd Mon Sep 17 00:00:00 2001 From: tzaeschke Date: Thu, 5 Mar 2026 18:46:10 +0100 Subject: [PATCH 2/7] Clean up build files --- .github/workflows/bazel.yml | 2 +- BUILD | 9 +++++++-- third_party/gtest/BUILD | 2 ++ third_party/spdlog/BUILD | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 7e260cc2..c6fbbe50 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -38,7 +38,7 @@ jobs: - name: Bazel format shell: bash - run: ./ci/linting/buildifier.sh + run: bazel run //:buildifier.check - name: Build shell: bash diff --git a/BUILD b/BUILD index 61c79054..b4e7ad48 100644 --- a/BUILD +++ b/BUILD @@ -53,10 +53,13 @@ config_setting( constraint_values = ["@platforms//os:windows"], ) -# Buildifier buildifier( name = "buildifier.fix", - exclude_patterns = ["./.git/*"], + diff_command = "diff", + exclude_patterns = [ + "./.git/*", + "./.clwb/*", + ], lint_mode = "fix", mode = "fix", ) @@ -65,7 +68,9 @@ buildifier( name = "buildifier.check", exclude_patterns = [ "./.git/*", + "./.clwb/*", ], + diff_command = "diff", lint_mode = "warn", mode = "diff", ) diff --git a/third_party/gtest/BUILD b/third_party/gtest/BUILD index 9d3d02c1..4ffce61c 100644 --- a/third_party/gtest/BUILD +++ b/third_party/gtest/BUILD @@ -32,6 +32,8 @@ # # Bazel Build for Google C++ Testing Framework(Google Test) +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/third_party/spdlog/BUILD b/third_party/spdlog/BUILD index 68763012..09085d33 100644 --- a/third_party/spdlog/BUILD +++ b/third_party/spdlog/BUILD @@ -1,3 +1,5 @@ +load("@rules_cc//cc:cc_library.bzl", "cc_library") + licenses(["notice"]) cc_library( From 614951802a4f0194b13e357659d1c6009fa82716 Mon Sep 17 00:00:00 2001 From: tzaeschke Date: Thu, 5 Mar 2026 18:49:42 +0100 Subject: [PATCH 3/7] Clean up build files --- include/phtree/converter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/phtree/converter.h b/include/phtree/converter.h index 9781d39b..f1234bb2 100644 --- a/include/phtree/converter.h +++ b/include/phtree/converter.h @@ -24,7 +24,7 @@ * PLEASE do not include this file directly, it is included via common.h. * * This file contains conversion/transformation functions for converting user coordinates and - * shapes, such as PhPointD and PhBoxD, into PH-Tree native coordinates (PhPoint). + * shapes, such as PhPointD and PhBoxD, into PH-Tree native coordinates (PhPoint) */ namespace improbable::phtree { From 9953dafaf853b9e12f91362eb7e6f4e623102af0 Mon Sep 17 00:00:00 2001 From: tzaeschke Date: Thu, 5 Mar 2026 18:53:01 +0100 Subject: [PATCH 4/7] Clean up build files --- include/phtree/converter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/phtree/converter.h b/include/phtree/converter.h index f1234bb2..9781d39b 100644 --- a/include/phtree/converter.h +++ b/include/phtree/converter.h @@ -24,7 +24,7 @@ * PLEASE do not include this file directly, it is included via common.h. * * This file contains conversion/transformation functions for converting user coordinates and - * shapes, such as PhPointD and PhBoxD, into PH-Tree native coordinates (PhPoint) + * shapes, such as PhPointD and PhBoxD, into PH-Tree native coordinates (PhPoint). */ namespace improbable::phtree { From 055ce6197337b40359d1a839031451ed969e336a Mon Sep 17 00:00:00 2001 From: tzaeschke Date: Thu, 5 Mar 2026 18:54:36 +0100 Subject: [PATCH 5/7] Clean up build files --- BUILD | 2 +- CHANGELOG.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/BUILD b/BUILD index b4e7ad48..0dd6ddf2 100644 --- a/BUILD +++ b/BUILD @@ -66,11 +66,11 @@ buildifier( buildifier( name = "buildifier.check", + diff_command = "diff", exclude_patterns = [ "./.git/*", "./.clwb/*", ], - diff_command = "diff", lint_mode = "warn", mode = "diff", ) diff --git a/CHANGELOG.md b/CHANGELOG.md index 910a8bf8..bf2be273 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] -- Nothing yet + +- Upgraded buildifier + [#168](https://github.com/tzaeschke/phtree-cpp/pull/168) ## [1.7.0] - 2025-03-01 ### Changed From e307d87ca4b835880328affe5dfbd20d9e20c1c0 Mon Sep 17 00:00:00 2001 From: tzaeschke Date: Thu, 5 Mar 2026 19:37:28 +0100 Subject: [PATCH 6/7] Clean up build files --- ReleaseHowTo.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ReleaseHowTo.md b/ReleaseHowTo.md index e956d8b9..2f306b3d 100644 --- a/ReleaseHowTo.md +++ b/ReleaseHowTo.md @@ -4,13 +4,20 @@ ## Verify code ### Run tests +```shell CC=gcc bazel test ... --config=asan CC=clang bazel test ... --config=asan CC=clang bazel test ... --config=msan CC=clang bazel test ... --config=ubsan +``` Record versions: e.g. gcc 13.3, clang 18.1.3 +```shell +bazel run //:buildifier.check +bazel run //:buildifier.fix +``` + ### Run examples ```shell bazel run //examples:example From 4f2bc27d859faeecf552d19b8caaaae86f2a6bac Mon Sep 17 00:00:00 2001 From: tzaeschke Date: Sat, 14 Mar 2026 15:36:49 +0100 Subject: [PATCH 7/7] Clean up build files --- MODULE.bazel.lock | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 24a31888..0594f046 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -35,8 +35,9 @@ "https://bcr.bazel.build/modules/bazel_features/1.3.0/MODULE.bazel": "cdcafe83ec318cda34e02948e81d790aab8df7a929cec6f6969f13a489ccecd9", "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", "https://bcr.bazel.build/modules/bazel_features/1.33.0/MODULE.bazel": "8b8dc9d2a4c88609409c3191165bccec0e4cb044cd7a72ccbe826583303459f6", - "https://bcr.bazel.build/modules/bazel_features/1.33.0/source.json": "13617db3930328c2cd2807a0f13d52ca870ac05f96db9668655113265147b2a6", "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/MODULE.bazel": "275a59b5406ff18c01739860aa70ad7ccb3cfb474579411decca11c93b951080", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/source.json": "fcd4396b2df85f64f2b3bb436ad870793ecf39180f1d796f913cc9276d355309", "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", @@ -55,8 +56,8 @@ "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0", "https://bcr.bazel.build/modules/buildifier_prebuilt/8.2.1/MODULE.bazel": "57f2736616367163651d9d3e918cddfd6c67ec7a541d924f2c4544d3fae8630e", "https://bcr.bazel.build/modules/buildifier_prebuilt/8.2.1/source.json": "a3e79a347f9d8256d83eba2b621b5b6affa17c8b3236127f030db03b72a44a91", - "https://bcr.bazel.build/modules/buildozer/8.2.1/MODULE.bazel": "61e9433c574c2bd9519cad7fa66b9c1d2b8e8d5f3ae5d6528a2c2d26e68d874d", - "https://bcr.bazel.build/modules/buildozer/8.2.1/source.json": "7c33f6a26ee0216f85544b4bca5e9044579e0219b6898dd653f5fb449cf2e484", + "https://bcr.bazel.build/modules/buildozer/8.5.1/MODULE.bazel": "a35d9561b3fc5b18797c330793e99e3b834a473d5fbd3d7d7634aafc9bdb6f8f", + "https://bcr.bazel.build/modules/buildozer/8.5.1/source.json": "e3386e6ff4529f2442800dee47ad28d3e6487f36a1f75ae39ae56c70f0cd2fbd", "https://bcr.bazel.build/modules/fmt/12.1.0/MODULE.bazel": "c6b460c936f408b371bf12ccee5ecbd5aed8f6abfb6e8b63fad0c622715fd458", "https://bcr.bazel.build/modules/fmt/12.1.0/source.json": "d7b35221043d8d7c69e2a64d6a0783c97aa49c5ce198ee0a5ccd18c99f070b1a", "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", @@ -128,9 +129,9 @@ "https://bcr.bazel.build/modules/rules_cc/0.1.5/MODULE.bazel": "88dfc9361e8b5ae1008ac38f7cdfd45ad738e4fa676a3ad67d19204f045a1fd8", "https://bcr.bazel.build/modules/rules_cc/0.2.0/MODULE.bazel": "b5c17f90458caae90d2ccd114c81970062946f49f355610ed89bebf954f5783c", "https://bcr.bazel.build/modules/rules_cc/0.2.13/MODULE.bazel": "eecdd666eda6be16a8d9dc15e44b5c75133405e820f620a234acc4b1fdc5aa37", - "https://bcr.bazel.build/modules/rules_cc/0.2.14/MODULE.bazel": "353c99ed148887ee89c54a17d4100ae7e7e436593d104b668476019023b58df8", "https://bcr.bazel.build/modules/rules_cc/0.2.16/MODULE.bazel": "9242fa89f950c6ef7702801ab53922e99c69b02310c39fb6e62b2bd30df2a1d4", - "https://bcr.bazel.build/modules/rules_cc/0.2.16/source.json": "d03d5cde49376d87e14ec14b666c56075e5e3926930327fd5d0484a1ff2ac1cc", + "https://bcr.bazel.build/modules/rules_cc/0.2.17/MODULE.bazel": "1849602c86cb60da8613d2de887f9566a6d354a6df6d7009f9d04a14402f9a84", + "https://bcr.bazel.build/modules/rules_cc/0.2.17/source.json": "3832f45d145354049137c0090df04629d9c2b5493dc5c2bf46f1834040133a07", "https://bcr.bazel.build/modules/rules_cc/0.2.8/MODULE.bazel": "f1df20f0bf22c28192a794f29b501ee2018fa37a3862a1a2132ae2940a23a642", "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8",