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
3 changes: 2 additions & 1 deletion r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ do_autobrew () {
# Once libarrow is obtained, this function sets `PKG_LIBS`, `PKG_DIRS`, and `PKG_CFLAGS`
# either from pkg-config or by inferring things about the directory in $1
set_pkg_vars () {
LIB_DIR="$1/lib"
if [ "$PKG_CONFIG_AVAILABLE" = "true" ]; then
set_pkg_vars_with_pc
else
Expand All @@ -281,13 +280,15 @@ set_pkg_vars () {

# If we have pkg-config, it will tell us what libarrow needs
set_pkg_vars_with_pc () {
LIB_DIR="`${PKG_CONFIG} --variable=libdir --silence-errors ${PKG_CONFIG_NAME}`"
PKG_CFLAGS="`${PKG_CONFIG} --cflags --silence-errors ${PKG_CONFIG_NAME}` $PKG_CFLAGS"
PKG_LIBS=`${PKG_CONFIG} --libs-only-l --libs-only-other --silence-errors ${PKG_CONFIG_NAME}`
PKG_DIRS=`${PKG_CONFIG} --libs-only-L --silence-errors ${PKG_CONFIG_NAME}`
}

# If we don't have pkg-config, we can make some inferences
set_pkg_vars_without_pc () {
LIB_DIR="$1/lib"
PKG_CFLAGS="-I$1/include $PKG_CFLAGS"
if grep -q "_GLIBCXX_USE_CXX11_ABI=0" "${LIB_DIR}/pkgconfig/arrow.pc"; then
PKG_CFLAGS="${PKG_CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0"
Expand Down
11 changes: 11 additions & 0 deletions r/tools/check-versions.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ check_versions <- function(r_version, cpp_version) {
r_parsed <- package_version(r_version)
r_dev_version <- r_parsed[1, 4]
r_is_dev <- !is.na(r_dev_version) && r_dev_version > 100
r_is_patch <- !is.na(r_dev_version) && r_dev_version <= 100
cpp_is_dev <- grepl("SNAPSHOT$", cpp_version)
cpp_parsed <- package_version(sub("-SNAPSHOT$", "", cpp_version))

Expand All @@ -38,6 +39,16 @@ check_versions <- function(r_version, cpp_version) {
"*** > or retry with FORCE_BUNDLED_BUILD=true"
)
cat(paste0(msg, "\n", collapse = ""))
} else if (r_is_patch && as.character(r_parsed[1, 1:3]) == cpp_version) {
# Patch releases we do for CRAN feedback get an extra x.y.z.1 version.
# These should work with the x.y.z C++ library (which never has .1 added)
cat(
sprintf(
"*** > Using C++ library version %s with R package %s\n",
cpp_version,
r_version
)
)
} else if (r_version != cpp_version) {
cat(
sprintf(
Expand Down
5 changes: 5 additions & 0 deletions r/tools/test-check-versions.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ test_that("check_versions", {
"**** Not using: C++ library version (10.0.0) does not match R package (10.0.0.9000)",
fixed = TRUE
)
expect_output(
check_versions("10.0.0.3", "10.0.0"),
"*** > Using C++ library version 10.0.0 with R package 10.0.0.3",
fixed = TRUE
)
expect_output(
check_versions("10.0.0.9000", "11.0.0-SNAPSHOT"),
"*** > Packages are both on development versions (11.0.0-SNAPSHOT, 10.0.0.9000)\n",
Expand Down