Skip to content

Conversation

@WillAyd
Copy link
Contributor

@WillAyd WillAyd commented Jul 9, 2025

Rationale for this change

The Meson configuration is unusable on gcc 14.2 given issues with the RapidJSON release of 1.1.0 (released in 2016)

What changes are included in this PR?

Bumps the RapidJSON version to a commit hash that matches what is used in CMake by default

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions
Copy link

github-actions bot commented Jul 9, 2025

⚠️ GitHub issue #47039 has been automatically assigned in GitHub to PR creator.

@kou kou changed the title GH-47039: Bump RapidJSON dependency in Meson configuration GH-47039: [C++] Bump RapidJSON dependency in Meson configuration Jul 10, 2025
@kou
Copy link
Member

kou commented Jul 10, 2025

How about migrating to simdjson from RapidJSON instead?
#35460

@WillAyd
Copy link
Contributor Author

WillAyd commented Jul 10, 2025

Sure I can take a look. Although I think there is still value in bumping this in the meantime, since it was done for CMake too

@WillAyd WillAyd force-pushed the fix-meson-rapidjson branch from 76afe86 to 1a381f9 Compare July 10, 2025 14:58
@WillAyd
Copy link
Contributor Author

WillAyd commented Jul 24, 2025

I commented on the upstream discussion, but it unfortunately looks like SIMDJSON does not offer serialization support, so I don't think it would be suitable to replace RAPIDJSON completely any time soon

Comment on lines 296 to 297
rapidjson_proj = subproject('rapidjson')
rapidjson_dep = rapidjson_proj.get_variable('rapidjson_dep')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that we always use bundled RapidJSON?
Can we use bundled RapidJSON only when system RapidJSON is old?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that was the intent here. In theory we could do what you are looking for with the version argument of the dependency call, but I am not sure how that would work with RapidJSON given there haven't been any official releases in 9 years

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I think that most distributions such as Debian, Ubuntu, AlmaLinux and conda ships patched RapidJSON. So we can use system RapidJSON in most distributions.

I think that it's a problem that the current Meson configuration doesn't detect system RapidJSON: #47318 (comment)

Anyway, let's use this approach. Because this will be removed sooner or later. We'll migrate to simdjson: #35460

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Aug 14, 2025
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/rapidjson_1.1.0-2/rapidjson-1.1.0.tar.gz
wrapdb_version = 1.1.0-2
directory = rapidjson-232389d4f1012dddec4ef84861face2d2ba85709
source_url = https://github.com/miloyip/rapidjson/archive/232389d4f1012dddec4ef84861face2d2ba85709.tar.gz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
source_url = https://github.com/miloyip/rapidjson/archive/232389d4f1012dddec4ef84861face2d2ba85709.tar.gz
source_url = https://github.com/Tencent/rapidjson/archive/232389d4f1012dddec4ef84861face2d2ba85709.tar.gz

Comment on lines 296 to 297
rapidjson_proj = subproject('rapidjson')
rapidjson_dep = rapidjson_proj.get_variable('rapidjson_dep')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I think that most distributions such as Debian, Ubuntu, AlmaLinux and conda ships patched RapidJSON. So we can use system RapidJSON in most distributions.

I think that it's a problem that the current Meson configuration doesn't detect system RapidJSON: #47318 (comment)

Anyway, let's use this approach. Because this will be removed sooner or later. We'll migrate to simdjson: #35460

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Aug 14, 2025
@WillAyd WillAyd force-pushed the fix-meson-rapidjson branch from ecfe6b1 to 96cfc70 Compare August 15, 2025 16:32
@WillAyd WillAyd force-pushed the fix-meson-rapidjson branch from 96cfc70 to d7d2da2 Compare August 15, 2025 16:35
if needs_json or needs_integration
rapidjson_dep = dependency('rapidjson', include_type: 'system')
rapidjson_dep = dependency(
'RapidJSON',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kou thanks for pointing out #47318 (comment) - that was really helpful. This should fix the issue

@kou
Copy link
Member

kou commented Aug 15, 2025

System RapidJSON was found:

https://github.com/apache/arrow/actions/runs/16994828223/job/48182918285?pr=47041#step:6:502

Run-time dependency rapidjson found: YES 1.1.0

@kou kou merged commit 15662e6 into apache:main Aug 15, 2025
43 of 44 checks passed
@kou kou removed the awaiting merge Awaiting merge label Aug 15, 2025
@WillAyd WillAyd deleted the fix-meson-rapidjson branch August 15, 2025 21:53
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 15662e6.

There weren't enough matching historic benchmark results to make a call on whether there were regressions.

The full Conbench report has more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants