Skip to content

Commit

Permalink
apacheGH-38756: [R] More debug output for r/configure and nixlibs.R (a…
Browse files Browse the repository at this point in the history
…pache#38819)

### Rationale for this change

It  hinders debug-ability for users if the failing log doesn't include all info by default.

### What changes are included in this PR?

Add debug output to test compile command in r/configure and always display output with regards to the binary download.

### Are these changes tested?
crossbow, locally
* Closes: apache#38756

Lead-authored-by: Jacob Wujciak-Jens <jacob@wujciak.de>
Co-authored-by: Dewey Dunnington <dewey@dunnington.ca>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
  • Loading branch information
assignUser and paleolimbot committed Nov 21, 2023
1 parent 3af33bc commit 490cd83
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 7 additions & 2 deletions r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ CXX17FLAGS=`"${R_HOME}"/bin/R CMD config CXX17FLAGS`
CXX17STD=`"${R_HOME}"/bin/R CMD config CXX17STD`
CPPFLAGS=`"${R_HOME}"/bin/R CMD config CPPFLAGS`
TEST_CMD="${CXX17} ${CPPFLAGS} ${PKG_CFLAGS} ${CXX17FLAGS} ${CXX17STD} -xc++ -"
echo "#include $PKG_TEST_HEADER" | ${TEST_CMD} >/dev/null 2>&1
TEST_ERROR=$(echo "#include $PKG_TEST_HEADER" | ${TEST_CMD} -o /dev/null 2>&1)

if [ $? -eq 0 ]; then
# Prepend PKG_DIRS to PKG_LIBS and write to Makevars
Expand All @@ -428,7 +428,12 @@ else
echo "------------------------- NOTE ---------------------------"
echo "There was an issue preparing the Arrow C++ libraries."
echo "See https://arrow.apache.org/docs/r/articles/install.html"
echo "---------------------------------------------------------"
echo "----------------------------------------------------------"
echo ""
echo "Test compile error: ${TEST_ERROR}"
echo "Failing compile command: ${TEST_CMD}"
echo "PKG_CFLAGS=$PKG_CFLAGS"
echo "PKG_LIBS=$PKG_LIBS"
PKG_LIBS=""
PKG_CFLAGS=""
exit 1
Expand Down
12 changes: 4 additions & 8 deletions r/tools/nixlibs.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,12 @@ download_binary <- function(lib) {
libfile <- paste0("arrow-", VERSION, ".zip")
binary_url <- paste0(arrow_repo, "bin/", lib, "/arrow-", VERSION, ".zip")
if (try_download(binary_url, libfile)) {
if (!quietly) {
lg("Successfully retrieved C++ binaries (%s)", lib)
}
lg("Successfully retrieved libarrow (%s)", lib)
} else {
if (!quietly) {
lg(
"Downloading libarrow binary failed for version %s (%s)\n at %s",
"Downloading libarrow failed for version %s (%s)\n at %s",
VERSION, lib, binary_url
)
}
libfile <- NULL
}
# Explicitly setting the env var to "false" will skip checksum validation
Expand Down Expand Up @@ -140,11 +136,11 @@ download_binary <- function(lib) {
checksum_ok <- system2(checksum_cmd, args = checksum_args)

if (checksum_ok != 0) {
cat("*** Checksum validation failed for libarrow binary: ", libfile, "\n")
lg("Checksum validation failed for libarrow: %s/%s", lib, libfile)
unlink(libfile)
libfile <- NULL
} else {
cat("*** Checksum validated successfully for libarrow binary: ", libfile, "\n")
lg("Checksum validated successfully for libarrow: %s/%s", lib, libfile)
}
}

Expand Down

0 comments on commit 490cd83

Please sign in to comment.