From ab5affff9002e8df48f1b16b81e8db3db318b6c3 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Tue, 11 Nov 2025 07:48:30 -0800 Subject: [PATCH 1/4] Update fastjson module --- .../MODULE.bazel | 18 ++++++++ .../overlay/BUILD.bazel | 23 ++++++++++ .../overlay/examples/BUILD.bazel | 0 .../overlay/examples/address_book/BUILD.bazel | 12 +++++ .../overlay/tests/BUILD.bazel | 38 ++++++++++++++++ .../overlay/tests/tools.bzl | 44 +++++++++++++++++++ .../patches/boost_property_tree_compact.patch | 7 +++ .../presubmit.yml | 38 ++++++++++++++++ .../source.json | 17 +++++++ modules/fastjson/metadata.json | 7 +-- 10 files changed, 201 insertions(+), 3 deletions(-) create mode 100644 modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/MODULE.bazel create mode 100644 modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/BUILD.bazel create mode 100644 modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/examples/BUILD.bazel create mode 100644 modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/examples/address_book/BUILD.bazel create mode 100644 modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/tests/BUILD.bazel create mode 100644 modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/tests/tools.bzl create mode 100644 modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/patches/boost_property_tree_compact.patch create mode 100644 modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/presubmit.yml create mode 100644 modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/MODULE.bazel b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/MODULE.bazel new file mode 100644 index 00000000000..3b55d11be0f --- /dev/null +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/MODULE.bazel @@ -0,0 +1,18 @@ +""" +Module: fastjson +Purpose: Provides the fastjson library compileable as a Bazel target. Includes unit testing through Bazel +Notes: boost.property_tree is used for the speed test unit test. saru is used as the unit testing framework +""" + +module( + name = "fastjson", + version = "0.0.0-20120701063936-485f994a61a6.bcr.1", + bazel_compatibility = [">=7.2.1"], # need support for "overlay" directory + compatibility_level = 1, +) + +bazel_dep(name = "rules_cc", version = "0.2.4") +bazel_dep(name = "platforms", version = "1.0.0") + +bazel_dep(name = "boost.property_tree", version = "1.89.0.bcr.1", dev_dependency = True) +bazel_dep(name = "saru", version = "0.0.0-20130617092049-c11c375fefd7", dev_dependency = True) diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/BUILD.bazel b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/BUILD.bazel new file mode 100644 index 00000000000..40cf2867342 --- /dev/null +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_cc//cc:cc_library.bzl", "cc_library") + +cc_library( + name = "fastjson", + srcs = glob(["src/*.cpp"]), + hdrs = glob(["include/**/*.h"]), + copts = select({ + "@platforms//os:windows": [], + "//conditions:default": [ + "-Wno-unused-variable", # Ignore unused element - Don't pollute downstream users + ], + }), + includes = ["include"], # Expose for import without include prefix + visibility = ["//visibility:public"], +) + +# This must be defined in top level BUILD as we can't access files above the target(s) file +cc_library( + name = "fastjson-test-srcs", + hdrs = glob(["src/*.cpp"]), + includes = ["include/fastjson"], # Tests need access to includes without fastjson folder prefix + visibility = ["//tests:__pkg__"], +) diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/examples/BUILD.bazel b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/examples/BUILD.bazel new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/examples/address_book/BUILD.bazel b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/examples/address_book/BUILD.bazel new file mode 100644 index 00000000000..3bfe0dd37b6 --- /dev/null +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/examples/address_book/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + +cc_binary( + name = "address_book", + srcs = ["address_book.cpp"], + copts = [ + "-g", # Debug symbols + "-Wall", # All warnings + ], + data = ["book.json"], # Include the JSON file as a runtime dependency + deps = ["//:fastjson"], +) diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/tests/BUILD.bazel b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/tests/BUILD.bazel new file mode 100644 index 00000000000..bba65a859c6 --- /dev/null +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/tests/BUILD.bazel @@ -0,0 +1,38 @@ +load("@rules_cc//cc:cc_test.bzl", "cc_test") +load(":tools.bzl", "test_set") + +TEST_COPTS = select({ + "@platforms//os:windows": [], + "//conditions:default": [ + "-g", # Debug symbols + "-Wall", # All warnings + ], +}) + +DEPS = [ + "//:fastjson", + "//:fastjson-test-srcs", + "@saru", +] + +test_suite( + name = "all_tests", + tests = test_set( + copts = TEST_COPTS, + test_files = glob( + ["**/*.cpp"], + exclude = ["misc/speed_test_boost.cpp"], + ), + deps = DEPS, + ) + [":speed_test"], +) + +cc_test( + name = "speed_test", + size = "medium", + srcs = ["misc/speed_test_boost.cpp"], + copts = TEST_COPTS, + deps = DEPS + [ + "@boost.property_tree", + ], +) diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/tests/tools.bzl b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/tests/tools.bzl new file mode 100644 index 00000000000..f90ba1a45ec --- /dev/null +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/tests/tools.bzl @@ -0,0 +1,44 @@ +"""Tool for generating C++ test targets efficiently using Bazel rules. +""" + +load("@rules_cc//cc:cc_test.bzl", "cc_test") + +def test_set( + test_files = None, + size = "small", + srcs = [], + file_extensions = ".cpp", + **kwargs): + """Creates C++ test targets from a list of test files. + + Args: + test_files: List of test file paths to process. Defaults to None. + size: Test size parameter for cc_test rule. Defaults to "small". + srcs: Additional source files to include in all tests. Defaults to empty list. + file_extensions: Expected extension of test files. Defaults to ".cpp". + **kwargs: Additional arguments to pass to cc_test rule. + + Returns: + List of test target names (e.g., [":test1", ":test2"]). + + Note: + Only files ending with the specified file_extensions are processed. + Each test target is created with the filename (without extension) as its name. + """ + test_targets = [] + + # Process positive tests + for file in test_files: + if not file.endswith(file_extensions): + continue + name = file[:-len(file_extensions)] + target = ":" + name + cc_test( + name = name, + size = size, + srcs = srcs + [file], + **kwargs + ) + test_targets.append(target) + + return test_targets diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/patches/boost_property_tree_compact.patch b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/patches/boost_property_tree_compact.patch new file mode 100644 index 00000000000..b9d7eeeefab --- /dev/null +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/patches/boost_property_tree_compact.patch @@ -0,0 +1,7 @@ +diff --git a/tests/misc/speed_test_boost.cpp b/tests/misc/speed_test_boost.cpp +index 490cab5..11df3e2 100644 +--- a/tests/misc/speed_test_boost.cpp ++++ b/tests/misc/speed_test_boost.cpp +@@ -111 +111 @@ int main() +- boost::property_tree::write_json_compact( ssout, n ); ++ boost::property_tree::write_json( ssout, n ); diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/presubmit.yml b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/presubmit.yml new file mode 100644 index 00000000000..56df21d38b0 --- /dev/null +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/presubmit.yml @@ -0,0 +1,38 @@ +matrix: + platform: + - debian10 + - ubuntu2004 + - macos + - macos_arm64 + - windows + bazel: + - 8.x + - 7.x + - 6.x +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - "@fastjson//:fastjson" + +bcr_test_module: + module_path: "tests" + matrix: + platform: + - debian10 + - ubuntu2004 + - macos + - macos_arm64 + - windows + bazel: + - 8.x + - 7.x + tasks: + run_test_module: + name: "Run test module" + platform: ${{ platform }} + bazel: ${{ bazel }} + test_targets: + - "//tests:all_tests" diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json new file mode 100644 index 00000000000..8c7873c1df4 --- /dev/null +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json @@ -0,0 +1,17 @@ +{ + "url": "https://github.com/mikeando/fastjson/archive/485f994.tar.gz", + "integrity": "sha256-phIJMsU4I0+lq+i1hIY+efTSKt5ik9fFVr1NvvJlUgM=", + "patch_strip": 1, + "strip_prefix": "fastjson-485f994a61a64ac73fa6a40d4d639b99b463563b", + "patches": { + "boost_property_tree_compact.patch": "sha256-TXYBKEYstPVgXM9gb8WS+h2ucd6aniFQJC2f1oiDvRo=" + }, + "overlay": { + "BUILD.bazel": "sha256-eH/vpiHShYq5FDEdUGN9kPeM172uCPIPnPNQJRuvNdU=", + "MODULE.bazel": "sha256-Vm2C97cPME/4OD1JvQvQqIkKIBaYDSgEjDJYcJDI/DM=", + "examples/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", + "examples/address_book/BUILD.bazel": "sha256-ATWDMRmpC/TrLxMH+HGaIHrJZt8tzTMgS8AspWaJkfE=", + "tests/BUILD.bazel": "sha256-dRVpZcvHpgEbJfg1zOx4JrgNxI9LnrE/lzbxAoXXhnQ=", + "tests/tools.bzl": "sha256-r6zxytasL71kmJQya2mERYO4q1xPvxwHNtJuhW9Gnio=" + } +} diff --git a/modules/fastjson/metadata.json b/modules/fastjson/metadata.json index b771f49cd9e..2b15c31d99c 100644 --- a/modules/fastjson/metadata.json +++ b/modules/fastjson/metadata.json @@ -4,15 +4,16 @@ { "email": "dev@rdxip.com", "github": "Attempt3035", - "name": "Luke Aguilar", - "github_user_id": 118163872 + "github_user_id": 118163872, + "name": "Luke Aguilar" } ], "repository": [ "github:mikeando/fastjson" ], "versions": [ - "0.0.0-20120701063936-485f994a61a6" + "0.0.0-20120701063936-485f994a61a6", + "0.0.0-20120701063936-485f994a61a6.bcr.1" ], "yanked_versions": {} } From c5c97e8eb0633d1b2a47474630504054a2d5cc63 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Tue, 11 Nov 2025 08:12:39 -0800 Subject: [PATCH 2/4] update integrity --- .../fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json index 8c7873c1df4..a9574dbe2b6 100644 --- a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json @@ -8,7 +8,6 @@ }, "overlay": { "BUILD.bazel": "sha256-eH/vpiHShYq5FDEdUGN9kPeM172uCPIPnPNQJRuvNdU=", - "MODULE.bazel": "sha256-Vm2C97cPME/4OD1JvQvQqIkKIBaYDSgEjDJYcJDI/DM=", "examples/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", "examples/address_book/BUILD.bazel": "sha256-ATWDMRmpC/TrLxMH+HGaIHrJZt8tzTMgS8AspWaJkfE=", "tests/BUILD.bazel": "sha256-dRVpZcvHpgEbJfg1zOx4JrgNxI9LnrE/lzbxAoXXhnQ=", From 13f478240432767f62b240c2bb3e709244de3931 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Tue, 11 Nov 2025 08:31:25 -0800 Subject: [PATCH 3/4] restored overlay --- .../overlay/MODULE.bazel | 18 ++++++++++++++++++ .../source.json | 1 + 2 files changed, 19 insertions(+) create mode 100644 modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/MODULE.bazel diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/MODULE.bazel b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/MODULE.bazel new file mode 100644 index 00000000000..3b55d11be0f --- /dev/null +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/MODULE.bazel @@ -0,0 +1,18 @@ +""" +Module: fastjson +Purpose: Provides the fastjson library compileable as a Bazel target. Includes unit testing through Bazel +Notes: boost.property_tree is used for the speed test unit test. saru is used as the unit testing framework +""" + +module( + name = "fastjson", + version = "0.0.0-20120701063936-485f994a61a6.bcr.1", + bazel_compatibility = [">=7.2.1"], # need support for "overlay" directory + compatibility_level = 1, +) + +bazel_dep(name = "rules_cc", version = "0.2.4") +bazel_dep(name = "platforms", version = "1.0.0") + +bazel_dep(name = "boost.property_tree", version = "1.89.0.bcr.1", dev_dependency = True) +bazel_dep(name = "saru", version = "0.0.0-20130617092049-c11c375fefd7", dev_dependency = True) diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json index a9574dbe2b6..8c7873c1df4 100644 --- a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json @@ -8,6 +8,7 @@ }, "overlay": { "BUILD.bazel": "sha256-eH/vpiHShYq5FDEdUGN9kPeM172uCPIPnPNQJRuvNdU=", + "MODULE.bazel": "sha256-Vm2C97cPME/4OD1JvQvQqIkKIBaYDSgEjDJYcJDI/DM=", "examples/BUILD.bazel": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", "examples/address_book/BUILD.bazel": "sha256-ATWDMRmpC/TrLxMH+HGaIHrJZt8tzTMgS8AspWaJkfE=", "tests/BUILD.bazel": "sha256-dRVpZcvHpgEbJfg1zOx4JrgNxI9LnrE/lzbxAoXXhnQ=", From 77cf709ecf12ed8d6dbc9b39bb967b586cbe55f7 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Tue, 11 Nov 2025 09:52:24 -0800 Subject: [PATCH 4/4] update CI --- .../0.0.0-20120701063936-485f994a61a6.bcr.1/presubmit.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/presubmit.yml b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/presubmit.yml index 56df21d38b0..53dd024a511 100644 --- a/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/presubmit.yml +++ b/modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/presubmit.yml @@ -6,9 +6,9 @@ matrix: - macos_arm64 - windows bazel: + - rolling - 8.x - 7.x - - 6.x tasks: verify_targets: name: Verify build targets @@ -27,6 +27,7 @@ bcr_test_module: - macos_arm64 - windows bazel: + - rolling - 8.x - 7.x tasks: