Skip to content
Merged
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
26 changes: 22 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
UBUNTU: ${{ matrix.ubuntu }}
steps:
- name: Checkout Arrow
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
submodules: recursive
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
ARROW_WITH_ZSTD: ON
steps:
- name: Checkout Arrow
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
submodules: recursive
Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:
/d 1 `
/f
- name: Checkout Arrow
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
submodules: recursive
Expand Down Expand Up @@ -366,7 +366,7 @@ jobs:
/d 1 `
/f
- name: Checkout Arrow
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
submodules: recursive
Expand Down Expand Up @@ -395,6 +395,20 @@ jobs:
env:
# We can invalidate the current cache by updating this.
CACHE_VERSION: "2024-05-09"
- name: Checkout vcpkg
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
path: vcpkg
repository: microsoft/vcpkg
- name: Bootstrap vcpkg
run: |
vcpkg\bootstrap-vcpkg.bat
$VCPKG_ROOT = $(Resolve-Path -LiteralPath "vcpkg").ToString()
Write-Output ${VCPKG_ROOT} | `
Out-File -FilePath ${Env:GITHUB_PATH} -Encoding utf8 -Append
Write-Output "VCPKG_ROOT=${VCPKG_ROOT}" | `
Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
Comment on lines +398 to +411
Copy link
Member Author

Choose a reason for hiding this comment

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

Ensure using the latest vcpkg. vcpkg exists in GitHub Actions runner by default. But it may be older than vcpkg we want to use.

- name: Setup NuGet credentials for vcpkg caching
shell: bash
run: |
Expand All @@ -411,10 +425,14 @@ jobs:
- name: Build C++
shell: cmd
run: |
set VCPKG_ROOT_KEEP=%VCPKG_ROOT%
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
Copy link
Member Author

Choose a reason for hiding this comment

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

This overrides VCPKG_ROOT. So we need to restore our VCPKG_ROOT after this.

set VCPKG_ROOT=%VCPKG_ROOT_KEEP%
bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build"
- name: Build GLib
shell: cmd
run: |
set VCPKG_ROOT_KEEP=%VCPKG_ROOT%
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
set VCPKG_ROOT=%VCPKG_ROOT_KEEP%
bash -c "ci/scripts/c_glib_build.sh $(pwd) $(pwd)/build"
90 changes: 70 additions & 20 deletions c_glib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ endif
version_major = version_numbers[0].to_int()
version_minor = version_numbers[1].to_int()
version_micro = version_numbers[2].to_int()
version_no_snapshot = '.'.join(version_numbers)

api_version = '1.0'
so_version = version_major * 100 + version_minor
Expand Down Expand Up @@ -81,7 +82,7 @@ endif
generate_vapi = have_gi and get_option('vapi')
if generate_vapi
pkgconfig_variables += ['vapidir=@0@'.format(vapi_dir)]
add_languages('vala')
add_languages('vala', native: false)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not required but it reports a warning.

endif

arrow_cpp_build_dir = get_option('arrow_cpp_build_dir')
Expand All @@ -97,47 +98,96 @@ else
endif

if arrow_cpp_build_lib_dir == ''
arrow = dependency('arrow', version: ['>=' + version])
common_args = {'version': [f'>=@version_no_snapshot@']}
arrow = dependency(
'arrow',
'Arrow',
Copy link
Member Author

Choose a reason for hiding this comment

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

This is for detecting a package for CMake.

kwargs: common_args,
modules: ['Arrow::arrow_shared'],
Copy link
Member Author

Choose a reason for hiding this comment

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

This is for detecting a package for CMake.

)
# They are just for checking required modules are enabled. They are built into
# libarrow.so. So we don't need additional build flags for them.
dependency('arrow-compute', version: ['>=' + version])
dependency('arrow-csv', version: ['>=' + version])
dependency('arrow-filesystem', version: ['>=' + version])
dependency('arrow-json', version: ['>=' + version])
if arrow.type_name() == 'cmake'
assert(
arrow.get_variable('ARROW_COMPUTE', default_value: 'OFF') == 'ON',
'compute module must be enabled',
)
assert(
arrow.get_variable('ARROW_CSV', default_value: 'OFF') == 'ON',
'CSV module must be enabled',
)
assert(
arrow.get_variable('ARROW_FILESYSTEM', default_value: 'OFF') == 'ON',
'filesystem module must be enabled',
)
assert(
arrow.get_variable('ARROW_JSON', default_value: 'OFF') == 'ON',
'JSON module must be enabled',
)
else
dependency('arrow-compute', kwargs: common_args)
dependency('arrow-csv', kwargs: common_args)
dependency('arrow-filesystem', kwargs: common_args)
dependency('arrow-json', kwargs: common_args)
endif

