Skip to content

Commit

Permalink
Python / R include fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Jul 6, 2024
1 parent 7df3fb4 commit 377f130
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go/adbc/drivermgr/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package drivermgr
// #if !defined(ADBC_EXPORTING)
// #define ADBC_EXPORTING
// #endif
// #include "adbc.h"
// #include "arrow-adbc/adbc.h"
// #include <stdlib.h>
// #include <string.h>
//
Expand Down
7 changes: 4 additions & 3 deletions python/adbc_driver_manager/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
# ------------------------------------------------------------
# Resolve C++ Sources

incdir = source_root.joinpath("arrow-adbc")
target_dir = source_root / "adbc_driver_manager"
incdir = target_dir / "arrow-adbc"
incdir.mkdir(parents=True, exist_ok=True)
shutil.copy("c/include/arrow-adbc/adbc.h", incdir / "adbc.h")
shutil.copy(repo_root / "c/include/arrow-adbc/adbc.h", incdir / "adbc.h")

sources = [
"c/driver_manager/adbc_driver_manager.cc",
Expand All @@ -43,7 +44,7 @@
for source in sources:
target_filename = source.split("/")[-1]
source = repo_root.joinpath(source).resolve()
target = source_root.joinpath("adbc_driver_manager", target_filename).resolve()
target = (target_dir / target_filename).resolve()
if source.is_file():
# In-tree build/creating an sdist: copy from project root to local file
# so that setuptools isn't confused
Expand Down
1 change: 1 addition & 0 deletions r/adbcdrivermanager/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# implementation from the repo. We also run this from configure, so do nothing
# if we aren't sitting within the repo (e.g., installing a source package from a
# tarball).
dir.create("src/arrow-adbc", showWarnings=FALSE)
file.copy("../../c/include/arrow-adbc/adbc.h", "src/arrow-adbc/adbc.h")

files_to_vendor <- c(
Expand Down
4 changes: 2 additions & 2 deletions r/adbcflightsql/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ files_to_vendor_dst <- file.path("src/go/adbc", files_to_vendor)
# is not a problem for a user install, where this script
# should not even exist, but the below helps development
# on Windows.
is_adbc_h <- basename(files_to_vendor_src) == "arrow/adbc.h"
files_to_vendor_src[is_adbc_h] <- "../../c/include/arrow-adbc/adbc.h"
dir.create("src/arrow-adbc", showWarnings=FALSE)
file.copy("../../c/include/arrow-adbc/adbc.h", "src/arrow-adbc/adbc.h")

if (all(file.exists(files_to_vendor_src))) {
unlink("src/go/adbc", recursive = TRUE)
Expand Down
1 change: 1 addition & 0 deletions r/adbcpostgresql/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.

dir.create("src/arrow-adbc", showWarnings=FALSE)
file.copy("c/include/arrow-adbc/adbc.h", "src/arrow-adbc/adbc.h")

# If we are building within the repo, copy the latest adbc.h and driver source
Expand Down
4 changes: 2 additions & 2 deletions r/adbcsnowflake/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ files_to_vendor_dst <- file.path("src/go/adbc", files_to_vendor)
# is not a problem for a user install, where this script
# should not even exist, but the below helps development
# on Windows.
is_adbc_h <- basename(files_to_vendor_src) == "adbc.h"
files_to_vendor_src[is_adbc_h] <- "../../c/include/arrow-adbc/adbc.h"
dir.create("src/arrow-adbc", showWarnings=FALSE)
file.copy("../../c/include/arrow-adbc/adbc.h", "src/arrow-adbc/adbc.h")

if (all(file.exists(files_to_vendor_src))) {
unlink("src/go/adbc", recursive = TRUE)
Expand Down
1 change: 1 addition & 0 deletions r/adbcsqlite/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.

dir.create("src/arrow-adbc", showWarnings=FALSE)
file.copy("c/include/arrow-adbc/adbc.h", "src/arrow-adbc/adbc.h")

# If we are building within the repo, copy the latest adbc.h and driver source
Expand Down

0 comments on commit 377f130

Please sign in to comment.