From will.landau at lilly.com  Mon Sep 18 00:33:36 2017
From: will.landau at lilly.com (Will Landau)
Date: Sun, 17 Sep 2017 22:33:36 +0000
Subject: [Rd] FW: CRAN check errors: drake 4.1.0 on
 r-devel-linux-x86_64-debian-clang
Message-ID: <DM5P162MB0078BF75B046A29FE9DBB91CEA620@DM5P162MB0078.NAMP162.PROD.OUTLOOK.COM>

Hello,


The CRAN checks for the drake package (4.1.0) fail for r-devel-linux-x86_64-debian-clang. This happened right when crayon 1.3.4 was released, but I suspect the problem is not with crayon or drake, but with base R-devel. I cannot reproduce the error myself, but I have copied a minimal working example (MWE) below that should theoretically isolate the problem. 

`find_namespaced_functions()` is an internal function in drake that should work as long as base R is working, and all the failures appear to trace back there. Below the MWE is part of an existing email thread on this.

Will


# Walk through the body of f
# and find functions called with `::` or `:::`.
find_namespaced_functions <- function(f, found = character(0)){
  if (is.function(f)){
    return(find_namespaced_functions(body(f), found))
  } else if (is.call(f) && deparse(f[[1]]) %in% c("::", ":::")){
    found <- c(found, deparse(f))
  } else if (is.recursive(f)){
    v <- lapply(as.list(f), find_namespaced_functions, found)
    found <- unique(c(found, unlist(v)))
  }
  found
}

f <- function(x){
  digest::digest("Should be found.")
  digest:::digest("Should also be found.")
  digest("Should NOT be found.")
}

print(find_namespaced_functions(f))
# Expected output:
# [1] "digest::digest"  "digest:::digest"


From: Will Landau 
Sent: Saturday, September 16, 2017 11:16 PM
To: 'G?bor Cs?rdi' <csardi.gabor at gmail.com>; 'ligges at statistik.tu-dortmund.de' <ligges at statistik.tu-dortmund.de>
Subject: RE: [EXTERNAL] Re: CRAN submission crayon 1.3.4

Gabor and Uwe,


Thank you for promptly notifying me. I saw the https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-clang/drake-00check.html, and I could not reproduce it either. I tried:

? Ubuntu 17.04 with gcc (though drake has no complied code)
? a fresh copy of 64-bit R-devel r73293 (2017-09-16)
? the latest version of all required packages, including crayon 1.3.4 
? `R CMD check --as-cran drake_4.1.0.tar.gz` with a https://cran.r-project.org/src/contrib/drake_4.1.0.tar.gz

From looking at the https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-clang/drake-00check.html (which are exactly the ones Uwe mentioned), I strongly believe that the problem has nothing to do with Gabor?s `crayon` package. Rather, all the CRAN errors are closely related to a function in drake 4.1.0 called https://github.com/wlandau-lilly/drake/blob/master/R/dependencies.R#L73, which only depends on base R. I have attached a minimal working example that should theoretically isolate and reproduce the https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-clang/drake-00check.html.

Please let me know how you think we can proceed. I am actively maintaining `drake`, and I have a strong desire to fix all the problems and keep a clean production version on CRAN.

Will

-----Original Message-----
From: G?bor Cs?rdi [mailto:csardi.gabor at gmail.com] 
Sent: Saturday, September 16, 2017 3:43 PM
To: Will Landau <mailto:will.landau at lilly.com>
Subject: [EXTERNAL] Re: CRAN submission crayon 1.3.4

Hi,

I am sorry, the new crayon version, coming to CRAN, seems to break your package, drake. Hopefully CRAN can tell you on which platform and which R version this happens. I cannot reproduce this, unfortunately.

Let me know if you think this is my fault.

Gabor

On Sat, Sep 16, 2017 at 8:17 PM, Uwe Ligges <mailto:ligges at statistik.tu-dortmund.de> wrote:
> Thanks, we see in reverse dependencies:
>
> Package: drake
> Check: tests
> New result: ERROR
>???? Running ?testthat.R? [55s/138s]
>?? Running the tests in ?tests/testthat.R? failed.
>?? Complete output:
>???? > Sys.setenv("R_TESTS" = "")
>???? >
>???? > library(testthat)
>???? > library(drake)
>???? >
>???? > test_check("drake")
>???? 1. Failure: function_dependencies() works on :: and :::
> (@test-namespaced.R#19)
>???? sort(find_namespaced_functions(crazy)) not equal to `ns`.
>???? Lengths differ: 0 vs 7
>
>
>???? 2. Failure: function_dependencies() works on :: and :::
> (@test-namespaced.R#20)
>???? function_dependencies(crazy) not equal to list(functions = 
> sort(c(ns, "g", "runif", "sqrt")), variables = character(0)).
>???? Component "functions": Lengths (3, 10) differ (string compare on 
> first
> 3)
>???? Component "functions": 3 string mismatches
>
>
>???? 3. Failure: function_dependencies() works on :: and :::
> (@test-namespaced.R#25)
>???? `d` not equal to sort(c("digest::digest", "runif", "stats::rnorm", 
> "stats::rpois")).
>???? Lengths differ: 1 vs 4
>
>
>???? 4. Error: namespaced workflow works (@test-namespaced.R#40)
> --------------------
>???? key 'base::list' ('objects') not found
>???? 1: readd("base::list", character_only = TRUE) at
> testthat/test-namespaced.R:40
>???? 2: cache$get(target)
>???? 3: self$get_value(self$get_hash(key, namespace), use_cache)
>???? 4: exists0(hash, envir)
>???? 5: vlapply(name, exists, envir = envir, inherits = FALSE, 
> USE.NAMES =
> FALSE)
>???? 6: vapply(X, FUN, logical(1), ...)
>???? 7: self$get_hash(key, namespace)
>
>???? testthat results
> ================================================================
>???? OK: 358 SKIPPED: 0 FAILED: 4
>???? 1. Failure: function_dependencies() works on :: and :::
> (@test-namespaced.R#19)
>???? 2. Failure: function_dependencies() works on :: and :::
> (@test-namespaced.R#20)
>???? 3. Failure: function_dependencies() works on :: and :::
> (@test-namespaced.R#25)
>???? 4. Error: namespaced workflow works (@test-namespaced.R#40)
>
>???? Error: testthat unit tests failed
>???? Execution halted
>
>
> Is this expected and has the author been informed?
>
> Best,
> Uwe
>
>
>
>
>
>
>
> On 15.09.2017 20:15, CRAN submission wrote:
>>
>> [This was generated from CRAN.R-project.org/submit.html]
>>
>> The following package was uploaded to CRAN:
>> ===========================================
>>
>> Package Information:
>> Package: crayon
>> Version: 1.3.4
>> Title: Colored Terminal Output
>> Author(s): G?bor Cs?rdi [aut, cre], Brodie Gaslam [ctb]
>> Maintainer: G?bor Cs?rdi <mailto:csardi.gabor at gmail.com>
>> Suggests: mockery, rstudioapi, testthat, withr
>> Description: Colored terminal output on terminals that support 'ANSI'
>>??? color and highlight codes. It also works in 'Emacs' 'ESS'.
>>??? 'ANSI' color support is automatically detected. Colors and
>>??? highlighting can be combined and nested. New styles can also
>>??? be created easily. This package was inspired by the 'chalk'
>>??? 'JavaScript' project.
>> License: MIT + file LICENSE
>> Imports: grDevices, methods, utils
>>
>>
>> The maintainer confirms that he or she has read and agrees to the 
>> CRAN policies.
>>
>> Submitter's comment: Please publish this one instead of the previously
>>??? submitted 1.3.3 version, that one has a bug that
>>??? breaks colors on some platforms.
>>
>> =================================================
>>
>> Original content of DESCRIPTION file:
>>
>> Package: crayon
>> Title: Colored Terminal Output
>> Version: 1.3.4
>> Authors at R: c(
>>????? person("G?bor", "Cs?rdi", , "mailto:csardi.gabor at gmail.com",
>>????? role = c("aut", "cre")),
>>????? person(
>>????? "Brodie", "Gaslam", email="mailto:brodie.gaslam at yahoo.com",
>>????? role=c("ctb"))
>>????? )
>> Description: Colored terminal output on terminals that support 'ANSI'
>>????? color and highlight codes. It also works in 'Emacs' 'ESS'. 'ANSI'
>>????? color support is automatically detected. Colors and highlighting can
>>????? be combined and nested. New styles can also be created easily.
>>????? This package was inspired by the 'chalk' 'JavaScript' project.
>> License: MIT + file LICENSE
>> LazyData: true
>> URL: https://github.com/r-lib/crayon#readme
>> BugReports: https://github.com/r-lib/crayon/issues
>> Collate: 'ansi-256.r' 'combine.r' 'string.r' 'utils.r'
>>????????? 'crayon-package.r' 'disposable.r' 'has_ansi.r' 'has_color.r'
>>????????? 'styles.r' 'machinery.r' 'parts.r' 'print.r' 'style-var.r'
>>????????? 'show.r' 'string_operations.r'
>> Imports: grDevices, methods, utils
>> Suggests: mockery, rstudioapi, testthat, withr
>> RoxygenNote: 6.0.1.9000
>> Encoding: UTF-8
>> Roxygen: list(markdown = TRUE)
>> NeedsCompilation: no
>> Packaged: 2017-09-15 18:14:04 UTC; gaborcsardi
>> Author: G?bor Cs?rdi [aut, cre],
>>??? Brodie Gaslam [ctb]
>> Maintainer: G?bor Cs?rdi <mailto:csardi.gabor at gmail.com>
>>
>


[Rd] FW: CRAN check errors: drake 4.1.0 on r-devel-linux-x86_64-debian-clang
Will Landau