r-lib / revdepcheck

R package reverse dependency checking
https://revdepcheck.r-lib.org
Other
102 stars 31 forks source link

Failed to check (38). #359

Closed rolfTurner closed 1 year ago

rolfTurner commented 1 year ago

I ran revdep_check() on a new version (1.0-8) of my package deldir and at the end (?) got the following error message:

Error in desc$get_field("BugReports", default = character()) : attempt to apply non-function

Being not (at all!) sure what I was doing, I ran revdep_report() and got the same error message.

A report seems to have been produced, regardless, and this report (in revdep/README.md) appears to indicate that the function failed to check 38 of the 43 packages on which deldir "reverse-depends". Has this anything to do with the error message? If not, what can I do about this failure to check? It would indeed be nice to get all reverse dependencies checked!

In respect of the two other files produced by reldep_report(), failures.md indicates one failure, ade4. But this package is listed in README.md as one of the packages that revdep_check() failed to check. The file problems.md says "Wow, no problems at all. :)". But it seems that I have got problems!

And I'm completely bewildered.

A tarball source of deldir version 1.0-8 is readily available if anyone is interested.

bbolker commented 1 year ago

I have no idea but might be willing to have a go.

rolfTurner commented 1 year ago

On Sat, 6 May 2023 20:55:10 +0000 Ben Bolker @.***> wrote:

I have no idea but might be willing to have a go.

Thanks Ben. If you have the time and the inclination to mess around with it, the 1.0-8 version of deldir is available from my web page:

https://www.stat.auckland.ac.nz/~rolf/

Scroll to near the bottom and click on "Deldir", then on "Source".

If you can investigate and enlighten me, I would be ever so humbly grateful.

cheers,

Rolf

-- Honorary Research Fellow Department of Statistics University of Auckland Stats. Dep't. (secretaries) phone: +64-9-373-7599 ext. 89622 Home phone: +64-9-480-4619

gaborcsardi commented 1 year ago

I can't reproduce this, I get a clean check (on arm macOS) for your package. Make sure you install the latest dependencies:

pak::pkg_install("r-lib/revdepcheck", upgrade = TRUE)
rolfTurner commented 1 year ago

On Sun, 07 May 2023 00:53:28 -0700 Gábor Csárdi @.***> wrote:

I can't reproduce this, I get a clean check (on arm macOS) for your package.

Well that sounds like good news; thanks!

