From d2db22e0d296965b7c30686e8a4d208b0171c2fc Mon Sep 17 00:00:00 2001 From: Josiah Parry Date: Sun, 17 Nov 2024 10:22:15 -0800 Subject: [PATCH] set CRAN_FLAGS only when vendored packages are used --- inst/templates/configure | 2 +- inst/templates/configure.win | 4 ++-- tests/testthat/_snaps/use_extendr.md | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inst/templates/configure b/inst/templates/configure index 822ea414..5c1355a1 100644 --- a/inst/templates/configure +++ b/inst/templates/configure @@ -3,7 +3,7 @@ "${R_HOME}/bin/Rscript" tools/msrv.R # Set CRAN_FLAGS based on the NOT_CRAN value -if [ "${NOT_CRAN}" != "true" ]; then +if [ "${NOT_CRAN}" != "true" ] && [ -f ./src/rust/vendor.tar.xz ]; then export CRAN_FLAGS="-j 2 --offline" else export CRAN_FLAGS="" diff --git a/inst/templates/configure.win b/inst/templates/configure.win index 1156e442..f6d1efbd 100644 --- a/inst/templates/configure.win +++ b/inst/templates/configure.win @@ -2,13 +2,13 @@ "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" tools/msrv.R # Set CRAN_FLAGS based on the NOT_CRAN value -if [ "${NOT_CRAN}" != "true" ]; then +if [ "${NOT_CRAN}" != "true" ] && [ -f ./src/rust/vendor.tar.xz ]; then export CRAN_FLAGS="-j 2 --offline" else export CRAN_FLAGS="" fi -# delete Makevars if it is present +# delete Makevars.win if it is present [ -f src/Makevars.win ] && rm src/Makevars.win # Substitute @CRAN_FLAGS@ in Makevars.in with the actual value of $CRAN_FLAGS diff --git a/tests/testthat/_snaps/use_extendr.md b/tests/testthat/_snaps/use_extendr.md index 91d6267e..6d53afcf 100644 --- a/tests/testthat/_snaps/use_extendr.md +++ b/tests/testthat/_snaps/use_extendr.md @@ -27,7 +27,7 @@ "${R_HOME}/bin/Rscript" tools/msrv.R # Set CRAN_FLAGS based on the NOT_CRAN value - if [ "${NOT_CRAN}" != "true" ]; then + if [ "${NOT_CRAN}" != "true" ] && [ -f ./src/rust/vendor.tar.xz ]; then export CRAN_FLAGS="-j 2 --offline" else export CRAN_FLAGS="" @@ -48,13 +48,13 @@ "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" tools/msrv.R # Set CRAN_FLAGS based on the NOT_CRAN value - if [ "${NOT_CRAN}" != "true" ]; then + if [ "${NOT_CRAN}" != "true" ] && [ -f ./src/rust/vendor.tar.xz ]; then export CRAN_FLAGS="-j 2 --offline" else export CRAN_FLAGS="" fi - # delete Makevars if it is present + # delete Makevars.win if it is present [ -f src/Makevars.win ] && rm src/Makevars.win # Substitute @CRAN_FLAGS@ in Makevars.in with the actual value of $CRAN_FLAGS