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
5 changes: 4 additions & 1 deletion .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,10 @@ jobs:
- os: macos-latest
arch: arm64v8
env:
MACOSX_DEPLOYMENT_TARGET: "10.15"
# std::format (via <format> in the C++ driver framework) instantiates
# libc++'s floating-point formatter, which calls std::to_chars, available
# in libc++ starting with macOS 13.3.
MACOSX_DEPLOYMENT_TARGET: "13.3"
PYTHON: "/Library/Frameworks/Python.framework/Versions/3.14/bin/python3.14"
# Where to install vcpkg
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
Expand Down
26 changes: 0 additions & 26 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,32 +271,6 @@ All rights reserved.

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

The files under c/vendor/fmt contain code from {fmt}.
{fmt} is under the MIT license:

Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

The files under c/vendor/backward contain code from backward-cpp.
backward-cpp has the following license:

Expand Down
8 changes: 1 addition & 7 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ project(adbc
VERSION "${ADBC_BASE_VERSION}"
LANGUAGES C CXX)
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(AdbcDefines)
include(BuildUtils)
Expand All @@ -36,12 +36,6 @@ if(NOT ADBC_DEFINE_COMMON_ENTRYPOINTS)
set(ADBC_TARGET_COMPILE_DEFINITIONS "ADBC_NO_COMMON_ENTRYPOINTS")
endif()

if(ADBC_WITH_VENDORED_FMT)
add_subdirectory(vendor/fmt EXCLUDE_FROM_ALL)
set_target_properties(fmt PROPERTIES POSITION_INDEPENDENT_CODE ON)
else()
find_package(fmt REQUIRED)
endif()
if(ADBC_WITH_VENDORED_NANOARROW)
add_subdirectory(vendor/nanoarrow)
else()
Expand Down
2 changes: 1 addition & 1 deletion c/cmake_modules/AdbcDefines.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ if(ADBC_BUILD_TESTS)
if(NOT GTest_FOUND)
message(STATUS "Building googletest from source")
# Required for GoogleTest
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
include(FetchContent)
fetchcontent_declare(googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
Expand Down
2 changes: 0 additions & 2 deletions c/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")

define_option(ADBC_GGDB_DEBUG "Pass -ggdb flag to debug builds" ON)

define_option(ADBC_WITH_VENDORED_FMT "Use vendored copy of fmt" ON)

define_option(ADBC_WITH_VENDORED_NANOARROW "Use vendored copy of nanoarrow" ON)

#----------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions c/driver/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ adbc_configure_target(adbc_driver_framework)
set_target_properties(adbc_driver_framework PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(adbc_driver_framework PRIVATE "${REPOSITORY_ROOT}/c/"
"${REPOSITORY_ROOT}/c/include")
target_link_libraries(adbc_driver_framework PUBLIC adbc_driver_common fmt::fmt)
target_link_libraries(adbc_driver_framework PUBLIC adbc_driver_common)

# For static builds, we need to install the static library here so downstream
# applications can link to it
if(ADBC_BUILD_STATIC)
if(ADBC_WITH_VENDORED_FMT OR ADBC_WITH_VENDORED_NANOARROW)
message(WARNING "adbc_driver_framework is not installed when ADBC_WITH_VENDORED_FMT or ADBC_WITH_VENDORED_NANOARROW are ON. To use the static libraries, for now you must provide these dependencies instead of using the vendored copies"
if(ADBC_WITH_VENDORED_NANOARROW)
message(WARNING "adbc_driver_framework is not installed when ADBC_WITH_VENDORED_NANOARROW is ON. To use the static libraries, for now you must provide this dependency instead of using the vendored copy"
)
else()
install(TARGETS adbc_driver_framework ${INSTALL_IS_OPTIONAL}
Expand Down
2 changes: 1 addition & 1 deletion c/driver/framework/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ adbc_framework_lib = library(
sources: ['objects.cc', 'utility.cc'],
include_directories: [include_dir, c_dir],
link_with: [adbc_common_lib],
dependencies: [nanoarrow_dep, fmt_dep],
dependencies: [nanoarrow_dep],
install: true,
)
12 changes: 6 additions & 6 deletions c/driver/framework/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <vector>

#if defined(ADBC_FRAMEWORK_USE_FMT)
#include <fmt/core.h>
#include <format>
#endif

#include <arrow-adbc/adbc.h>
Expand Down Expand Up @@ -328,11 +328,11 @@ STATUS_CTOR(Unknown, UNKNOWN)
#if defined(ADBC_FRAMEWORK_USE_FMT)
namespace adbc::driver::status::fmt {

#define STATUS_CTOR(NAME, CODE) \
template <typename... Args> \
static Status NAME(std::string_view format_string, Args&&... args) { \
auto message = ::fmt::vformat(format_string, ::fmt::make_format_args(args...)); \
return Status(ADBC_STATUS_##CODE, std::move(message)); \
#define STATUS_CTOR(NAME, CODE) \
template <typename... Args> \
static Status NAME(std::string_view format_string, Args&&... args) { \
auto message = std::vformat(format_string, std::make_format_args(args...)); \
return Status(ADBC_STATUS_##CODE, std::move(message)); \
}

// TODO: unit tests for internal utilities
Expand Down
6 changes: 3 additions & 3 deletions c/driver/postgresql/connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
#include <vector>

#include <arrow-adbc/adbc.h>
#include <fmt/format.h>
#include <libpq-fe.h>
#include <format>

#include "database.h"
#include "driver/common/utils.h"
Expand Down Expand Up @@ -1231,7 +1231,7 @@ AdbcStatusCode PostgresConnection::SetOption(const char* key, const char* value,
PQerrorMessage(conn_));
return ADBC_STATUS_INTERNAL;
}
std::string query = fmt::format("SET search_path TO {}", value_esc);
std::string query = std::format("SET search_path TO {}", value_esc);
PQfreemem(value_esc);

PqResultHelper result_helper{conn_, query};
Expand Down Expand Up @@ -1259,7 +1259,7 @@ AdbcStatusCode PostgresConnection::SetOption(const char* key, const char* value,
return ADBC_STATUS_INVALID_ARGUMENT;
}

std::string query = fmt::format(
std::string query = std::format(
"SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL {}", pg_level);
PqResultHelper result_helper{conn_, query};
RAISE_STATUS(error, result_helper.Execute());
Expand Down
4 changes: 2 additions & 2 deletions c/driver/postgresql/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <arrow-adbc/adbc.h>
#include <libpq-fe.h>

#include <fmt/core.h>
#include <format>

#include "driver/framework/status.h"

Expand Down Expand Up @@ -73,7 +73,7 @@ AdbcStatusCode SetError(struct AdbcError* error, PGresult* result, const char* f

template <typename... Args>
Status MakeStatus(PGresult* result, const char* format_string, Args&&... args) {
auto message = ::fmt::vformat(format_string, ::fmt::make_format_args(args...));
auto message = std::vformat(format_string, std::make_format_args(args...));

AdbcStatusCode code = ADBC_STATUS_IO;
char sqlstate_out[5];
Expand Down
2 changes: 1 addition & 1 deletion c/driver/postgresql/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ adbc_postgres_driver_lib = library(
],
include_directories: [include_dir, c_dir, safe_math_dir],
link_with: [adbc_common_lib, adbc_framework_lib],
dependencies: [nanoarrow_dep, fmt_dep, libpq_dep],
dependencies: [nanoarrow_dep, libpq_dep],
)

pkg.generate(
Expand Down
2 changes: 1 addition & 1 deletion c/driver/sqlite/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ adbc_sqlite3_driver_lib = library(
sources: ['sqlite.cc', 'statement_reader.c'],
include_directories: [include_dir, c_dir],
link_with: [adbc_common_lib, adbc_framework_lib],
dependencies: [nanoarrow_dep, fmt_dep, sqlite3_dep],
dependencies: [nanoarrow_dep, sqlite3_dep],
c_args: ['-DSIZEOF_TIME_T=' + time_t_size.to_string()],
)

Expand Down
2 changes: 0 additions & 2 deletions c/integration/static_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ find_package(AdbcDriverSQLite REQUIRED)
if(NOT TARGET SQLite3::SQLite3)
add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3)
endif()
find_package(fmt REQUIRED)
find_package(nanoarrow REQUIRED)

add_executable(static_test main.c)
Expand All @@ -47,7 +46,6 @@ target_link_libraries(static_test
AdbcDriverSQLite::adbc_driver_sqlite_static
PostgreSQL::PostgreSQL
SQLite3::SQLite3
fmt::fmt
nanoarrow::nanoarrow
AdbcDriverCommon::adbc_driver_common
AdbcDriverFramework::adbc_driver_framework)
3 changes: 1 addition & 2 deletions c/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ project(
'buildtype=release',
'c_std=c99',
'warning_level=2',
'cpp_std=c++17',
'cpp_std=c++20',
],
)

Expand All @@ -44,7 +44,6 @@ install_headers('include/adbc.h')
install_headers('include/arrow-adbc/adbc.h', subdir: 'arrow-adbc')
driver_dir = include_directories('driver')
nanoarrow_dep = dependency('nanoarrow')
fmt_dep = dependency('fmt')
safe_math_dir = include_directories('vendor/portable-snippets/include')

if get_option('tests').enabled()
Expand Down
13 changes: 0 additions & 13 deletions c/subprojects/fmt.wrap

This file was deleted.

8 changes: 0 additions & 8 deletions c/vendor/fmt/.clang-format

This file was deleted.

24 changes: 0 additions & 24 deletions c/vendor/fmt/.gitignore

This file was deleted.

Loading
Loading