diff --git a/textproc/R-cran-vroom/Makefile b/textproc/R-cran-vroom/Makefile index ceaf0044733b..3f232bdca4ef 100644 --- a/textproc/R-cran-vroom/Makefile +++ b/textproc/R-cran-vroom/Makefile @@ -1,57 +1,48 @@ PORTNAME= vroom DISTVERSION= 1.7.0 CATEGORIES= textproc DISTNAME= ${PORTNAME}_${DISTVERSION} MAINTAINER= eduardo@FreeBSD.org COMMENT= Read and Write Rectangular Text Data Quickly WWW= https://cran.r-project.org/package=vroom LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE CRAN_DEPENDS= R-cran-bit64>0:devel/R-cran-bit64 \ R-cran-cli>=3.2.0:devel/R-cran-cli \ R-cran-cpp11>=0.2.0:devel/R-cran-cpp11 \ R-cran-crayon>0:devel/R-cran-crayon \ R-cran-glue>0:devel/R-cran-glue \ R-cran-hms>0:devel/R-cran-hms \ R-cran-lifecycle>=1.0.3:devel/R-cran-lifecycle \ R-cran-progress>=1.2.3:devel/R-cran-progress \ R-cran-rlang>=1.1.0:devel/R-cran-rlang \ R-cran-tibble>=2.0.0:devel/R-cran-tibble \ R-cran-tidyselect>0:devel/R-cran-tidyselect \ R-cran-tzdb>=0.1.1:devel/R-cran-tzdb \ R-cran-vctrs>=0.2.0:devel/R-cran-vctrs \ R-cran-withr>0:devel/R-cran-withr BUILD_DEPENDS= ${CRAN_DEPENDS} RUN_DEPENDS= ${CRAN_DEPENDS} TEST_DEPENDS= R-cran-dplyr>0:math/R-cran-dplyr \ R-cran-forcats>0:math/R-cran-forcats \ R-cran-ggplot2>0:graphics/R-cran-ggplot2 \ R-cran-knitr>0:print/R-cran-knitr \ R-cran-testthat>0:devel/R-cran-testthat \ R-cran-tidyr>0:devel/R-cran-tidyr USES= compiler:c++11-lang cran:auto-plist,compiles shebangfix SHEBANG_FILES= inst/bench/*.sh pre-test: # Test depends not ported yet .for pkg in patchwork bench @${LOCALBASE}/bin/Rscript -e 'install.packages("${pkg}", \ repos = "https://cloud.r-project.org")' .endfor -# Tests are supposed to be run with unprivileged user. Running as root, tests fail. -# See also: https://github.com/tidyverse/vroom/issues/611 -do-test: - @${MKDIR} ${WRKDIR}/tmp - @${CHMOD} 777 ${WRKDIR}/tmp - @cd ${WRKSRC} && \ - ${SETENV} ${TEST_ENV} TMPDIR=${WRKDIR}/tmp _R_CHECK_FORCE_SUGGESTS_=false \ - su -m nobody -c "${LOCALBASE}/bin/R CMD check --no-manual --no-build-vignettes ." - .include diff --git a/textproc/R-cran-vroom/files/patch-fix-tests b/textproc/R-cran-vroom/files/patch-fix-tests new file mode 100644 index 000000000000..7724f2f7952b --- /dev/null +++ b/textproc/R-cran-vroom/files/patch-fix-tests @@ -0,0 +1,35 @@ +From cd07f44dc51ddcb0795ccda84c814c8af75668df Mon Sep 17 00:00:00 2001 +From: Jenny Bryan +Date: Thu, 29 Jan 2026 15:10:37 -0800 +Subject: [PATCH] Improve this test + +Closes #611 +--- + tests/testthat/test-connection.R | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git tests/testthat/test-connection.R tests/testthat/test-connection.R +index 22b23b37..86aecc4e 100644 +--- tests/testthat/test-connection.R ++++ tests/testthat/test-connection.R +@@ -116,12 +116,16 @@ test_that("vroom_fwf() doesn't leak a connection when opening fails (permission + Sys.chmod(tfile, mode = "000") # Remove all permissions + connections_before <- showConnections(all = TRUE) + +- # Not using snapshots, because not our error or warning +- expect_error( +- expect_warning( ++ # It is conceivable that this vroom_fwf() will succeed if, for example, tests ++ # are being run by root? ++ # See https://github.com/tidyverse/vroom/issues/611 ++ # Therefore, we don't state a hard expectation around error or warning. ++ # We just care that connections don't leak. ++ try( ++ suppressWarnings( + vroom_fwf(file(tfile), fwf_widths(c(6, 6, 6)), show_col_types = FALSE) + ), +- "cannot open" ++ silent = TRUE + ) + + connections_after <- showConnections(all = TRUE)