have_arrow_orc = dependency(
'arrow-orc',
required: false,
version: ['>=' + version],
).found()
if arrow.type_name() == 'cmake'
have_arrow_orc = (arrow.get_variable('ARROW_ORC', default_value: 'OFF') == 'ON')
else
have_arrow_orc = dependency(
'arrow-orc',
kwargs: common_args,
required: false,
).found()
endif
arrow_cuda = dependency(
'arrow-cuda',
'ArrowCUDA',
kwargs: common_args,
modules: ['ArrowCUDA::arrow_cuda_shared'],
required: false,
version: ['>=' + version],
)
# we do not support compiling glib without acero engine
# we do not support compiling GLib without Acero engine
arrow_acero = dependency(
'arrow-acero',
required: true,
version: ['>=' + version],
'ArrowAcero',
kwargs: common_args,
modules: ['ArrowAcero::arrow_acero_shared'],
)
arrow_dataset = dependency(
'arrow-dataset',
'ArrowDataset',
kwargs: common_args,
modules: ['ArrowDataset::arrow_dataset_shared'],
required: false,
version: ['>=' + version],
)
arrow_flight = dependency(
'arrow-flight',
'ArrowFlight',
kwargs: common_args,
modules: ['ArrowFlight::arrow_flight_shared'],
required: false,
version: ['>=' + version],
)
arrow_flight_sql = dependency(
'arrow-flight-sql',
'ArrowFlightSql',
kwargs: common_args,
modules: ['ArrowFlightSql::arrow_flight_sql_shared'],
required: false,
)
gandiva = dependency(
'gandiva',
'Gandiva',
kwargs: common_args,
modules: ['Gandiva::gandiva_shared'],
required: false,
version: ['>=' + version],
)
gandiva = dependency('gandiva', required: false, version: ['>=' + version])
parquet = dependency('parquet', required: false, version: ['>=' + version])
parquet = dependency(
'parquet',
'Parquet',
kwargs: common_args,
modules: ['Parquet::parquet_shared'],
)
else
base_include_directories += [
include_directories(join_paths(arrow_cpp_build_dir, 'src')),
Expand Down
18 changes: 3 additions & 15 deletions c_glib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
{
"name": "arrow-glib",
"version-string": "20.0.0-SNAPSHOT",
"$comment:dependencies": "We can enable gobject-introspection again once it's updated",
Copy link
Member Author

Choose a reason for hiding this comment

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

GLib is updated but GObject Introspection isn't updated in the latest vcpkg. So we can't use GObject Introspection for now.

"dependencies": [
"glib",
"gobject-introspection",
"pkgconf"
],
"$comment": "2025.02.14",
"builtin-baseline": "d5ec528843d29e3a52d745a64b469f810b2cedbf",
"overrides": [
{
"$comment":
"We need gobject-introspection 1.80.0 or later for GLib 2.80.0 but vcpkg doesn't provide it yet.",
"name": "glib",
"version": "2.78.4"
},
{
"name": "vcpkg-tool-meson",
"version": "1.3.2"
}
]
"$comment": "We can update builtin-baseline by 'vcpkg x-update-baseline'",
"builtin-baseline": "09f6a4ef2f08252f7f4d924fd9c2d42165fb21c9"
}
5 changes: 4 additions & 1 deletion ci/scripts/c_glib_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ fi

PATH="${ARROW_HOME}/bin:${PATH}"

meson_cmake_prefix_path="${ARROW_HOME}"
meson_pkg_config_path="${ARROW_HOME}/lib/pkgconfig"

mkdir -p "${build_dir}"
Expand All @@ -46,6 +47,7 @@ if [ -n "${VCPKG_DEFAULT_TRIPLET:-}" ]; then
vcpkg install \
--x-manifest-root="${source_dir}" \
--x-install-root="${vcpkg_install_root}"
meson_cmake_prefix_path="${vcpkg_install_root}/${VCPKG_DEFAULT_TRIPLET}:${meson_cmake_prefix_path}"
PKG_CONFIG="${vcpkg_install_root}/${VCPKG_DEFAULT_TRIPLET}/tools/pkgconf/pkgconf.exe"
export PKG_CONFIG
meson_pkg_config_path="${vcpkg_install_root}/${VCPKG_DEFAULT_TRIPLET}/lib/pkgconfig:${meson_pkg_config_path}"
Expand All @@ -65,9 +67,10 @@ fi
# Build with Meson
meson setup \
--backend=ninja \
--prefix="${ARROW_HOME}" \
--cmake-prefix-path="${meson_cmake_prefix_path}" \
Copy link
Member Author

Choose a reason for hiding this comment

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

This is for finding CMake packages of Apache Arrow C++.

--libdir=lib \
--pkg-config-path="${meson_pkg_config_path}" \
--prefix="${ARROW_HOME}" \
-Ddoc="${with_doc}" \
-Dvapi="${ARROW_GLIB_VAPI}" \
-Dwerror="${ARROW_GLIB_WERROR}" \
Expand Down
63 changes: 60 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -532,22 +532,79 @@ enable_testing()
# For arrow.pc. Cflags.private, Libs.private and Requires.private are
# used when "pkg-config --cflags --libs --static arrow" is used.
set(ARROW_PC_CFLAGS "")
set(ARROW_PC_CFLAGS_PRIVATE " -DARROW_STATIC")
set(ARROW_PC_CFLAGS_PRIVATE "")
if(ARROW_BUILD_STATIC)
# We add -DARROW_STATIC only when static build is enabled because
# pkgconf 1.7.4 or later on Windows uses "--static" by default. If
# Cflags.private (-DARROW_STATIC) is used for shared linking, it
# will cause linke error. We recommend users to not use pkgconf for
# shared linking on Windows but we also provide a workaround here.
# If users don't enable ARROW_BUILD_STATIC, users can use pkgconf on
# Windows because Cflags.private is used but it has nothing.
string(APPEND ARROW_PC_CFLAGS_PRIVATE " -DARROW_STATIC")
Comment on lines +537 to +544
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a workaround for recent pkgconf on Windows. Our CI doesn't use -DARROW_BUILD_STATIC=ON.

endif()
set(ARROW_PC_LIBS_PRIVATE "")
set(ARROW_PC_REQUIRES_PRIVATE "")

# For arrow-acero.pc.
set(ARROW_ACERO_PC_CFLAGS "")
set(ARROW_ACERO_PC_CFLAGS_PRIVATE "")
if(ARROW_BUILD_STATIC)
string(APPEND ARROW_ACERO_PC_CFLAGS_PRIVATE " -DARROW_ACERO_STATIC")
endif()

# For arrow-dataset.pc.
set(ARROW_DATASET_PC_CFLAGS "")
set(ARROW_DATASET_PC_CFLAGS_PRIVATE "")
if(ARROW_BUILD_STATIC)
string(APPEND ARROW_DATASET_PC_CFLAGS_PRIVATE " -DARROW_DS_STATIC")
endif()

# For arrow-flight.pc.
set(ARROW_FLIGHT_PC_CFLAGS "")
set(ARROW_FLIGHT_PC_CFLAGS_PRIVATE "")
if(ARROW_BUILD_STATIC)
string(APPEND ARROW_FLIGHT_PC_CFLAGS_PRIVATE " -DARROW_FLIGHT_STATIC")
endif()
set(ARROW_FLIGHT_PC_REQUIRES_PRIVATE "")

# For arrow-flight-sql.pc.
set(ARROW_FLIGHT_SQL_PC_CFLAGS "")
set(ARROW_FLIGHT_SQL_PC_CFLAGS_PRIVATE "")
if(ARROW_BUILD_STATIC)
string(APPEND ARROW_FLIGHT_SQL_PC_CFLAGS_PRIVATE " -DARROW_FLIGHT_SQL_STATIC")
endif()
set(ARROW_FLIGHT_PC_REQUIRES_PRIVATE "")

# For arrow-substrait.pc.
set(ARROW_SUBSTRAIT_PC_CFLAGS "")
set(ARROW_SUBSTRAIT_PC_CFLAGS_PRIVATE "")
if(ARROW_BUILD_STATIC)
string(APPEND ARROW_SUBSTRAIT_PC_CFLAGS_PRIVATE " -DARROW_ENGINE_STATIC")
endif()

# For arrow-testing.pc.
set(ARROW_TESTING_PC_CFLAGS "")
set(ARROW_TESTING_PC_CFLAGS_PRIVATE " -DARROW_TESTING_STATIC")
set(ARROW_TESTING_PC_CFLAGS_PRIVATE "")
if(ARROW_BUILD_STATIC)
string(APPEND ARROW_TESTING_PC_CFLAGS_PRIVATE " -DARROW_TESTING_STATIC")
endif()
set(ARROW_TESTING_PC_LIBS "")
set(ARROW_TESTING_PC_REQUIRES "")

# For gandiva.pc.
set(GANDIVA_PC_CFLAGS "")
set(GANDIVA_PC_CFLAGS_PRIVATE "")
if(ARROW_BUILD_STATIC)
string(APPEND GANDIVA_PC_CFLAGS_PRIVATE " -DGANDIVA_STATIC")
endif()

# For parquet.pc.
set(PARQUET_PC_CFLAGS "")
set(PARQUET_PC_CFLAGS_PRIVATE " -DPARQUET_STATIC")
set(PARQUET_PC_CFLAGS_PRIVATE "")
if(ARROW_BUILD_STATIC)
string(APPEND PARQUET_PC_CFLAGS_PRIVATE " -DPARQUET_STATIC")
endif()
set(PARQUET_PC_REQUIRES "")
set(PARQUET_PC_REQUIRES_PRIVATE "")

Expand Down
12 changes: 3 additions & 9 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1667,11 +1667,10 @@ endif()
if(ARROW_BUILD_TESTS
OR ARROW_BUILD_BENCHMARKS
OR ARROW_BUILD_INTEGRATION
OR ARROW_USE_GLOG
OR ARROW_WITH_GRPC)
set(ARROW_NEED_GFLAGS 1)
Comment on lines -1671 to -1672
Copy link
Member Author

Choose a reason for hiding this comment

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

Bundled gRPC doesn't need gflags.

This is not required because we use gflags provided by vcpkg. (This was needed before vcpkg adds CMake 4.0.0 workaround.)

OR ARROW_USE_GLOG)
set(ARROW_NEED_GFLAGS TRUE)
else()
set(ARROW_NEED_GFLAGS 0)
set(ARROW_NEED_GFLAGS FALSE)
endif()

macro(build_gflags)
Expand Down Expand Up @@ -3962,17 +3961,13 @@ macro(build_grpc)
IMPORTED_LOCATION)
get_target_property(GRPC_CARES_INCLUDE_DIR c-ares::cares INTERFACE_INCLUDE_DIRECTORIES)
get_filename_component(GRPC_CARES_ROOT "${GRPC_CARES_INCLUDE_DIR}" DIRECTORY)
get_target_property(GRPC_GFLAGS_INCLUDE_DIR ${GFLAGS_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES)
get_filename_component(GRPC_GFLAGS_ROOT "${GRPC_GFLAGS_INCLUDE_DIR}" DIRECTORY)
get_target_property(GRPC_RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES)
get_filename_component(GRPC_RE2_ROOT "${GRPC_RE2_INCLUDE_DIR}" DIRECTORY)

# Put Abseil, etc. first so that local directories are searched
# before (what are likely) system directories
set(GRPC_CMAKE_PREFIX "${GRPC_CMAKE_PREFIX};${ABSL_PREFIX}")
set(GRPC_CMAKE_PREFIX "${GRPC_CMAKE_PREFIX};${GRPC_PB_ROOT}")
set(GRPC_CMAKE_PREFIX "${GRPC_CMAKE_PREFIX};${GRPC_GFLAGS_ROOT}")
set(GRPC_CMAKE_PREFIX "${GRPC_CMAKE_PREFIX};${GRPC_CARES_ROOT}")
set(GRPC_CMAKE_PREFIX "${GRPC_CMAKE_PREFIX};${GRPC_RE2_ROOT}")

Expand Down Expand Up @@ -4022,7 +4017,6 @@ macro(build_grpc)
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF
-DgRPC_BUILD_TESTS=OFF
-DgRPC_CARES_PROVIDER=package
-DgRPC_GFLAGS_PROVIDER=package
-DgRPC_MSVC_STATIC_RUNTIME=${ARROW_USE_STATIC_CRT}
-DgRPC_PROTOBUF_PROVIDER=package
-DgRPC_RE2_PROVIDER=package
Expand Down
9 changes: 9 additions & 0 deletions cpp/src/arrow/acero/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ add_custom_target(arrow_acero)

arrow_install_all_headers("arrow/acero")

# If libarrow_acero.a is only built, "pkg-config --cflags --libs
# arrow-acero" outputs build flags for static linking not shared
# linking. ARROW_ACERO_PC_* except ARROW_ACERO_PC_*_PRIVATE are for
# the static linking case.
if(NOT ARROW_BUILD_SHARED AND ARROW_BUILD_STATIC)
string(APPEND ARROW_ACERO_PC_CFLAGS "${ARROW_ACERO_PC_CFLAGS_PRIVATE}")
set(ARROW_ACERO_PC_CFLAGS_PRIVATE "")
endif()

set(ARROW_ACERO_SRCS
accumulation_queue.cc
scalar_aggregate_node.cc
Expand Down
Loading
Loading