Skip to content

Commit 1998ed3

Browse files
GH-51007: [C++] Make uriparser an external dependency (#51244)
### Rationale for this change The vendored uriparser in `cpp/src/arrow/vendored/uriparser/` is 0.9.3, which is old and misses upstream security fixes. Instead of refreshing the vendored copy, this makes uriparser an external dependency like our other third-party dependencies. ### What changes are included in this PR? - Add `uriparser` to `ARROW_THIRDPARTY_DEPENDENCIES` - Add `build_uriparser()` that builds uriparser 1.0.2 with `FetchContent` for `uriparser_SOURCE=BUNDLED` (static; docs, tests, tools and `wchar_t` support are disabled). The built library is bundled into `arrow_bundled_dependencies`. - Require uriparser 0.9.6 or later for `uriparser_SOURCE=SYSTEM`. All uriparser APIs used by Arrow are available in 0.9.6, so supported platforms such as Ubuntu 22.04 can use their distribution package. - Add `cmake_modules/FinduriparserAlt.cmake`. It tries uriparser's CMake package configuration first and falls back to pkg-config (`liburiparser.pc`), because Debian and Ubuntu's `liburiparser-dev` provides only the pkg-config file. - Add `uriparser::uriparser` to `ARROW_STATIC_INSTALL_INTERFACE_LIBS` for `uriparser_SOURCE=SYSTEM`, so that static library users link uriparser. - meson: Use the system uriparser 0.9.6 or later if available. Otherwise, build uriparser 1.0.2 via `subprojects/uriparser.wrap` with the CMake subproject support. - Remove `cpp/src/arrow/vendored/uriparser/` and its section in `LICENSE.txt`. - Packaging: Install uriparser in our Docker images, conda environment, `Brewfile`, vcpkg manifests, MSYS2 setup and Linux packages build environments. - Packaging: Pass `-Duriparser_SOURCE` in `ci/scripts/cpp_build.sh`. - Packaging: Add uriparser to the dependency list in `docs/source/developers/cpp/building.rst`. ***NOTICE*** : The floor is 0.9.6 rather than 1.0.2, so supported platforms such as Ubuntu 22.04 can use their distro package and CI does not have to build uriparser from source. ### Are these changes tested? All existing tests pass. ### Are there any user-facing changes? Now Arrow requires uriparser or builds it . No user facing changes as such because no API changes . **This PR contains a "Critical Fix".** It has security fixes that has gone in uriparser. **AI Usage**: - Used for testing <-> building loop. * GitHub Issue: #51007 Authored-by: Narendra <naskastark11@gmail.com> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
1 parent 45801eb commit 1998ed3

61 files changed

Lines changed: 213 additions & 9803 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎LICENSE.txt‎

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -624,48 +624,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
624624

625625
--------------------------------------------------------------------------------
626626

627-
The files in cpp/src/arrow/vendored/uriparser/ have the following license
628-
(BSD 3-Clause License)
629-
630-
uriparser - RFC 3986 URI parsing library
631-
632-
Copyright (C) 2007, Weijia Song <songweijia@gmail.com>
633-
Copyright (C) 2007, Sebastian Pipping <sebastian@pipping.org>
634-
All rights reserved.
635-
636-
Redistribution and use in source and binary forms, with or without
637-
modification, are permitted provided that the following conditions
638-
are met:
639-
640-
* Redistributions of source code must retain the above
641-
copyright notice, this list of conditions and the following
642-
disclaimer.
643-
644-
* Redistributions in binary form must reproduce the above
645-
copyright notice, this list of conditions and the following
646-
disclaimer in the documentation and/or other materials
647-
provided with the distribution.
648-
649-
* Neither the name of the <ORGANIZATION> nor the names of its
650-
contributors may be used to endorse or promote products
651-
derived from this software without specific prior written
652-
permission.
653-
654-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
655-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
656-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
657-
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
658-
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
659-
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
660-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
661-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
662-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
663-
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
664-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
665-
OF THE POSSIBILITY OF SUCH DAMAGE.
666-
667-
--------------------------------------------------------------------------------
668-
669627
The files under dev/tasks/conda-recipes have the following license
670628

671629
BSD 3-clause license

‎ci/conda_env_cpp.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ re2
4848
simdjson
4949
snappy
5050
thrift-cpp>=0.11.0
51+
uriparser
5152
xsimd>=14.2
5253
zlib
5354
zstd

‎ci/docker/alpine-linux-3.22-cpp.dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ RUN apk add \
6565
sqlite-dev \
6666
thrift-dev \
6767
tzdata \
68+
uriparser-dev \
6869
utf8proc-dev \
6970
zlib-dev \
7071
zstd-dev && \

‎ci/docker/debian-13-cpp.dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ RUN apt-get update -y -q && \
7070
libsqlite3-dev \
7171
libssl-dev \
7272
libthrift-dev \
73+
liburiparser-dev \
7374
libutf8proc-dev \
7475
libxml2-dev \
7576
libzstd-dev \

‎ci/docker/debian-experimental-cpp.dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ RUN if [ -n "${gcc}" ]; then \
7373
libssh2-1-dev \
7474
libssl-dev \
7575
libthrift-dev \
76+
liburiparser-dev \
7677
libutf8proc-dev \
7778
libxml2-dev \
7879
libzstd-dev \

‎ci/docker/fedora-42-cpp.dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ RUN dnf update -y && \
6363
simdjson-devel \
6464
snappy-devel \
6565
thrift-devel \
66+
uriparser-devel \
6667
utf8proc-devel \
6768
wget \
6869
which \

‎ci/docker/ubuntu-22.04-cpp.dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ RUN apt-get update -y -q && \
101101
libssh2-1-dev \
102102
libssl-dev \
103103
libthrift-dev \
104+
liburiparser-dev \
104105
libutf8proc-dev \
105106
libxml2-dev \
106107
libzstd-dev \

‎ci/docker/ubuntu-24.04-cpp.dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ RUN apt-get update -y -q && \
102102
libssh2-1-dev \
103103
libssl-dev \
104104
libthrift-dev \
105+
liburiparser-dev \
105106
libutf8proc-dev \
106107
libxml2-dev \
107108
libzstd-dev \

‎ci/scripts/cpp_build.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ else
292292
-Dsimdjson_SOURCE="${simdjson_SOURCE:-}" \
293293
-DSnappy_SOURCE="${Snappy_SOURCE:-}" \
294294
-DThrift_SOURCE="${Thrift_SOURCE:-}" \
295+
-Duriparser_SOURCE="${uriparser_SOURCE:-}" \
295296
-Dutf8proc_SOURCE="${utf8proc_SOURCE:-}" \
296297
-Dzstd_SOURCE="${zstd_SOURCE:-}" \
297298
-Dxsimd_SOURCE="${xsimd_SOURCE:-}" \

‎ci/scripts/msys2_setup.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ case "${target}" in
4949
packages+=("${MINGW_PACKAGE_PREFIX}-snappy")
5050
packages+=("${MINGW_PACKAGE_PREFIX}-sqlite3")
5151
packages+=("${MINGW_PACKAGE_PREFIX}-thrift")
52-
packages+=("${MINGW_PACKAGE_PREFIX}-xsimd")
5352
packages+=("${MINGW_PACKAGE_PREFIX}-uriparser")
53+
packages+=("${MINGW_PACKAGE_PREFIX}-xsimd")
5454
packages+=("${MINGW_PACKAGE_PREFIX}-zstd")
5555
packages+=("patch")
5656

0 commit comments

Comments
 (0)