diff --git a/ci/scripts/r_build.sh b/ci/scripts/r_build.sh index a435b04317d..38b54e44340 100755 --- a/ci/scripts/r_build.sh +++ b/ci/scripts/r_build.sh @@ -26,7 +26,9 @@ build_dir=${2} pushd ${source_dir} -${R_BIN} CMD INSTALL ${INSTALL_ARGS} . +# build first so that any stray compiled files in r/src are ignored +${R_BIN} CMD build . +${R_BIN} CMD INSTALL ${INSTALL_ARGS} arrow*.tar.gz if [ "${BUILD_DOCS_R}" == "ON" ]; then ${R_BIN} -e "pkgdown::build_site(install = FALSE)" diff --git a/ci/scripts/r_sanitize.sh b/ci/scripts/r_sanitize.sh index 33b43611630..52a6ca7a2b7 100755 --- a/ci/scripts/r_sanitize.sh +++ b/ci/scripts/r_sanitize.sh @@ -35,7 +35,10 @@ export CMAKE_BUILD_TYPE=RelWithDebInfo ncores=$(${R_BIN} -s -e 'cat(parallel::detectCores())') echo "MAKEFLAGS=-j${ncores}" >> ${rhome}/etc/Renviron.site -${R_BIN} CMD INSTALL ${INSTALL_ARGS} . +# build first so that any stray compiled files in r/src are ignored +${R_BIN} CMD build . +${R_BIN} CMD INSTALL ${INSTALL_ARGS} arrow*.tar.gz + # But unset the env var so that it doesn't cause us to run extra dev tests unset ARROW_R_DEV diff --git a/ci/scripts/r_valgrind.sh b/ci/scripts/r_valgrind.sh index 772d8f44ed5..d88b38ca57d 100755 --- a/ci/scripts/r_valgrind.sh +++ b/ci/scripts/r_valgrind.sh @@ -24,8 +24,13 @@ source_dir=${1}/r export CMAKE_BUILD_TYPE=RelWithDebInfo -${R_BIN} CMD INSTALL ${INSTALL_ARGS} ${source_dir} -pushd ${source_dir}/tests +pushd ${source_dir} + +# build first so that any stray compiled files in r/src are ignored +${R_BIN} CMD build . +${R_BIN} CMD INSTALL ${INSTALL_ARGS} arrow*.tar.gz + +pushd tests # to generate suppression files run: # ${R_BIN} --vanilla -d "valgrind --tool=memcheck --leak-check=full --track-origins=yes --gen-suppressions=all --log-file=memcheck.log" -f testtthat.supp @@ -44,3 +49,5 @@ fi # https://github.com/microsoft/LightGBM/blob/fa6d356555f9ef888acf5f5e259dca958ca24f6d/.ci/test_r_package_valgrind.sh#L20-L85 popd + +popd diff --git a/docker-compose.yml b/docker-compose.yml index 834304dc7d4..5d2708e6250 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -176,7 +176,7 @@ volumes: name: python-wheel-windows-clcache ubuntu-ccache: name: ${ARCH}-ubuntu-${UBUNTU}-ccache - + services: ################################# C++ ####################################### @@ -1226,6 +1226,7 @@ services: r_prune_deps: ${R_PRUNE_DEPS} environment: <<: *ccache + ARROW_SOURCE_HOME: "/arrow" volumes: *ubuntu-volumes command: > /bin/bash -c " @@ -1287,6 +1288,7 @@ services: # AVX512 not supported by Valgrind (similar to ARROW-9851) some runners support AVX512 and some do not # so some build might pass without this setting, but we want to ensure that we stay to AVX2 regardless of runner. EXTRA_CMAKE_FLAGS: "-DARROW_RUNTIME_SIMD_LEVEL=AVX2" + ARROW_SOURCE_HOME: "/arrow" volumes: *ubuntu-volumes command: > /bin/bash -c "