From 3cbeb5340c40a76a6ed72940e578c672d0ed4f13 Mon Sep 17 00:00:00 2001 From: Guofang Date: Mon, 31 Aug 2026 17:09:15 +0800 Subject: [PATCH] Fix RapidJSON compatibility with newer compilers --- debian13/Dockerfile | 4 +++- .../rapidjson-generic-string-ref-assignment.patch | 12 ++++++++++++ rockylinux9/Dockerfile | 4 +++- .../rapidjson-generic-string-ref-assignment.patch | 12 ++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 debian13/rapidjson-generic-string-ref-assignment.patch create mode 100644 rockylinux9/rapidjson-generic-string-ref-assignment.patch diff --git a/debian13/Dockerfile b/debian13/Dockerfile index 917294e..3a957b1 100644 --- a/debian13/Dockerfile +++ b/debian13/Dockerfile @@ -401,13 +401,15 @@ RUN git clone --branch=json-c-0.19-20260627 --depth=1 https://github.com/json-c/ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src +COPY rapidjson-generic-string-ref-assignment.patch /tmp/ RUN git clone --branch=v1.1.0 --depth=1 https://github.com/Tencent/rapidjson.git src \ + && git -C src apply /tmp/rapidjson-generic-string-ref-assignment.patch \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DRAPIDJSON_BUILD_DOC=OFF \ -DRAPIDJSON_BUILD_EXAMPLES=OFF \ -DRAPIDJSON_BUILD_TESTS=OFF \ && cmake --build build --parallel "$(nproc)" --target install \ - && rm -rf build src + && rm -rf build src /tmp/rapidjson-generic-string-ref-assignment.patch RUN git clone --branch=curl-8_21_0 --depth=1 https://github.com/curl/curl.git src \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ diff --git a/debian13/rapidjson-generic-string-ref-assignment.patch b/debian13/rapidjson-generic-string-ref-assignment.patch new file mode 100644 index 0000000..ddf76b0 --- /dev/null +++ b/debian13/rapidjson-generic-string-ref-assignment.patch @@ -0,0 +1,12 @@ +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index e3e20df..6d4c1a4 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -317,6 +317,6 @@ struct GenericStringRef { + GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} + +- GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; } ++ GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */; + + //! implicit conversion to plain CharType pointer + operator const Ch *() const { return s; } diff --git a/rockylinux9/Dockerfile b/rockylinux9/Dockerfile index 289b1a9..b1abf0c 100644 --- a/rockylinux9/Dockerfile +++ b/rockylinux9/Dockerfile @@ -409,13 +409,15 @@ RUN git clone --branch=json-c-0.19-20260627 --depth=1 https://github.com/json-c/ && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src +COPY rapidjson-generic-string-ref-assignment.patch /tmp/ RUN git clone --branch=v1.1.0 --depth=1 https://github.com/Tencent/rapidjson.git src \ + && git -C src apply /tmp/rapidjson-generic-string-ref-assignment.patch \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DRAPIDJSON_BUILD_DOC=OFF \ -DRAPIDJSON_BUILD_EXAMPLES=OFF \ -DRAPIDJSON_BUILD_TESTS=OFF \ && cmake --build build --parallel "$(nproc)" --target install \ - && rm -rf build src + && rm -rf build src /tmp/rapidjson-generic-string-ref-assignment.patch RUN git clone --branch=curl-8_21_0 --depth=1 https://github.com/curl/curl.git src \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ diff --git a/rockylinux9/rapidjson-generic-string-ref-assignment.patch b/rockylinux9/rapidjson-generic-string-ref-assignment.patch new file mode 100644 index 0000000..ddf76b0 --- /dev/null +++ b/rockylinux9/rapidjson-generic-string-ref-assignment.patch @@ -0,0 +1,12 @@ +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index e3e20df..6d4c1a4 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -317,6 +317,6 @@ struct GenericStringRef { + GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} + +- GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; } ++ GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */; + + //! implicit conversion to plain CharType pointer + operator const Ch *() const { return s; }