Make sure you install the latest dependencies: ``` pak::pkg_install("r-lib/revdepcheck", upgrade = TRUE)

Psigh! So much to learn, and so few brains to learn stuff with. ☹️

I was completely unaware of the "pak" package ...

Did the upgrade, and a few changes resulted. Have not yet tried out the upgraded version of revdepcheck, because I would first like to understand this business of "on arm macOS". I can find no documentation relating to this. (My search skills are minimal.)

Where/how would I specify "arm"? Should I?

cheers,

Rolf

-- Honorary Research Fellow Department of Statistics University of Auckland Stats. Dep't. (secretaries) phone: +64-9-373-7599 ext. 89622 Home phone: +64-9-480-4619

bbolker commented 1 year ago

"on arm MacOS" is just @gaborcsardi telling you what platform he's working on, for completeness (a new-ish mac with an ARM https://en.wikipedia.org/wiki/ARM_architecture_family processor). I doubt it makes a difference in this case ... (This would be the same as the dreaded "M1 mac" tests by Ripley ... https://stat.ethz.ch/pipermail/r-sig-mac/2020-December/013828.html

bbolker commented 1 year ago

Hmm, I get a different weird result.

> revdep_check("deldir", num_workers = 28)
── INIT ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Computing revdeps ──
── INSTALL ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 2 versions ──
Installing CRAN version of deldir
Installing DEV version of deldir
── CHECK ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 44 packages ──
✔ cccd 1.6                               ── E: 0     | W: 0     | N: 0          
[1/44] 00:03:31 | ETA:  3h | (28) ade4 [I], adehabitatHR [I], animalEKF 

[...Error: No root directory found in /home/bolker/Documents/R/pkgs or its parent directories. Root criterion: contains a file "DESCRIPTION" with contents matching "^Package: "

Checking that I'm up to date:

> remotes::install_github("r-lib/revdepcheck")
Skipping install of 'revdepcheck' from a github remote, the SHA1 (54609a57) has not changed since last install.
  Use `force = TRUE` to force installation
> sessionInfo()
R Under development (unstable) (2023-05-01 r84362)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Pop!_OS 22.04 LTS

Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8    
 [5] LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8   
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Toronto
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] revdepcheck_1.0.0.9001

loaded via a namespace (and not attached):
 [1] rappdirs_0.3.3       utf8_1.2.3           RSQLite_2.3.1       
 [4] hms_1.1.3            digest_0.6.31        magrittr_2.0.3      
 [7] fastmap_1.1.1        blob_1.2.4           jsonlite_1.8.4      
[10] rprojroot_2.0.3      processx_3.8.1       parsedate_1.3.1     
[13] progress_1.2.2       sessioninfo_1.2.2    pkgbuild_1.4.0      
[16] whoami_1.3.0         DBI_1.1.3            rcmdcheck_1.4.0     
[19] rematch2_2.1.2       ps_1.7.5             httr_1.4.5          
[22] fansi_1.0.4          cli_3.6.1            rlang_1.1.1         
[25] crayon_1.5.2         cranlike_1.0.2       bit64_4.0.5         
[28] yaml_2.3.7           remotes_2.4.2        base64enc_0.1-3     
[31] withr_2.5.0          cachem_1.0.8         crancache_0.0.0.9001
[34] tools_4.4.0          gargle_1.4.0         debugme_1.1.0       
[37] memoise_2.0.1        gmailr_1.0.1         curl_5.0.0          
[40] assertthat_0.2.1     vctrs_0.6.2          R6_2.5.1            
[43] lifecycle_1.0.3      fs_1.6.2             bit_4.0.5           
[46] xopen_1.0.0          clisymbols_1.2.0     pkgconfig_2.0.3     
[49] desc_1.4.2           callr_3.7.3          pillar_1.9.0        
[52] glue_1.6.2           xfun_0.39            tibble_3.2.1        
[55] knitr_1.42           compiler_4.4.0       prettyunits_1.1.1   
gaborcsardi commented 1 year ago

remotes does not update all dependencies to their latest versions, though.

bbolker commented 1 year ago

OK, will try again after update.packages()

update: same again. Suggestions for how to debug this? (deldir/DESCRIPTION itself is obviously there, otherwise the check couldn't have gotten started ... ??)

revdep_check("deldir", num_workers = 28)
── CHECK ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 43 packages ──
✔ BSBT 1.2.1                             ── E: 0     | W: 0     | N: 0          
[1/43] 00:02:57 | ETA:  2h | (28) cholera [I], DatabionicSwarm [I], GWSDA...Error: No root directory found in /home/bolker/Documents/R/pkgs or its parent directories. Root criterion: contains a file "DESCRIPTION" with contents matching "^Package: "
rolfTurner commented 1 year ago

I got revdep_check() to run OK. No error message this time. However I am still seeing "## Failed to check" in README.md; 39 packages this time r.t. 38. Things are getting worse? Also failures.md still seems to indicate a problem with ade4. And README.md stlll seems to indicate that ade4 was not checked. (???)

I have attached (I think!) README.md and failures.md for those younger and wiser than I to have a look at. Thanks.

README.md failures.md

gaborcsardi commented 1 year ago

It seems that already the deldir installations failed? You log also has things like

Error in download.file(url, destfile, method, mode = "wb", ...) :
  cannot open URL 'https://cloud.r-project.org/src/contrib/Deriv_4.1.3.tar.gz'
In addition: Warning messages:
1: In download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://cloud.r-project.org/src/contrib/Deriv_4.1.3.tar.gz': status was 'Couldn't resolve host name'
2: In download.file(url, destfile, method, mode = "wb", ...) :

Were you online?

rolfTurner commented 1 year ago

Where can I find the log that you refer to?

Also please note that the first error message refers to the Deriv package. This package is not one of the packages on which deldir reverse depends.

I'm getting confuseder and confuseder! :-)

In respect of "Were you online?" Yes.

gaborcsardi commented 1 year ago

Where can I find the log that you refer to?

In the failures.md you uploaded.

Also please note that the first error message refers to the Deriv package. This package is not one of the packages on which deldir reverse depends.

Sure, but one of your reverse dependencies depends on it.

Can you include the full output of

revdepcheck::revdep_reset()
revdepcheck::revdep_check()

? Thanks.

rolfTurner commented 1 year ago

On Mon, 08 May 2023 02:11:38 -0700 Gábor Csárdi @.***> wrote:

Where can I find the log that you refer to?

In the failures.md you uploaded.

Ah! I had to scroll down a bit, and didn't realise that. Duhh. Sorry.

Also please note that the first error message refers to the Deriv package. This package is not one of the packages on which deldir reverse depends.

Sure, but one of your reverse dependencies depends on it.

Again, duhh. Never thought of that. ☹️

Can you include the full output of

revdepcheck::revdep_reset()
revdepcheck::revdep_check()

How? I've fiddled about a bit, and neither sink() nor capture.output() seem to work. The first few lines of screen output from revdep_check() are sent to the output file:

── INIT ───────────────────────────────────────────────────────────── Computing revdeps ── ── INSTALL ───────────────────────────────────────────────────────────────── 2 versions ── Installing CRAN version of deldir Installing DEV version of deldir ── CHECK ────────────────────────────────────────────────────────────────── 43 packages ──

But after that nothing appears. The screen shows something like

[0/43] 00:03:40 | ETA: ?s | (4) ade4 [I], adehabitatHR [1], animalEKF [...

with the time indicator 00:03:40 constantly incrementing, but this does not appear in the output file, nor can I lay hold of it with copy and paste.

I'll pass on what I can gather up.

rolfTurner commented 1 year ago

I ran revdep_check() again, at Gábor's behest, and in accordance with his instructions, to the best of my abilities. I have attached the resulting output to the extent that I could collect it.

The screen output said;

OK: 43 BROKEN: 0

which sounds good, but failures.md (also attached) indicates that there are problems with spatialfusion and visualFields. The file problems.md says that there are no problems at all. The file README.md again says "Failed to check (38)". I have no idea what to make of all this; I am out of my depth.

output.txt failures.md problems.md README.md

gaborcsardi commented 1 year ago

What is the output of

revdepcheck::revdep_summary()

and

revdepcheck::revdep_details(, "ade4")

?

gaborcsardi commented 1 year ago

I think the issue is that you cannot install the reverse dependencies, because some system libraries are missing.

rolfTurner commented 1 year ago

Presumably this means that the libraries are missing on CRAN, rather than on my machine? So there would be nothing I could do, right?

As an experiment, I tried

install.packages("visualFields") 

on my machine. This ran without errors or problems. (I had the 1.0-8 version of deldir installed.) So the mystery deepens.

I then tried

install.packages("spatialfusion")

This bombed, both with versions 1.0-7 and 1,0-8 installed. Howevert the error message seemed to have nothing to do with missing libraries (nor with the error message that appeared in the failures.md file). The error message was:

Error: object ‘rgrf’ is not exported by 'namespace:spam'
Execution halted
ERROR: lazy loading failed for package ‘spatialfusion’
* removing ‘/home/rolf/Rlib/spatialfusion’

I think that it's time for both me and Gábor to stop wasting time on this issue.

gaborcsardi commented 1 year ago

Presumably this means that the libraries are missing on CRAN, rather than on my machine? So there would be nothing I could do, right?

No, CRAN has these, but your machine does not. You could install them, though, see below.

This ran without errors or problems

Well, install.packages() never fails or errors, even if an installation fails, so that does not really mean much. Can you also load the package?

Also, you need the suggested dependencies to run R CMD check on a package, so you need

install.packages("visualFields", dependencies = TRUE)
library(visualFields)

which will probably fail.

However the error message seemed to have nothing to do with missing libraries

Probably a dependency failed to installed already, but install.packages() does not stop or error if a package failed to install, so that is easy to miss.

These are the Ubuntu 22.04 packages that you need for your reverse dependencies to install:

revdeps <- unique(pkgcache::meta_cache_revdeps("deldir", recursive=FALSE, dependencies=TRUE)$package)
plan <- sysreqs_install_plan(revdeps, config = list(dependencies = TRUE, sysreqs_platform = "ubuntu-22.04"))
ubuntu_packages <- unique(sort(unlist(plan$packages$system_packages )))
cat(paste0(c("apt-get install", ubuntu_packages), collapse = " "))
apt-get install cmake default-jdk gdal-bin git gsfonts imagemagick jags libcairo2-dev libcurl4-openssl-dev libfftw3-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgdal-dev libgeos-dev libgit2-dev libgl1-mesa-dev libglpk-dev libglu1-mesa-dev libgmp3-dev libgsl0-dev libharfbuzz-dev libicu-dev libjpeg-dev libmagick++-dev libmpfr-dev libnetcdf-dev libnode-dev libpng-dev libpoppler-cpp-dev libproj-dev libsqlite3-dev libssl-dev libtiff-dev libudunits2-dev libxml2-dev make pandoc python3 tcl tk tk-dev tk-table zlib1g-dev

So if you run this apt-get successfully, then I am pretty confident that revdepcheck will give you a better result.

rolfTurner commented 1 year ago

Tried

library(visualFields)

and it ran without error. (Mind you I did not attempt to do anything with that package!)

Then I did the recommended apt-get install on that list of Ubuntu packages that Gábor provided. Much to my amazement (things usually go to hell in a handcart for me, in situations like this) everything seemed to run OK.

I then tried

install.packages("spatialfusion")

again. Got exactly the same error as before.

Even if that had worked, there would remain the question of why README.md is telling me that revdep_check() failed to check 38 packages.

I thank Gábor for his patience and forebearance, but I really think that trying to debug my problem remotely is an exercise in futility. My Sadim touch seems to be fully operational!

gaborcsardi commented 1 year ago

Got exactly the same error as before

It is probably because of a broken installation of a dependency of that package. install.packages() does not reinstall dependencies, so it is not going to fix that.

Even if that had worked, there would remain the question of why README.md is telling me that revdep_check() failed to check 38 packages.

Because you did not have the required system packages to run the checks for them. If you ran the apt-get command successfully, then now you have them, so this should now work (better):

revdepcheck::revdep_reset()
revdepcheck::revdep_check()
rolfTurner commented 1 year ago

I thought that I had commented several days ago (11 May) but I guess that I must have messed up somehow. Be that as it may, here is the comment that I thought I had made:

I ran revdep_check() yet one more time. No error messages on the R console. The file failures.md now indicates problems with spsurvey, streamDepletr, and subniche. No problems indicated for spatialfusion nor for visualFields, which had been the culprits on previous occasions.

The file README.md still indicates a failure to check a number of packages (39 rather than 38). OTOH the file cran.md, which I had previously neglected to look at, says

We checked 43 reverse dependencies (4 from CRAN + 39 from Bioconductor),
comparing R CMD check results across CRAN and dev versions of this package.

 * We saw 0 new problems 
 * We failed to check 0 packages

As usual I am mystified.

gaborcsardi commented 1 year ago

Maybe some of the .md files are leftovers from previous runs. I am not very familiar with them as I don't use them personally.

I would run

revdep_summary()

to list the problematic packages, and then

revdep_details(, "<packagename>")

to see what the problem is with them.

rolfTurner commented 1 year ago

I don't think the *.md files are "leftovers". I moved the directory "revdep" to "revdep.save" before invoking revdep_check() , so that the current revdep directory is completely "fresh".

I ran revdep_summary() as instructed. The result seemed to agree, essentially, with README.md. The results from revdep_summary() may be seen in the attached file summary.txt summary.txt

The results from revdep_details() were bewildering. (Seems to be the story of my life.) Any of the packages with "E" in the left hand margin (in summary.txt) --- e.g. ade4, adehabitatHR, ..., terra, Umatrix, visualFields --- yielded results to the effect (e.g.):

══ Reverse dependency check ════════════════...═════════════════ ade4  ══

Status: 

Error in if (nrow(rows) == 0) { : argument is of length zero

Packages with a tick mark in the left hand margin, which I figured would be alright, produced varying results. E.g.

══ Reverse dependency check ═════════════════...══════════ PERMANOVA 0.2.0 ══

Status: OK

── Before ────────────────────...───────────────────
0 errors ✔ | 0 warnings ✔ | 0 notes ✔

── After ────────────────────────...───────────────
0 errors ✔ | 0 warnings ✔ | 0 notes ✔

I.e. everything looks OK. But (e.g.) ...

══ Reverse dependency check ═════════════════════...════════════ phonR 1.0-7 ══

Status: OK

── Still failing

✖ checking Rd cross-references ... NOTE

── Before ───────────────────...─────────────
❯ checking Rd cross-references ... NOTE
  Package unavailable to check Rd xrefs: ‘vowels’

0 errors ✔ | 0 warnings ✔ | 1 note ✖

── After ──────────────────────...──────────────────
❯ checking Rd cross-references ... NOTE
  Package unavailable to check Rd xrefs: ‘vowels’

0 errors ✔ | 0 warnings ✔ | 1 note ✖

Note that this item says both "OK" and "Still failing". (???!!!)

None of this makes any sense to me at all.

gaborcsardi commented 1 year ago

Note that this item says both "OK" and "Still failing". (???!!!)

Yes, if you have the same error both "before" and "after", that's OK. That's the point of checking with both versions of your package.

gaborcsardi commented 1 year ago

But I don't understand why still all packages are failing. :(

rolfTurner commented 1 year ago

Well, if Gábor doesn't understand, what hope is there for me?

Time to close this issue.

bbolker commented 1 year ago

I will just say for the record that when checking lme4 (hundreds of dependencies) I routinely get a handful of mysterious failures like the ones you report. I re-run these and they're usually OK.