Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unanticipated behaviour change in rcmdcheck 1.3.0 #82

Closed
eddelbuettel opened this issue Sep 21, 2018 · 10 comments
Closed

Unanticipated behaviour change in rcmdcheck 1.3.0 #82

eddelbuettel opened this issue Sep 21, 2018 · 10 comments

Comments

@eddelbuettel
Copy link

I use rcmdcheck() quite a bit, mostly from a front-end script rcc.r in littler that has not changed much in years.

Below is a simple log showing that 1.3.0 changes behaviour over 1.2.1 and all prior versions. A simple check now wants to go off and do network access and what not.

The script does four simple things:

  1. install rcmdcheck 1.2.1 (via install.r, another littler script wrapping install.packages()
  2. run rcc.r on that same tarball, with success
  3. install rcmdcheck 1.3.0 which works but leads to
  4. run rcc.r again on the earlier tarball

and step four ends in tears.

/tmp> install.r rcmdcheck_1.2.1.tar.gz 
* installing *source* package ‘rcmdcheck’ ...
** package ‘rcmdcheck’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
 converting help for package ‘rcmdcheck’
   finding HTML links ... done
   compare_checks                          html  
   compare_to_cran                         html  
   cran_check_flavours                     html  
   cran_check_results                      html  
   data_frame                              html  
   myrep                                   html  
   parse_check                             html  
   parse_check_url                         html  
   rcmdcheck                               html  
** building package indices
** testing if installed package can be loaded
* DONE (rcmdcheck)
/tmp> rcc.r rcmdcheck_1.2.1.tar.gz 
Loading required package: methods
────────────────────────────────────────────────────────────────────────────────
─  using log directory ‘/tmp/file633084f4f7fc/rcmdcheck.Rcheck’
─  using R version 3.4.4 (2018-03-15)
─  using platform: x86_64-redhat-linux-gnu (64-bit)
─  using session charset: UTF-8
✔  checking for file ‘rcmdcheck/DESCRIPTION’
─  this is package ‘rcmdcheck’ version ‘1.2.1’
✔  checking package namespace information
✔  checking package dependencies
✔  checking if this is a source package
✔  checking if there is a namespace
✔  checking for executable files
✔  checking for hidden files and directories
✔  checking for portable file names
✔  checking for sufficient/correct file permissions
✔  checking whether package ‘rcmdcheck’ can be installed
✔  checking installed package size
✔  checking package directory
✔  checking DESCRIPTION meta-information
✔  checking top-level files
✔  checking for left-over files
✔  checking index information
✔  checking package subdirectories
✔  checking R files for non-ASCII characters
✔  checking R files for syntax errors
✔  checking whether the package can be loaded
✔  checking whether the package can be loaded with stated dependencies
✔  checking whether the package can be unloaded cleanly
✔  checking whether the namespace can be loaded with stated dependencies
✔  checking whether the namespace can be unloaded cleanly
✔  checking loading without being on the library search path
✔  checking dependencies in R code
✔  checking S3 generic/method consistency
✔  checking replacement functions
✔  checking foreign function calls
✔  checking R code for possible problems
✔  checking Rd files
✔  checking Rd metadata
✔  checking Rd cross-references
✔  checking for missing documentation entries
✔  checking for code/documentation mismatches
✔  checking Rd \usage sections
✔  checking Rd contents
✔  checking for unstated dependencies in examples
✔  checking examples
✔  checking for unstated dependencies in ‘tests’
─  checking tests ...  Running ‘testthat.R’
   OK
✔  checking PDF version of manual

  
── 0 errors ✔ | 0 warnings ✔ | 0 notes ✔
  
/tmp> install.r rcmdcheck_1.3.0.tar.gz 
* installing *source* package ‘rcmdcheck’ ...
** package ‘rcmdcheck’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
 converting help for package ‘rcmdcheck’
   finding HTML links ... done
   check_details                           html  
   compare_checks                          html  
   compare_to_cran                         html  
   cran_check_flavours                     html  
   cran_check_results                      html  
   data_frame                              html  
   myrep                                   html  
   parse_check                             html  
   parse_check_url                         html  
   print.rcmdcheck                         html  
   print.rcmdcheck_comparison              html  
   rcmdcheck                               html  
   rcmdcheck_process                       html  
   xopen.rcmdcheck                         html  
** building package indices
** testing if installed package can be loaded
* DONE (rcmdcheck)
/tmp> rcc.r rcmdcheck_1.2.1.tar.gz 
Loading required package: methods
Error in file(con, "rb") : 
 cannot open the connection to 'https://cloud.r-project.org/rcmdcheck_1.2.1.tar.gz'
In addition: Warning message:
In file(con, "rb") :
 cannot open URL 'https://cloud.r-project.org/rcmdcheck_1.2.1.tar.gz': HTTP status was '404 Not Found'
/tmp> 
@gaborcsardi
Copy link
Member

I can reproduce this. What the heck?

@gaborcsardi
Copy link
Member

gaborcsardi commented Sep 21, 2018

Of course it does not happen when called from R, so debugging is a bit cumbersome....

@eddelbuettel
Copy link
Author

It's default argument thing so we could say I was not careful enough. But I think you inserted two new ones near the front. This patch fixes it on my side:

1 file changed, 3 insertions(+), 1 deletion(-)
inst/examples/rcc.r | 4 +++-

modified   inst/examples/rcc.r
@@ -58,8 +58,10 @@ if (requireNamespace("rcmdcheck", quietly=TRUE) == FALSE)

 suppressMessages(library(rcmdcheck))

+rccwrapper <- function(pa, qu, ar, li, re) rcmdcheck(path=pa, quiet=qu, args=ar, libpath=li, repos=re)
+
 sapply(opt$PATH,                        # iterate over arguments
-       rcmdcheck,                       # calling 'rcmdcheck()' with arguments
+       rccwrapper,                      # calling 'rcmdcheck()' with arguments
        opt$quiet,                       # quiet argument, default false
        opt$args,                       # args arguments, possibly with --as-cran
        opt$libpath,                    # libpath argument

[back]

@gaborcsardi
Copy link
Member

Oh, yes, sorry about that, some extra arguments were added in the middle of the argument list. So you'll have to name the arguments, I am afraid.

@eddelbuettel
Copy link
Author

Yes -- I do that now as per the diff I just applied. So do we call it mine then. Shall we close?

@gaborcsardi
Copy link
Member

Yes, I knew it was not a good idea to add them in the middle, but there seemed to be not too much rcmdcheck usage out there. And of course the reverse dependency checks do not apply to littler.....

@gaborcsardi
Copy link
Member

Well, there is not much I can do now, I am afraid.

@eddelbuettel
Copy link
Author

Especially not to littler examples as these are not functions...

@gaborcsardi
Copy link
Member

It is kinda funny that it ended up making HTTP requests....

@eddelbuettel
Copy link
Author

eddelbuettel commented Sep 21, 2018

Yep. A "WTF" moment here too. Also created a subdir http:/ in my working dir ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants