Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -624,48 +624,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------

The files in cpp/src/arrow/vendored/uriparser/ have the following license
(BSD 3-Clause License)

uriparser - RFC 3986 URI parsing library

Copyright (C) 2007, Weijia Song <songweijia@gmail.com>
Copyright (C) 2007, Sebastian Pipping <sebastian@pipping.org>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.

* Neither the name of the <ORGANIZATION> nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------

The files under dev/tasks/conda-recipes have the following license

BSD 3-clause license
Expand Down
1 change: 1 addition & 0 deletions ci/conda_env_cpp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ re2
simdjson
snappy
thrift-cpp>=0.11.0
uriparser
xsimd>=14.2
zlib
zstd
1 change: 1 addition & 0 deletions ci/docker/alpine-linux-3.22-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN apk add \
sqlite-dev \
thrift-dev \
tzdata \
uriparser-dev \
utf8proc-dev \
zlib-dev \
zstd-dev && \
Expand Down
1 change: 1 addition & 0 deletions ci/docker/debian-13-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ RUN apt-get update -y -q && \
libsqlite3-dev \
libssl-dev \
libthrift-dev \
liburiparser-dev \
libutf8proc-dev \
libxml2-dev \
libzstd-dev \
Expand Down
1 change: 1 addition & 0 deletions ci/docker/debian-experimental-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ RUN if [ -n "${gcc}" ]; then \
libssh2-1-dev \
libssl-dev \
libthrift-dev \
liburiparser-dev \
libutf8proc-dev \
libxml2-dev \
libzstd-dev \
Expand Down
1 change: 1 addition & 0 deletions ci/docker/fedora-42-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ RUN dnf update -y && \
simdjson-devel \
snappy-devel \
thrift-devel \
uriparser-devel \
utf8proc-devel \
wget \
which \
Expand Down
1 change: 1 addition & 0 deletions ci/docker/ubuntu-22.04-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ RUN apt-get update -y -q && \
libssh2-1-dev \
libssl-dev \
libthrift-dev \
liburiparser-dev \
libutf8proc-dev \
libxml2-dev \
libzstd-dev \
Expand Down
1 change: 1 addition & 0 deletions ci/docker/ubuntu-24.04-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ RUN apt-get update -y -q && \
libssh2-1-dev \
libssl-dev \
libthrift-dev \
liburiparser-dev \
libutf8proc-dev \
libxml2-dev \
libzstd-dev \
Expand Down
1 change: 1 addition & 0 deletions ci/scripts/cpp_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ else
-Dsimdjson_SOURCE="${simdjson_SOURCE:-}" \
-DSnappy_SOURCE="${Snappy_SOURCE:-}" \
-DThrift_SOURCE="${Thrift_SOURCE:-}" \
-Duriparser_SOURCE="${uriparser_SOURCE:-}" \
-Dutf8proc_SOURCE="${utf8proc_SOURCE:-}" \
-Dzstd_SOURCE="${zstd_SOURCE:-}" \
-Dxsimd_SOURCE="${xsimd_SOURCE:-}" \
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/msys2_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ case "${target}" in
packages+=("${MINGW_PACKAGE_PREFIX}-snappy")
packages+=("${MINGW_PACKAGE_PREFIX}-sqlite3")
packages+=("${MINGW_PACKAGE_PREFIX}-thrift")
packages+=("${MINGW_PACKAGE_PREFIX}-xsimd")
packages+=("${MINGW_PACKAGE_PREFIX}-uriparser")
packages+=("${MINGW_PACKAGE_PREFIX}-xsimd")
packages+=("${MINGW_PACKAGE_PREFIX}-zstd")
packages+=("patch")

Expand Down
1 change: 1 addition & 0 deletions ci/vcpkg/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"openssl",
"re2",
"snappy",
"uriparser",
"utf8proc",
"xsimd",
"zlib",
Expand Down
1 change: 1 addition & 0 deletions cpp/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ brew "rapidjson"
brew "re2"
brew "snappy"
brew "thrift"
brew "uriparser"
brew "utf8proc"
brew "wget"
brew "xsimd"
Expand Down
63 changes: 63 additions & 0 deletions cpp/cmake_modules/FinduriparserAlt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Find uriparser.
#
# Debian, Ubuntu and several other distributions ship a liburiparser-dev that
# provides only a pkg-config file, while upstream (and vcpkg, conda-forge)
# also install a CMake package configuration. Try the CMake config first, then
# fall back to pkg-config.

if(uriparserAlt_FOUND)
return()
endif()

set(find_package_args)
if(uriparserAlt_FIND_VERSION)
list(APPEND find_package_args ${uriparserAlt_FIND_VERSION})
endif()
if(uriparserAlt_FIND_QUIETLY)
list(APPEND find_package_args QUIET)
endif()
find_package(uriparser ${find_package_args} CONFIG)
if(uriparser_FOUND)
set(uriparserAlt_VERSION "${uriparser_VERSION}")
set(uriparserAlt_FOUND TRUE)
return()
endif()

set(uriparser_pkg_config_args GLOBAL IMPORTED_TARGET)
if(uriparserAlt_FIND_QUIETLY)
find_package(PkgConfig QUIET)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add QUIET only when uriparserAlt_FIND_QUIETLY?

list(APPEND uriparser_pkg_config_args QUIET)
else()
find_package(PkgConfig)
endif()
list(APPEND uriparser_pkg_config_args liburiparser)
pkg_check_modules(uriparser_PC ${uriparser_pkg_config_args})
if(uriparser_PC_FOUND)
set(uriparserAlt_VERSION "${uriparser_PC_VERSION}")
endif()

find_package_handle_standard_args(
uriparserAlt
REQUIRED_VARS uriparser_PC_FOUND
VERSION_VAR uriparserAlt_VERSION)

if(uriparserAlt_FOUND AND NOT TARGET uriparser::uriparser)
add_library(uriparser::uriparser ALIAS PkgConfig::uriparser_PC)
endif()
55 changes: 55 additions & 0 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
Snappy
Substrait
Thrift
uriparser
utf8proc
xsimd
ZLIB
Expand Down Expand Up @@ -220,6 +221,8 @@ macro(build_dependency DEPENDENCY_NAME)
build_substrait()
elseif("${DEPENDENCY_NAME}" STREQUAL "Thrift")
build_thrift()
elseif("${DEPENDENCY_NAME}" STREQUAL "uriparser")
build_uriparser()
elseif("${DEPENDENCY_NAME}" STREQUAL "utf8proc")
build_utf8proc()
elseif("${DEPENDENCY_NAME}" STREQUAL "xsimd")
Expand Down Expand Up @@ -810,6 +813,14 @@ else()
)
endif()

if(DEFINED ENV{ARROW_URIPARSER_URL})
set(ARROW_URIPARSER_SOURCE_URL "$ENV{ARROW_URIPARSER_URL}")
else()
set_urls(ARROW_URIPARSER_SOURCE_URL
"https://github.com/uriparser/uriparser/releases/download/uriparser-${ARROW_URIPARSER_BUILD_VERSION}/uriparser-${ARROW_URIPARSER_BUILD_VERSION}.tar.bz2"
)
endif()

if(DEFINED ENV{ARROW_UTF8PROC_URL})
set(ARROW_UTF8PROC_SOURCE_URL "$ENV{ARROW_UTF8PROC_URL}")
else()
Expand Down Expand Up @@ -3285,6 +3296,50 @@ if(ARROW_WITH_BZ2)
endif()
endif()

# ----------------------------------------------------------------------
# uriparser library

function(build_uriparser)
list(APPEND CMAKE_MESSAGE_INDENT "uriparser: ")
message(STATUS "Building uriparser from source")

fetchcontent_declare(uriparser
${FC_DECLARE_COMMON_OPTIONS} OVERRIDE_FIND_PACKAGE
URL ${ARROW_URIPARSER_SOURCE_URL}
URL_HASH "SHA256=${ARROW_URIPARSER_BUILD_SHA256_CHECKSUM}")

prepare_fetchcontent()

set(URIPARSER_BUILD_DOCS OFF)
set(URIPARSER_BUILD_TESTS OFF)
set(URIPARSER_BUILD_TOOLS OFF)
# Arrow only uses the char (not wchar_t) flavor of the API.
set(URIPARSER_BUILD_WCHAR_T OFF)
# Don't install uriparser into Arrow's install prefix.
set(URIPARSER_ENABLE_INSTALL OFF)
if(MSVC AND ARROW_USE_STATIC_CRT)
set(URIPARSER_MSVC_STATIC_CRT ON)
endif()

fetchcontent_makeavailable(uriparser)

list(PREPEND ARROW_BUNDLED_STATIC_LIBS uriparser)
set(ARROW_BUNDLED_STATIC_LIBS
${ARROW_BUNDLED_STATIC_LIBS}
PARENT_SCOPE)

list(POP_BACK CMAKE_MESSAGE_INDENT)
endfunction()

# uriparser is mandatory: arrow::util::Uri is part of core Arrow.
resolve_dependency(uriparser
HAVE_ALT
TRUE
REQUIRED_VERSION
"0.9.6"
PC_PACKAGE_NAMES
liburiparser)

macro(build_utf8proc)
message(STATUS "Building utf8proc from source")
set(UTF8PROC_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/utf8proc_ep-install")
Expand Down
31 changes: 6 additions & 25 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ if(ARROW_WITH_OPENTELEMETRY)
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl)
endif()

if(uriparser_SOURCE STREQUAL "SYSTEM")
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS uriparser::uriparser)
endif()

if(ARROW_WITH_UTF8PROC)
if(utf8proc_SOURCE STREQUAL "SYSTEM")
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS utf8proc::utf8proc)
Expand Down Expand Up @@ -521,32 +525,13 @@ set(ARROW_VENDORED_SRCS
vendored/double-conversion/fixed-dtoa.cc
vendored/double-conversion/string-to-double.cc
vendored/double-conversion/strtod.cc
vendored/musl/strptime.c
vendored/uriparser/UriCommon.c
vendored/uriparser/UriCompare.c
vendored/uriparser/UriEscape.c
vendored/uriparser/UriFile.c
vendored/uriparser/UriIp4.c
vendored/uriparser/UriIp4Base.c
vendored/uriparser/UriMemory.c
vendored/uriparser/UriNormalize.c
vendored/uriparser/UriNormalizeBase.c
vendored/uriparser/UriParse.c
vendored/uriparser/UriParseBase.c
vendored/uriparser/UriQuery.c
vendored/uriparser/UriRecompose.c
vendored/uriparser/UriResolve.c
vendored/uriparser/UriShorten.c)
vendored/musl/strptime.c)
if(APPLE)
list(APPEND ARROW_VENDORED_SRCS vendored/datetime/ios.mm)
endif()
set_source_files_properties(vendored/datetime.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION
ON)
arrow_add_object_library(ARROW_VENDORED ${ARROW_VENDORED_SRCS})
# Disable DLL exports in vendored uriparser library
foreach(ARROW_VENDORED_TARGET ${ARROW_VENDORED_TARGETS})
target_compile_definitions(${ARROW_VENDORED_TARGET} PRIVATE URI_STATIC_BUILD)
endforeach()

set(ARROW_UTIL_SRCS
util/align_util.cc
Expand Down Expand Up @@ -647,12 +632,8 @@ endif()

arrow_add_object_library(ARROW_UTIL ${ARROW_UTIL_SRCS})

# Disable DLL exports in vendored uriparser library
foreach(ARROW_UTIL_TARGET ${ARROW_UTIL_TARGETS})
target_compile_definitions(${ARROW_UTIL_TARGET} PRIVATE URI_STATIC_BUILD)
endforeach()
foreach(ARROW_UTIL_TARGET ${ARROW_UTIL_TARGETS})
target_link_libraries(${ARROW_UTIL_TARGET} PRIVATE ${ARROW_XSIMD})
target_link_libraries(${ARROW_UTIL_TARGET} PRIVATE uriparser::uriparser ${ARROW_XSIMD})
endforeach()

if(ARROW_WITH_SIMDJSON)
Expand Down
Loading
Loading