Skip to content

Commit 554dff3

Browse files
committed
Patch around GCC 14 rejecting vendored RapidJSON's broken operator=
objtreelite fails to build on the manylinux_riscv64 image's GCC 14: RapidJSON v1.1.0's GenericStringRef declares a copy-assignment that assigns to its own const length member, upstream-fixed 3 commits later by deleting the operator outright. Also wires the patch into the build and its paths into the workflow triggers.
1 parent a7ffe83 commit 554dff3

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

‎.github/workflows/build-treelite-runtime.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ on:
2121
paths:
2222
- '.github/workflows/build-treelite-runtime.yml'
2323
- 'docs/packages/treelite-runtime.yaml'
24+
- 'patches/treelite-runtime/**'
2425
push:
2526
branches: [main]
2627
paths:
2728
- '.github/workflows/build-treelite-runtime.yml'
2829
- 'docs/packages/treelite-runtime.yaml'
30+
- 'patches/treelite-runtime/**'
2931

3032
concurrency:
3133
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -68,6 +70,15 @@ jobs:
6870
ref: ${{ env.TREELITE_RUNTIME_VERSION }}
6971
persist-credentials: false
7072

73+
- name: Checkout python-wheels
74+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
75+
with:
76+
path: python-wheels
77+
persist-credentials: false
78+
79+
- name: Patch treelite source
80+
run: git apply python-wheels/patches/treelite-runtime/${{ env.TREELITE_RUNTIME_VERSION }}/0001-*.patch
81+
7182
# setuptools' default license-files glob (LICEN[CSZ]E*) is rooted at
7283
# setup.py's own directory, which for the runtime package is
7384
# runtime/python/, not the repository root where LICENSE actually lives.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From eaa233f4e012135829b4584d97b18a9bd534e4ee Mon Sep 17 00:00:00 2001
2+
From: Ludovic Henry <git@ludovic.dev>
3+
Date: Mon, 5 Oct 2026 19:26:42 +0000
4+
Subject: [PATCH] Pin vendored RapidJSON past v1.1.0's broken
5+
GenericStringRef::operator=
6+
7+
GenericStringRef declares a copy-assignment operator that assigns to
8+
its own const length member, which GCC 14 rejects outright instead of
9+
just warning (operator= is a template-class member never odr-used
10+
elsewhere in treelite, so older GCC never instantiated, and so never
11+
type-checked, its body). Fixed 3 commits after v1.1.0 by explicitly
12+
deleting the operator; pin to that commit instead of the tag.
13+
14+
Upstream-Status: Backport [https://github.com/Tencent/rapidjson/commit/862c39be371278a45a88d4d1d75164be57bb7e2d]
15+
---
16+
cmake/ExternalLibs.cmake | 2 +-
17+
1 file changed, 1 insertion(+), 1 deletion(-)
18+
19+
diff --git a/cmake/ExternalLibs.cmake b/cmake/ExternalLibs.cmake
20+
index 996874f..4405f50 100644
21+
--- a/cmake/ExternalLibs.cmake
22+
+++ b/cmake/ExternalLibs.cmake
23+
@@ -29,7 +29,7 @@ else()
24+
FetchContent_Declare(
25+
RapidJSON
26+
GIT_REPOSITORY https://github.com/Tencent/rapidjson
27+
- GIT_TAG v1.1.0
28+
+ GIT_TAG 862c39be371278a45a88d4d1d75164be57bb7e2d
29+
)
30+
FetchContent_Populate(RapidJSON)
31+
message(STATUS "RapidJSON was downloaded at ${rapidjson_SOURCE_DIR}.")
32+
--
33+
2.43.0
34+

0 commit comments

Comments
 (0)