Skip to content

Commit

Permalink
possibly fix sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jul 26, 2024
1 parent c162101 commit 17f1cc0
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 295 deletions.
27 changes: 0 additions & 27 deletions r/adbcpostgresql/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,3 @@ for (dir_name in rev(unique(dirname(dst)))) {
}

stopifnot(all(file.copy(src, dst)))

if (all(file.exists(files_to_vendor))) {
files_dst <- file.path("src", basename(files_to_vendor))

n_removed <- suppressWarnings(sum(file.remove(files_dst)))
if (n_removed > 0) {
cat(sprintf("Removed %d previously vendored files from src/\n", n_removed))
}

cat(
sprintf(
"Vendoring files from arrow-adbc to src/:\n%s\n",
paste("-", files_to_vendor, collapse = "\n")
)
)

if (!dir.exists("src/copy")) {
dir.create("src/copy")
}

if (all(file.copy(files_to_vendor, "src"))) {
file.rename(files_dst, file.path("src", source_files))
cat("All files successfully copied to src/\n")
} else {
stop("Failed to vendor all files")
}
}
75 changes: 12 additions & 63 deletions r/adbcsqlite/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,70 +15,19 @@
# specific language governing permissions and limitations
# under the License.

dir.create("src/arrow-adbc", showWarnings=FALSE)
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
# into src/
source_files <- c(
"c/driver/sqlite/sqlite.cc",
"c/driver/sqlite/statement_reader.c",
"c/driver/sqlite/statement_reader.h",
"c/driver/common/options.h",
"c/driver/common/utils.c",
"c/driver/common/utils.h",
"c/driver/framework/base_connection.h",
"c/driver/framework/base_database.h",
"c/driver/framework/base_driver.cc",
"c/driver/framework/base_driver.h",
"c/driver/framework/base_statement.h",
"c/driver/framework/catalog.h",
"c/driver/framework/objects.h",
"c/driver/framework/status.h",
"c/driver/framework/type_fwd.h",
"c/driver/framework/catalog.cc",
"c/driver/framework/objects.cc",
"c/vendor/fmt/include/fmt/args.h",
"c/vendor/fmt/include/fmt/base.h",
"c/vendor/fmt/include/fmt/chrono.h",
"c/vendor/fmt/include/fmt/color.h",
"c/vendor/fmt/include/fmt/compile.h",
"c/vendor/fmt/include/fmt/core.h",
"c/vendor/fmt/include/fmt/format-inl.h",
"c/vendor/fmt/include/fmt/format.h",
"c/vendor/fmt/include/fmt/os.h",
"c/vendor/fmt/include/fmt/ostream.h",
"c/vendor/fmt/include/fmt/printf.h",
"c/vendor/fmt/include/fmt/ranges.h",
"c/vendor/fmt/include/fmt/std.h",
"c/vendor/fmt/include/fmt/xchar.h",
"c/vendor/nanoarrow/nanoarrow.h",
"c/vendor/nanoarrow/nanoarrow.hpp",
"c/vendor/nanoarrow/nanoarrow.c",
"c/vendor/sqlite3/sqlite3.h",
"c/vendor/sqlite3/sqlite3.c"
)
files_to_vendor <- file.path("../..", source_files)
source_files <- list.files("../../c", "\\.(h|c|cc|hpp)$", recursive = TRUE)
source_files <- source_files[!grepl("_test\\.cc", source_files)]
source_files <- source_files[!grepl("^(build|out)/", source_files)]
source_files <- file.path("c", source_files)
src <- file.path("../..", source_files)
dst <- file.path("src", source_files)

if (all(file.exists(files_to_vendor))) {
files_dst <- file.path("src", basename(files_to_vendor))

n_removed <- suppressWarnings(sum(file.remove(files_dst)))
if (n_removed > 0) {
cat(sprintf("Removed %d previously vendored files from src/\n", n_removed))
}

cat(
sprintf(
"Vendoring files from arrow-adbc to src/:\n%s\n",
paste("-", files_to_vendor, collapse = "\n")
)
)

if (all(file.copy(files_to_vendor, "src"))) {
file.rename(files_dst, file.path("src", source_files))
cat("All files successfully copied to src/\n")
} else {
stop("Failed to vendor all files")
}
unlink("src/c", recursive = TRUE)
for (dir_name in rev(unique(dirname(dst)))) {
dir.create(dir_name, showWarnings = FALSE, recursive = TRUE)
}

stopifnot(all(file.copy(src, dst)))
11 changes: 0 additions & 11 deletions r/adbcsqlite/configure
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,3 @@ sed \
-e "s|@libs@|$PKG_LIBS|" \
-e "s|@objects@|$OBJECTS|" \
src/Makevars.in > src/Makevars


if [ -f "src/adbc.h" ]; then
echo "Found vendored ADBC"
exit 0
fi


echo "Vendored ADBC SQLite driver was not found."
echo "This source package was probably built incorrectly and it's probably not your fault"
exit 1
3 changes: 2 additions & 1 deletion r/adbcsqlite/src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*.o
*.so
*.dll
adbc.h
Makevars
sqlite3.c
sqlite3.h
c/
arrow-adbc/
19 changes: 0 additions & 19 deletions r/adbcsqlite/src/c/driver/common/.gitignore

This file was deleted.

27 changes: 0 additions & 27 deletions r/adbcsqlite/src/c/driver/framework/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions r/adbcsqlite/src/c/driver/sqlite/.gitignore

This file was deleted.

22 changes: 0 additions & 22 deletions r/adbcsqlite/src/c/vendor/fmt/.gitignore

This file was deleted.

30 changes: 0 additions & 30 deletions r/adbcsqlite/src/c/vendor/fmt/include/fmt/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions r/adbcsqlite/src/c/vendor/fmt/src/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions r/adbcsqlite/src/c/vendor/fmt/support/cmake/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions r/adbcsqlite/src/c/vendor/nanoarrow/.gitignore

This file was deleted.

18 changes: 0 additions & 18 deletions r/adbcsqlite/src/c/vendor/sqlite3/.gitignore

This file was deleted.

0 comments on commit 17f1cc0

Please sign in to comment.