Skip to content

Commit

Permalink
refactor(c)!: Updated include/install paths for adbc.h (#1965)
Browse files Browse the repository at this point in the history
closes #1150

---------

Co-authored-by: Dewey Dunnington <[email protected]>
  • Loading branch information
WillAyd and paleolimbot authored Jul 30, 2024
1 parent dc02729 commit 8fb7c2f
Show file tree
Hide file tree
Showing 140 changed files with 290 additions and 669 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ on:
branches:
- main
paths:
- "adbc.h"
- "c/**"
- "ci/**"
- "go/**"
- "python/**"
- ".github/workflows/integration.yml"
push:
paths:
- "adbc.h"
- "c/**"
- "ci/**"
- "go/**"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/native-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ on:
branches:
- main
paths:
- "adbc.h"
- "c/**"
- "ci/**"
- "docs/**"
Expand All @@ -33,7 +32,6 @@ on:
- ".github/workflows/native-unix.yml"
push:
paths:
- "adbc.h"
- "c/**"
- "ci/**"
- "docs/**"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/native-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ on:
branches:
- main
paths:
- "adbc.h"
- "c/**"
- "ci/**"
- "glib/**"
Expand All @@ -32,7 +31,6 @@ on:
- ".github/workflows/native-windows.yml"
push:
paths:
- "adbc.h"
- "c/**"
- "ci/**"
- "glib/**"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ on:
- main
paths:
- ".env"
- "adbc.h"
- "c/**"
- "ci/**"
- "glib/**"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/r-basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ on:
branches:
- main
paths:
- "adbc.h"
- "c/**"
- "go/adbc/driver/**"
- "go/adbc/pkg/**"
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/r-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ jobs:
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(brew --prefix libpq)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig"
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV
# Usually, pak::pkg_install() will run bootstrap.R if it is included and is declared;
# however, this doesn't work for local:: for some reason (which is what
# setup-r-dependencies uses under the hood)
- name: Bootstrap R Package
run: |
pushd r/adbcdrivermanager
Rscript bootstrap.R
popd
pushd "r/${{ inputs.pkg }}"
Rscript bootstrap.R
popd
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, local::../adbcdrivermanager
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/r-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ on:
branches:
- main
paths:
- "adbc.h"
- "c/**"
- "go/adbc/driver/**"
- "go/adbc/pkg/**"
Expand Down
7 changes: 7 additions & 0 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ add_subdirectory(vendor/nanoarrow)
add_subdirectory(driver/common)
add_subdirectory(driver/framework)

install(FILES "${REPOSITORY_ROOT}/c/include/adbc.h" DESTINATION include)
install(FILES "${REPOSITORY_ROOT}/c/include/arrow-adbc/adbc.h"
DESTINATION include/arrow-adbc)

if(ADBC_BUILD_TESTS)
add_subdirectory(validation)
endif()
Expand All @@ -54,6 +58,9 @@ if(ADBC_DRIVER_FLIGHTSQL)
endif()

if(ADBC_DRIVER_MANAGER)
install(FILES "${REPOSITORY_ROOT}/c/include/adbc_driver_manager.h" DESTINATION include)
install(FILES "${REPOSITORY_ROOT}/c/include/arrow-adbc/adbc_driver_manager.h"
DESTINATION include/arrow-adbc)
add_subdirectory(driver_manager)
endif()

Expand Down
2 changes: 1 addition & 1 deletion c/apidoc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = ../../adbc.h ../../README.md ../../c/driver_manager/adbc_driver_manager.h
INPUT = ../../c/include/arrow-adbc/adbc.h ../../README.md ../../c/include/arrow-adbc/adbc_driver_manager.h

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
4 changes: 2 additions & 2 deletions c/driver/bigquery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ if(ADBC_BUILD_TESTS)
${TEST_LINK_LIBS})
target_compile_features(adbc-driver-bigquery-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-bigquery-test SYSTEM
PRIVATE ${REPOSITORY_ROOT}
${REPOSITORY_ROOT}/c/
PRIVATE ${REPOSITORY_ROOT}/c/
${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver
${REPOSITORY_ROOT}/c/driver/common)
Expand Down
2 changes: 1 addition & 1 deletion c/driver/bigquery/bigquery_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#include <adbc.h>
#include <arrow-adbc/adbc.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest-matchers.h>
#include <gtest/gtest-param-test.h>
Expand Down
5 changes: 3 additions & 2 deletions c/driver/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
add_library(adbc_driver_common STATIC utils.c)
adbc_configure_target(adbc_driver_common)
set_target_properties(adbc_driver_common PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(adbc_driver_common PRIVATE "${REPOSITORY_ROOT}"
target_include_directories(adbc_driver_common PRIVATE "${REPOSITORY_ROOT}/c/include"
"${REPOSITORY_ROOT}/c/vendor")

if(ADBC_BUILD_TESTS)
Expand All @@ -35,6 +35,7 @@ if(ADBC_BUILD_TESTS)
nanoarrow)
target_compile_features(adbc-driver-common-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-common-test
PRIVATE "${REPOSITORY_ROOT}" "${REPOSITORY_ROOT}/c/vendor")
PRIVATE "${REPOSITORY_ROOT}/c/include"
"${REPOSITORY_ROOT}/c/vendor")
adbc_configure_target(adbc-driver-common-test)
endif()
2 changes: 1 addition & 1 deletion c/driver/common/driver_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <utility>
#include <vector>

#include <adbc.h>
#include <arrow-adbc/adbc.h>

// This file defines a developer-friendly way to create an ADBC driver, currently intended
// for testing the R driver manager. It handles errors, option getting/setting, and
Expand Down
2 changes: 1 addition & 1 deletion c/driver/common/driver_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <gtest/gtest.h>
#include <cstring>

#include <adbc.h>
#include <arrow-adbc/adbc.h>
#include "driver_base.h"

// Self-contained version of the Handle
Expand Down
4 changes: 2 additions & 2 deletions c/driver/common/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
adbc_common_lib = library(
'adbc_driver_common',
sources: ['utils.c'],
include_directories: [root_dir],
include_directories: [include_dir],
dependencies: [nanoarrow_dep],
install: true,
)
Expand All @@ -28,7 +28,7 @@ if get_option('tests')
'adbc-driver-common-test',
'utils_test.cc',
'driver_test.cc',
include_directories: [root_dir],
include_directories: [include_dir],
link_with: [adbc_common_lib],
dependencies: [nanoarrow_dep, gtest_main_dep, gmock_dep],
)
Expand Down
2 changes: 1 addition & 1 deletion c/driver/common/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>

