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

[BUG] Some failures in vignettes when running tests #1167

Open
barracuda156 opened this issue Aug 20, 2024 · 6 comments
Open

[BUG] Some failures in vignettes when running tests #1167

barracuda156 opened this issue Aug 20, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@barracuda156
Copy link

Describe the bug
Some vignettes code fails to run.

To Reproduce
Run sudo port -v test R-golem on macOS.

Expected behavior
Ideally, checks should pass cleanly.

--->  Testing R-golem
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-golem/R-golem/work/golem" && /opt/local/bin/R CMD check ./golem_0.5.0.tar.gz --no-manual --no-build-vignettes 
* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-golem/R-golem/work/golem/golem.Rcheck’
* using R version 4.4.1 (2024-06-14)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-13 (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0
    GNU Fortran (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0
* running under: OS X Snow Leopard 10.6
* using session charset: UTF-8
* using options ‘--no-manual --no-build-vignettes’
* checking for file ‘golem/DESCRIPTION’ ... OK
* this is package ‘golem’ version ‘0.5.0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘golem’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘spelling.R’
  Running ‘testthat.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ...
  ‘a_start.Rmd’ using ‘UTF-8’... failed
  ‘b_dev.Rmd’ using ‘UTF-8’... failed
  ‘c_deploy.Rmd’ using ‘UTF-8’... failed
  ‘d_js.Rmd’ using ‘UTF-8’... OK
  ‘e_config.Rmd’ using ‘UTF-8’... OK
  ‘f_extending_golem.Rmd’ using ‘UTF-8’... failed
  ‘z_golem_cheatsheet.Rmd’ using ‘UTF-8’... OK
 ERROR
Errors in running code in vignettes:
when running code in ‘a_start.Rmd’
  ...
> knitr::opts_chunk$set(collapse = TRUE, comment = "#>", 
+     eval = FALSE)

> install.packages("golem")
Installing package into ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-golem/R-golem/work/golem/golem.Rcheck’
(as ‘lib’ is unspecified)

  When sourcing ‘a_start.R’:
Error: trying to use CRAN without setting a mirror
Execution halted
when running code in ‘b_dev.Rmd’
  ...
A new path.n =/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-golem/R-golem/work/.tmp/Rtmph1bczF/file8412dbe817d/vignettes/NAMESPACE was added to the directory. 
Updating vignettes documentation
ℹ Loading vignettes
ℹ Loading vignettes

> golem::add_module(name = "my_first_module")

  When sourcing ‘b_dev.R’:
Error: The golem-config.yml file doesn't exist.
Execution halted
when running code in ‘c_deploy.Rmd’
  ...
> run_app <- function(...) {
+     with_golem_options(app = shinyApp(ui = app_ui, server = app_server), 
+         golem_opts = list(...))
+ }

> run_app(this = "that")

  When sourcing ‘c_deploy.R’:
Error: could not find function "with_golem_options"
Execution halted
when running code in ‘f_extending_golem.Rmd’
  ...

> no_dev <- function(path, package_name, ...) {
+     fs::dir_delete("dev")
+ }

> create_golem("ici", project_hook = no_dev)

  When sourcing ‘f_extending_golem.R’:
Error: could not find function "create_golem"
Execution halted

* checking re-building of vignette outputs ... SKIPPED
* DONE

Status: 1 ERROR
See
  ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-golem/R-golem/work/golem/golem.Rcheck/00check.log’
for details.

Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-golem/R-golem/work/golem" && /opt/local/bin/R CMD check ./golem_0.5.0.tar.gz --no-manual --no-build-vignettes 
Exit code: 1
@barracuda156 barracuda156 added the bug Something isn't working label Aug 20, 2024
@ColinFay
Copy link
Member

Hey,

I'm not aware of the port -v test command, what does it do?

The tests pass on CRAN (a new version got uploaded yesterday), as they do locally & on Github Action.

Do you also have errors when running the check in a standard way?

@ColinFay
Copy link
Member

Hey,

Reading from the logs, you get :

> install.packages("golem")
Installing package into ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-golem/R-golem/work/golem/golem.Rcheck’
(as ‘lib’ is unspecified)

  When sourcing ‘a_start.R’:
Error: trying to use CRAN without setting a mirror
Execution halted

Meaning that you don't have a CRAN repo available to install the package. Can you try adding the repo to your RProfile?

@barracuda156
Copy link
Author

@ColinFay Sorry, why does it need CRAN when the package tarball is already downloaded? We do not really want anything to be fetched during the build or running tests. Also, tests should pass reproducibly for everyone, so even if a local tweak sorts this out for me personally, it does not really fix the issue.

@VincentGuyader
Copy link
Member

Hi
{golem}, like the vast majority of other R packages, depends, more or less directly, on other R packages to run. These dependencies need to be installed even before you can install (and test) {golem}. That's what your computer is trying to do. However, since you didn't specify the CRAN mirror address, the process fails immediately.

@ColinFay
Copy link
Member

This should be a local tweak because the error doesn't seem to be reproducible here.

  • this version of the package has been sent to CRAN and does pass the check for modern version of R.
  • It also works with Github Action. I'm not aware of what port performs under the hood.

I've also tried the following (on Mac, with latest version of R) and do not reproduce:

colinfay@Colins-MacBook-Pro /tmp % curl -O https://cran.r-project.org/src/contrib/golem_0.5.1.tar.gz 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1635k  100 1635k    0     0  5192k      0 --:--:-- --:--:-- --:--:-- 5193k
colinfay@Colins-MacBook-Pro /tmp % R CMD Check golem_0.5.1.tar.gz 
* using log directory ‘/private/tmp/golem.Rcheck’
* using R version 4.4.1 (2024-06-14)
* using platform: aarch64-apple-darwin20
* R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 12.2.0
* running under: macOS Sonoma 14.5
* using session charset: UTF-8
* checking for file ‘golem/DESCRIPTION’ ... OK
* this is package ‘golem’ version ‘0.5.1’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘golem’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘spelling.R’
  Running ‘testthat.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: OK

If you have a look at the Vignette that fails to build at https://github.com/ThinkR-open/golem/blob/master/vignettes/a_start.Rmd#L30, the Rmd is set to eval = FALSE at https://github.com/ThinkR-open/golem/blob/master/vignettes/a_start.Rmd#L22, so I'm not sure why your version tries to install the package.
Same for the second vignette : https://github.com/ThinkR-open/golem/blob/master/vignettes/b_dev.Rmd#L22

FWIW, your error seems to reproduce on oldrel of R on CRAN : https://www.r-project.org/nosvn/R.check/r-oldrel-macos-arm64/golem-00check.html, but that's for old releases of R only.

What's your current version of R ?

@barracuda156
Copy link
Author

@ColinFay R 4.4.1. The same error with gcc and clang; it should be reproducible, provided there is Apple hardware to test.
This is on macOS Sonoma / arm64:

golem.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants