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/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ license=("Apache-2.0")
depends=("${MINGW_PACKAGE_PREFIX}-bzip2"
"${MINGW_PACKAGE_PREFIX}-curl" # for google-cloud-cpp bundled build
"${MINGW_PACKAGE_PREFIX}-libutf8proc"
"${MINGW_PACKAGE_PREFIX}-uriparser"
"${MINGW_PACKAGE_PREFIX}-re2"
"${MINGW_PACKAGE_PREFIX}-snappy"
"${MINGW_PACKAGE_PREFIX}-zlib"
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 @@ -294,6 +294,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
1 change: 1 addition & 0 deletions ci/scripts/msys2_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ case "${target}" in
packages+=("${MINGW_PACKAGE_PREFIX}-gflags")
packages+=("${MINGW_PACKAGE_PREFIX}-grpc")
packages+=("${MINGW_PACKAGE_PREFIX}-gtest")
packages+=("${MINGW_PACKAGE_PREFIX}-uriparser")
packages+=("${MINGW_PACKAGE_PREFIX}-libutf8proc")
packages+=("${MINGW_PACKAGE_PREFIX}-libxml2")
packages+=("${MINGW_PACKAGE_PREFIX}-llvm")
Expand Down
6 changes: 3 additions & 3 deletions ci/scripts/r_windows_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@ if [ -d mingw64/lib/ ]; then
# Move the 64-bit versions of libarrow into the expected location
mv mingw64/lib/*.a "${DST_DIR}/lib/x64"
# These are from https://dl.bintray.com/rtools/mingw{32,64}/
cp "${MSYS_LIB_DIR}"/mingw64/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,utf8proc,re2,nghttp2}.a "${DST_DIR}/lib/x64"
cp "${MSYS_LIB_DIR}"/mingw64/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,uriparser,utf8proc,re2,nghttp2}.a "${DST_DIR}/lib/x64"
fi

# Same for the 32-bit versions
if [ -d mingw32/lib/ ]; then
ls "${MSYS_LIB_DIR}/mingw32/lib/"
mkdir -p "${DST_DIR}/lib/i386"
mv mingw32/lib/*.a "${DST_DIR}/lib/i386"
cp "${MSYS_LIB_DIR}"/mingw32/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,utf8proc,re2,nghttp2}.a "${DST_DIR}/lib/i386"
cp "${MSYS_LIB_DIR}"/mingw32/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,uriparser,utf8proc,re2,nghttp2}.a "${DST_DIR}/lib/i386"
fi

# Do the same also for ucrt64
if [ -d ucrt64/lib/ ]; then
ls "${MSYS_LIB_DIR}/ucrt64/lib/"
mkdir -p "${DST_DIR}/lib/x64-ucrt"
mv ucrt64/lib/*.a "${DST_DIR}/lib/x64-ucrt"
cp "${MSYS_LIB_DIR}"/ucrt64/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,utf8proc,re2,nghttp2}.a "$DST_DIR"/lib/x64-ucrt
cp "${MSYS_LIB_DIR}"/ucrt64/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,uriparser,utf8proc,re2,nghttp2}.a "$DST_DIR"/lib/x64-ucrt
fi

# Create build artifact
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
90 changes: 90 additions & 0 deletions cpp/cmake_modules/FinduriparserAlt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# 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 and finally to a plain library search.

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_FOUND TRUE)
return()
endif()

if(URIPARSER_ROOT)
find_library(URIPARSER_LIB
NAMES uriparser
PATHS ${URIPARSER_ROOT}
PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}
NO_DEFAULT_PATH)
find_path(URIPARSER_INCLUDE_DIR
NAMES uriparser/Uri.h
PATHS ${URIPARSER_ROOT}
NO_DEFAULT_PATH
PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES})
else()
find_package(PkgConfig QUIET)
pkg_check_modules(URIPARSER_PC liburiparser)
if(URIPARSER_PC_FOUND)
set(URIPARSER_INCLUDE_DIR "${URIPARSER_PC_INCLUDEDIR}")
list(APPEND URIPARSER_PC_LIBRARY_DIRS "${URIPARSER_PC_LIBDIR}")
find_library(URIPARSER_LIB
NAMES uriparser
PATHS ${URIPARSER_PC_LIBRARY_DIRS}
NO_DEFAULT_PATH
PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES})
set(URIPARSER_VERSION "${URIPARSER_PC_VERSION}")
else()
find_library(URIPARSER_LIB
NAMES uriparser
PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES})
find_path(URIPARSER_INCLUDE_DIR
NAMES uriparser/Uri.h
PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES})
endif()
endif()

find_package_handle_standard_args(uriparserAlt
REQUIRED_VARS
URIPARSER_LIB
URIPARSER_INCLUDE_DIR
VERSION_VAR
URIPARSER_VERSION)

if(uriparserAlt_FOUND)
if(NOT TARGET uriparser::uriparser)
add_library(uriparser::uriparser UNKNOWN IMPORTED)
set_target_properties(uriparser::uriparser
PROPERTIES IMPORTED_LOCATION "${URIPARSER_LIB}"
INTERFACE_INCLUDE_DIRECTORIES
"${URIPARSER_INCLUDE_DIR}")
endif()
endif()
70 changes: 70 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 @@ -3250,6 +3261,65 @@ if(ARROW_WITH_BZ2)
endif()
endif()

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

macro(build_uriparser)
message(STATUS "Building uriparser from source")
set(URIPARSER_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/uriparser_ep-install")
if(MSVC)
set(URIPARSER_STATIC_LIB "${URIPARSER_PREFIX}/lib/uriparser.lib")
else()
set(URIPARSER_STATIC_LIB
"${URIPARSER_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}uriparser${CMAKE_STATIC_LIBRARY_SUFFIX}"
)
endif()

set(URIPARSER_CMAKE_ARGS
${EP_COMMON_CMAKE_ARGS}
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_INSTALL_LIBDIR=lib
"-DCMAKE_INSTALL_PREFIX=${URIPARSER_PREFIX}"
-DURIPARSER_BUILD_DOCS=OFF
-DURIPARSER_BUILD_TESTS=OFF
-DURIPARSER_BUILD_TOOLS=OFF
# Arrow only uses the char (not wchar_t) flavor of the API.
-DURIPARSER_BUILD_WCHAR_T=OFF)

if(MSVC AND ARROW_USE_STATIC_CRT)
list(APPEND URIPARSER_CMAKE_ARGS -DURIPARSER_MSVC_STATIC_CRT=ON)
endif()

externalproject_add(uriparser_ep
${EP_COMMON_OPTIONS}
CMAKE_ARGS ${URIPARSER_CMAKE_ARGS}
INSTALL_DIR ${URIPARSER_PREFIX}
URL ${ARROW_URIPARSER_SOURCE_URL}
URL_HASH "SHA256=${ARROW_URIPARSER_BUILD_SHA256_CHECKSUM}"
BUILD_BYPRODUCTS "${URIPARSER_STATIC_LIB}")

file(MAKE_DIRECTORY "${URIPARSER_PREFIX}/include")
add_library(uriparser::uriparser STATIC IMPORTED)
set_target_properties(uriparser::uriparser
PROPERTIES IMPORTED_LOCATION "${URIPARSER_STATIC_LIB}"
INTERFACE_COMPILE_DEFINITIONS "URI_STATIC_BUILD")
target_include_directories(uriparser::uriparser BEFORE
INTERFACE "${URIPARSER_PREFIX}/include")

add_dependencies(uriparser::uriparser uriparser_ep)

list(PREPEND ARROW_BUNDLED_STATIC_LIBS uriparser::uriparser)
endmacro()

# uriparser is mandatory: arrow::util::Uri is part of core Arrow.
resolve_dependency(uriparser
HAVE_ALT
TRUE
REQUIRED_VERSION
"1.0.2"
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
Loading