#include <adbc.h>
#include <arrow-adbc/adbc.h>

static size_t kErrorBufferSize = 1024;

Expand Down
2 changes: 1 addition & 1 deletion c/driver/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <stdint.h>
#include <string.h>

#include <adbc.h>
#include <arrow-adbc/adbc.h>
#include "nanoarrow/nanoarrow.h"

#ifdef __cplusplus
Expand Down
5 changes: 3 additions & 2 deletions c/driver/flightsql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ add_go_lib("${REPOSITORY_ROOT}/go/adbc/pkg/flightsql/"

foreach(LIB_TARGET ${ADBC_LIBRARIES})
target_include_directories(${LIB_TARGET} SYSTEM
INTERFACE ${REPOSITORY_ROOT} ${REPOSITORY_ROOT}/c/
INTERFACE ${REPOSITORY_ROOT}/c/
${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
endforeach()
Expand All @@ -62,7 +63,7 @@ if(ADBC_BUILD_TESTS)
${TEST_LINK_LIBS})
target_compile_features(adbc-driver-flightsql-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-flightsql-test SYSTEM
PRIVATE ${REPOSITORY_ROOT} ${REPOSITORY_ROOT}/c/
PRIVATE ${REPOSITORY_ROOT}/c/ ${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
adbc_configure_target(adbc-driver-flightsql-test)
Expand Down
2 changes: 1 addition & 1 deletion c/driver/flightsql/dremio_flightsql_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

#include <adbc.h>
#include <arrow-adbc/adbc.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest-matchers.h>
#include <gtest/gtest-param-test.h>
Expand Down
2 changes: 1 addition & 1 deletion c/driver/flightsql/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if get_option('tests')
'adbc-driver-flightsql-test',
'dremio_flightsql_test.cc',
'sqlite_flightsql_test.cc',
include_directories: [root_dir, driver_dir],
include_directories: [include_dir, c_dir, driver_dir],
link_with: [
adbc_common_lib,
adbc_driver_flightsql_lib
Expand Down
2 changes: 1 addition & 1 deletion c/driver/flightsql/sqlite_flightsql_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <random>
#include <thread>

#include <adbc.h>
#include <arrow-adbc/adbc.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest-matchers.h>
#include <gtest/gtest-param-test.h>
Expand Down
2 changes: 1 addition & 1 deletion c/driver/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ add_library(adbc_driver_framework STATIC base_driver.cc catalog.cc objects.cc)
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}" "${REPOSITORY_ROOT}/c/"
PRIVATE "${REPOSITORY_ROOT}/c/" "${REPOSITORY_ROOT}/c/include"
"${REPOSITORY_ROOT}/c/vendor")
target_link_libraries(adbc_driver_framework PUBLIC adbc_driver_common fmt::fmt)

Expand Down
2 changes: 1 addition & 1 deletion c/driver/framework/base_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <utility>
#include <vector>

#include <adbc.h>
#include <arrow-adbc/adbc.h>
#include <nanoarrow/nanoarrow.h>
#include <nanoarrow/nanoarrow.hpp>

Expand Down
2 changes: 1 addition & 1 deletion c/driver/framework/base_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <string_view>
#include <utility>

#include <adbc.h>
#include <arrow-adbc/adbc.h>

#include "driver/framework/base_driver.h"
#include "driver/framework/status.h"
Expand Down
2 changes: 1 addition & 1 deletion c/driver/framework/base_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <variant>
#include <vector>

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

Expand Down
2 changes: 1 addition & 1 deletion c/driver/framework/catalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <variant>
#include <vector>

#include <adbc.h>
#include <arrow-adbc/adbc.h>

#include "driver/framework/status.h"

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 @@ -22,7 +22,7 @@ adbc_framework_lib = library(
'catalog.cc',
'objects.cc',
],
include_directories: [root_dir],
include_directories: [include_dir, c_dir],
link_with: [adbc_common_lib],
dependencies: [nanoarrow_dep, fmt_dep],
install: true,
Expand Down
2 changes: 1 addition & 1 deletion c/driver/framework/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <variant>
#include <vector>

#include <adbc.h>
#include <arrow-adbc/adbc.h>
#include <fmt/core.h>

/// \file status.h
Expand Down
14 changes: 7 additions & 7 deletions c/driver/postgresql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ add_arrow_lib(adbc_driver_postgresql
foreach(LIB_TARGET ${ADBC_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ADBC_EXPORTING)
target_include_directories(${LIB_TARGET} SYSTEM
PRIVATE ${REPOSITORY_ROOT}
${REPOSITORY_ROOT}/c/
PRIVATE ${REPOSITORY_ROOT}/c/
${REPOSITORY_ROOT}/c/include/
${LIBPQ_INCLUDE_DIRS}
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
Expand Down Expand Up @@ -86,8 +86,8 @@ if(ADBC_BUILD_TESTS)
${TEST_LINK_LIBS})
target_compile_features(adbc-driver-postgresql-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-postgresql-test SYSTEM
PRIVATE ${REPOSITORY_ROOT}
${REPOSITORY_ROOT}/c/
PRIVATE ${REPOSITORY_ROOT}/c/
${REPOSITORY_ROOT}/c/include/
${LIBPQ_INCLUDE_DIRS}
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
Expand All @@ -108,8 +108,8 @@ if(ADBC_BUILD_TESTS)
${TEST_LINK_LIBS})
target_compile_features(adbc-driver-postgresql-copy-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-postgresql-copy-test SYSTEM
PRIVATE ${REPOSITORY_ROOT}
${REPOSITORY_ROOT}/c/
PRIVATE ${REPOSITORY_ROOT}/c/
${REPOSITORY_ROOT}/c/include/
${LIBPQ_INCLUDE_DIRS}
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
Expand All @@ -128,7 +128,7 @@ if(ADBC_BUILD_BENCHMARKS)
benchmark::benchmark)
# add_benchmark replaces _ with - when creating target
target_include_directories(postgresql-benchmark
PRIVATE ${REPOSITORY_ROOT} ${REPOSITORY_ROOT}/c/
PRIVATE ${REPOSITORY_ROOT}/c/ ${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
endif()
2 changes: 1 addition & 1 deletion c/driver/postgresql/connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <utility>
#include <vector>

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

#include "database.h"
Expand Down
2 changes: 1 addition & 1 deletion c/driver/postgresql/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <cstdint>
#include <memory>

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

#include "postgres_type.h"
Expand Down
2 changes: 1 addition & 1 deletion c/driver/postgresql/database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <utility>
#include <vector>

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

Expand Down
2 changes: 1 addition & 1 deletion c/driver/postgresql/database.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <memory>
#include <string>

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

#include "postgres_type.h"
Expand Down
Loading

0 comments on commit 8fb7c2f

Please sign in to comment.