-
Notifications
You must be signed in to change notification settings - Fork 592
Update fastjson module #6498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
UebelAndre
wants to merge
4
commits into
bazelbuild:main
Choose a base branch
from
UebelAndre:fastjson-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+220
−3
Open
Update fastjson module #6498
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/MODULE.bazel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) |
23 changes: 23 additions & 0 deletions
23
modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/BUILD.bazel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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__"], | ||
| ) | ||
18 changes: 18 additions & 0 deletions
18
modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/MODULE.bazel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) |
Empty file.
12 changes: 12 additions & 0 deletions
12
...astjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/examples/address_book/BUILD.bazel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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"], | ||
| ) |
38 changes: 38 additions & 0 deletions
38
modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/tests/BUILD.bazel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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", | ||
| ], | ||
| ) |
44 changes: 44 additions & 0 deletions
44
modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/overlay/tests/tools.bzl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
7 changes: 7 additions & 0 deletions
7
...astjson/0.0.0-20120701063936-485f994a61a6.bcr.1/patches/boost_property_tree_compact.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 ); |
39 changes: 39 additions & 0 deletions
39
modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/presubmit.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| matrix: | ||
| platform: | ||
| - debian10 | ||
| - ubuntu2004 | ||
| - macos | ||
| - macos_arm64 | ||
| - windows | ||
| bazel: | ||
| - rolling | ||
| - 8.x | ||
| - 7.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: | ||
| - rolling | ||
| - 8.x | ||
| - 7.x | ||
| tasks: | ||
| run_test_module: | ||
| name: "Run test module" | ||
| platform: ${{ platform }} | ||
| bazel: ${{ bazel }} | ||
| test_targets: | ||
| - "//tests:all_tests" |
17 changes: 17 additions & 0 deletions
17
modules/fastjson/0.0.0-20120701063936-485f994a61a6.bcr.1/source.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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=" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,15 +4,16 @@ | |
| { | ||
| "email": "[email protected]", | ||
| "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": {} | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.