r-lib / pkgbuild

Find tools needed to build R packages
https://pkgbuild.r-lib.org
Other
65 stars 33 forks source link

Tests fail in test-build.r:180:2 on R 4.2.3 #162

Closed christophfink closed 1 year ago

christophfink commented 1 year ago

Hi!

I’m having a hard time making the unit tests pass. This is on Archlinux, currently running R-4.2.3 and the following versions of pkgbuild’s dependencies:

callr-3.7.3 cli-3.6.0 covr-3.6.1 cpp11-0.4.3 crayon-1.5.2 desc-1.4.2 mockery-0.4.3 prettyunits-1.1.1 processx-3.8.0 r6-2.5.1 rcpp-1.0.10 rmarkdown-2.20 rprojroot-2.0.3 testthat-3.1.7 withr-2.5.0

I run the tests using R_LIB="${build_dir}" R CMD check --no-manual --as-cran "${src_dir}", and the test fails on line 180 of test-build.r. Please see the detailed log below

I’m not sure whether I made some mistake, or the expected error message/warning has changed in recent versions of R - could you advise me on how to proceed to disect the error?

00check.log

gaborcsardi commented 1 year ago

That's

  expect_silent(
    build(file.path(src, "testDummy"), dest_path = dest, quiet = TRUE)
  )

Can you run the test without the expect_silent(), so you see what the output is?

christophfink commented 1 year ago

That’s the odd thing: nothing, it seems (see attached log). Do I have to enable verbose logging in some way I have not figured out?

Last 13 lines of output:
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (11)
  • is_windows() && !is.null(scan_path_for_rtools()) is not TRUE (1)
  • is_windows() is not TRUE (1)

  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-build.r:181:5'): warnings can be turned into errors ────────────
  Error in `build(file.path(src, "testDummy"), dest_path = dest, quiet = TRUE)`: converted from `R CMD build` warning.
  Backtrace:
      ▆
   1. └─pkgbuild::build(...) at test-build.r:181:4

  [ FAIL 1 | WARN 0 | SKIP 13 | PASS 117 ]
  Error: Test failures
  Execution halted
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE
Status: 1 ERROR, 1 WARNING

00check.log


How would I best try to build the testDummy manually to see whether it would build at all?


EDIT: just to clarify, I only commented out the expect_silent( line plus its closing parenthesis, line numbers are the same as in the original.

christophfink commented 1 year ago

I think I have a clue:

   Warning: invalid uid value replaced by that for user 'nobody'
   Warning: invalid gid value replaced by that for user 'nobody'
christophfink commented 1 year ago

Adding R_BUILD_TAR=tar to the environment makes the tests pass, the following runs as expected:

R_BUILD_TAR=tar R_LIB="${build_dir}" R CMD check --no-manual --as-cran "${src_dir}"

Thanks for your help!

christophfink commented 1 year ago

(still adding some context for future readers of this issue: https://stackoverflow.com/a/59001349 )