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

tibble 3.2.1.9017: some errors in running vignette code #1575

Open
barracuda156 opened this issue Apr 17, 2024 · 17 comments
Open

tibble 3.2.1.9017: some errors in running vignette code #1575

barracuda156 opened this issue Apr 17, 2024 · 17 comments
Labels
help wanted ❤️ we'd love your help!

Comments

@barracuda156
Copy link

Tests pass fine, but I get some errors in running vignette code:

--->  Testing R-tibble
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tibble/R-tibble/work/tibble-3.2.1.9017" && /opt/local/bin/R CMD check ./tibble_3.2.1.9017.tar.gz --no-manual --no-build-vignettes 
* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tibble/R-tibble/work/tibble-3.2.1.9017/tibble.Rcheck’
* using R version 4.3.3 (2024-02-29)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-13 (MacPorts gcc13 13.2.0_4+stdlib_flag) 13.2.0
    GNU Fortran (MacPorts gcc12 12.3.0_3+stdlib_flag) 12.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 ‘tibble/DESCRIPTION’ ... OK
* this is package ‘tibble’ version ‘3.2.1.9017’
* 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 ‘tibble’ can be installed ... OK
* used C compiler: ‘gcc-mp-13 (MacPorts gcc13 13.2.0_4+stdlib_flag) 13.2.0’
* used SDK: ‘NA’‘NA’‘NA’‘NA’‘NA’‘NA’
* checking installed package size ... OK
* checking package 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 R 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 startup messages can be suppressed ... 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 line endings in C/C++/Fortran sources/headers ... OK
* checking use of PKG_*FLAGS in Makefiles ... OK
* checking compiled code ... OK
* checking files in ‘vignettes’ ... WARNING
Files in the 'vignettes' directory but no files in 'inst/doc':
  ‘digits.Rmd’ ‘extending.Rmd’ ‘formats.Rmd’ ‘formats.mmd’
  ‘invariants.Rmd’ ‘numbers.Rmd’ ‘r4ds.mmd’ ‘tibble.Rmd’ ‘timing.rds’
  ‘types.Rmd’ ‘wip/alignment.png’ ‘wip/subassign.Rmd’ ‘wip/subset.Rmd’
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘testthat.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... WARNING
Directory 'inst/doc' does not exist.
Package vignettes without corresponding single PDF/HTML:
  ‘digits.Rmd’
  ‘extending.Rmd’
  ‘formats.Rmd’
  ‘invariants.Rmd’
  ‘numbers.Rmd’
  ‘tibble.Rmd’
  ‘types.Rmd’
* checking running R code from vignettes ...
  ‘digits.Rmd’ using ‘UTF-8’... OK
  ‘extending.Rmd’ using ‘UTF-8’... OK
  ‘formats.Rmd’ using ‘UTF-8’... failed
  ‘invariants.Rmd’ using ‘UTF-8’... failed
  ‘numbers.Rmd’ using ‘UTF-8’... failed
  ‘tibble.Rmd’ using ‘UTF-8’... failed
  ‘types.Rmd’ using ‘UTF-8’... OK
 ERROR
Errors in running code in vignettes:
when running code in ‘formats.Rmd’
  ...
+     geom_line()

> text <- paste(readLines(here::here("vignettes/r4ds.mmd")), 
+     collapse = "\n")
Warning in file(con, "r") :
  cannot open file '/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tibble/R-tibble/work/.tmp/RtmpWFaepO/file9e5d770ffd96/vignettes/vignettes/r4ds.mmd': No such file or directory

  When sourcing ‘formats.R’:
Error: cannot open the connection
Execution halted
when running code in ‘invariants.Rmd’
  ...
[1]  1 NA  3 NA

> df[[1:2]]
[1] NA

> df[[c("n", "c")]]

  When sourcing ‘invariants.R’:
Error: subscript out of bounds
Execution halted
when running code in ‘numbers.Rmd’
  ...
> x <- num(c(1, 2, 4), notation = "eng")

> var(x)
[1] 2.333333

> median(x)

  When sourcing ‘numbers.R’:
Error: `median.pillar_num()` not implemented.
Execution halted
when running code in ‘tibble.Rmd’
  ...
3     3     1

> tibble(a = 1:3, c = 1:2)

  When sourcing ‘tibble.R’:
Error: Tibble columns must have compatible sizes.
• Size 3: Existing data.
• Size 2: Column `c`.
ℹ Only values of size one are recycled.
Execution halted

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

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

Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tibble/R-tibble/work/tibble-3.2.1.9017" && /opt/local/bin/R CMD check ./tibble_3.2.1.9017.tar.gz --no-manual --no-build-vignettes 
Exit code: 1

Could this be addressed? tibble is a foundational package, it would be great to have it working without issues, however minor.

@krlmlr
Copy link
Member

krlmlr commented Apr 29, 2024

Thanks. Does vignettes/r4ds.mmd exist?

The errors in the vignette code are meant to be caught. Can we run the check without --no-build-vignettes ?

@barracuda156
Copy link
Author

Unfortunately, it uses Pandoc for vignettes, so if I drop that argument, it just fails completely:

--->  Configuring R-tibble
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_R_R-tibble/R-tibble/work/tibble-3.2.1.9017" && /opt/local/bin/R CMD build . --no-manual --keep-empty-dirs 
* checking for file ‘./DESCRIPTION’ ... OK
* preparing ‘tibble’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to build vignettes
* creating vignettes ... ERROR
--- re-building ‘digits.Rmd’ using rmarkdown
Error: processing vignette 'digits.Rmd' failed with diagnostics:
Pandoc is required to build R Markdown vignettes but not available. Please make sure it is installed.
--- failed re-building ‘digits.Rmd’

--- re-building ‘extending.Rmd’ using rmarkdown
Error: processing vignette 'extending.Rmd' failed with diagnostics:
Pandoc is required to build R Markdown vignettes but not available. Please make sure it is installed.
--- failed re-building ‘extending.Rmd’

--- re-building ‘formats.Rmd’ using rmarkdown
Error: processing vignette 'formats.Rmd' failed with diagnostics:
Pandoc is required to build R Markdown vignettes but not available. Please make sure it is installed.
--- failed re-building ‘formats.Rmd’

--- re-building ‘invariants.Rmd’ using rmarkdown
Error: processing vignette 'invariants.Rmd' failed with diagnostics:
Pandoc is required to build R Markdown vignettes but not available. Please make sure it is installed.
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
Error in eval(x, envir = envir) : object 'eval_details' not found
--- failed re-building ‘invariants.Rmd’

--- re-building ‘numbers.Rmd’ using rmarkdown
Error: processing vignette 'numbers.Rmd' failed with diagnostics:
Pandoc is required to build R Markdown vignettes but not available. Please make sure it is installed.
--- failed re-building ‘numbers.Rmd’

--- re-building ‘tibble.Rmd’ using rmarkdown
Error: processing vignette 'tibble.Rmd' failed with diagnostics:
Pandoc is required to build R Markdown vignettes but not available. Please make sure it is installed.
--- failed re-building ‘tibble.Rmd’

--- re-building ‘types.Rmd’ using rmarkdown
Error: processing vignette 'types.Rmd' failed with diagnostics:
Pandoc is required to build R Markdown vignettes but not available. Please make sure it is installed.
--- failed re-building ‘types.Rmd’

SUMMARY: processing the following files failed:
  ‘digits.Rmd’ ‘extending.Rmd’ ‘formats.Rmd’ ‘invariants.Rmd’
  ‘numbers.Rmd’ ‘tibble.Rmd’ ‘types.Rmd’

Error: Vignette re-building failed.
Execution halted

@krlmlr
Copy link
Member

krlmlr commented May 4, 2024

What is the problem with using Pandoc?

@krlmlr
Copy link
Member

krlmlr commented May 4, 2024

Can we make that a build requirement?

@barracuda156
Copy link
Author

Can we make that a build requirement?

Please don’t, it will break it for all systems where Pandoc is broken. That is completely unnecessary.

@barracuda156
Copy link
Author

What is the problem with using Pandoc?

It depends on GHC, and that too a very recent GHC. So wherever GHC does not work, Pandoc won’t build.
It is also a very heavy dependency to pull in for such a trivial thing as optional documentation. Honestly, I do not know why it is used at all, when there are easier ways, which do not require a whole extra language with poor cross platform support.

@krlmlr krlmlr added the help wanted ❤️ we'd love your help! label May 4, 2024
@krlmlr
Copy link
Member

krlmlr commented May 4, 2024

Thanks, Sergey. It's tricky -- pandoc is universal on all platforms that matter in practice (that is, for the vast majority of users). I hear it for the first time that installing pandoc may be difficult on some platforms. Unfortunately, I can't prioritize fixing this particular use case, but I'm open to reviewing a pull request.

@krlmlr
Copy link
Member

krlmlr commented May 4, 2024

IIUC, fixing the Haskell compiler where it's broken allows us to pull in pandoc?

@barracuda156
Copy link
Author

@krlmlr As long as it is optional, there is no problem, I was just explaining why we have to disable building vignettes: on newer systems it is an unwanted heavy dependency, on older systems it does not build at all. (Well, it might be possible to build some old version of Pandoc on ppc, but it may not be trivial, requires time and in result it may or may not work for a given aim, nobody knows.)
By the way, TeX cannot not serve as a substitute? TeX, AFAIK, works everywhere. Still heavy, but at least it builds :)

@krlmlr
Copy link
Member

krlmlr commented May 4, 2024

So, the problem is that newer GHC doesn't work for older platforms? Is this fixable upstream?

To properly support --no-build-vignettes, we'd also need infrastructure to check this use case in CI/CD, in addition to fixing the issue at hand. A lot of work for limited gain, I can't prioritize this, sorry. Happy to review contributions towards that goal.

TeX doesn't create HTML.

@barracuda156
Copy link
Author

So, the problem is that newer GHC doesn't work for older platforms? Is this fixable upstream?

If you mean whether GHC upstream is going to fix anything on their end, then no, AFAIK. If you rather mean whether they accept a fix if I do it, then possibly yes.

Generally speaking, it is non-trivial to fix languages which can only be built by themselves. So we got Rust, GHC and Go broken indefinitely.
On the other hand, we have fixed R, Ruby, OCaml and ML (and Lisp too, but that one is built by itself).

The last GHC for ppc was 7.0.4. I have fixed 7.6.3, but anything later either failed to build or refused to (it requires a relatively recent version, so using an archaic one to build the current like with SBCL does not work here). Upstream suggested to fix the code in the current GHC and cross-compile it from Intel. Well, that is perhaps doable, but I have no experience with cross-compiling things and Macports does not have functionality for it, so it will need a lot of time to sort it out. Plus restoring code for ppc is not straightforward, since GHC sources changed quite a bit. Very likely, just restoring and fixing SDK issues will not suffice, and something will be needed to reimplement in assembler.
Still, this is doable in principle, but I will need to put everything else off.

To properly support --no-build-vignettes, we'd also need infrastructure to check this use case in CI/CD, in addition to fixing the issue at hand. A lot of work for limited gain, I can't prioritize this, sorry. Happy to review contributions towards that goal.

A lot of work for this will be impractical, of course. (And just in case, there is no need to bother with finding a way to build html documentation for systems without Pandoc, users can certainly live without html docs offline.)
My main concern is to ensure that tibble works correctly, since it is crucial to everything, and we really want to avoid bugs here. Then if a test case is trivially failing due to missing Pandoc, perhaps just conditionally disable it, if Pandoc not detected? That should be easy to implement.

TeX doesn't create HTML.

Ok, fair point. But is html documentation a strictly required thing for tests? Let it be generated by default (so no one suffers because of a few users with ppc, mips and older x86), but if there will be an option to turn it off, that will be nice, perhaps.

@krlmlr
Copy link
Member

krlmlr commented May 4, 2024

All valid points. All I'm saying is that I can't spend time on the implementation. If anyone wants to chime in, happy to review.

I see failures consistent with your report when I check with --no-build-vignettes on my system. Chances are very high that tibble is fine on PPC, in particular if all other checks succeed.

@barracuda156
Copy link
Author

@krlmlr Thank you very much for verifying that! It is very helpful.

If anyone wants to chime in, happy to review.

Yes, I may return to this.

@chainsawriot
Copy link

Just wanna tag this issue here

gesistsa/rio#424

Which is the same: failing the building of vignettes that have error = TRUE code blocks.

@barracuda156
Copy link
Author

Unfortunately, rebuilding knitr and rmarkdown did not help. Same error:

--->  Testing R-tibble
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tibble/R-tibble/work/tibble-3.2.1.9018" && /opt/local/bin/R CMD check ./tibble_3.2.1.9018.tar.gz --no-manual --no-build-vignettes 
* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tibble/R-tibble/work/tibble-3.2.1.9018/tibble.Rcheck’
* using R version 4.4.0 (2024-04-24)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-13 (MacPorts gcc13 13.2.0_4+stdlib_flag) 13.2.0
    GNU Fortran (MacPorts gcc13 13.2.0_4+stdlib_flag) 13.2.0
* running under: OS X Snow Leopard 10.6
* using session charset: UTF-8
* using options ‘--no-manual --no-build-vignettes’
* checking for file ‘tibble/DESCRIPTION’ ... OK
* this is package ‘tibble’ version ‘3.2.1.9018’
* 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 ‘tibble’ can be installed ... OK
* used C compiler: ‘gcc-mp-13 (MacPorts gcc13 13.2.0_4+stdlib_flag) 13.2.0’
* used SDK: ‘NA’‘NA’‘NA’‘NA’‘NA’‘NA’
* checking installed package size ... OK
* checking package 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 whether startup messages can be suppressed ... 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 line endings in C/C++/Fortran sources/headers ... OK
* checking use of PKG_*FLAGS in Makefiles ... OK
* checking compiled code ... OK
* checking files in ‘vignettes’ ... WARNING
Files in the 'vignettes' directory but no files in 'inst/doc':
  ‘digits.Rmd’ ‘extending.Rmd’ ‘formats.Rmd’ ‘formats.mmd’
  ‘invariants.Rmd’ ‘numbers.Rmd’ ‘r4ds.mmd’ ‘tibble.Rmd’ ‘timing.rds’
  ‘types.Rmd’ ‘wip/alignment.png’ ‘wip/subassign.Rmd’ ‘wip/subset.Rmd’
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘testthat.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... WARNING
Directory 'inst/doc' does not exist.
Package vignettes without corresponding single PDF/HTML:
  ‘digits.Rmd’
  ‘extending.Rmd’
  ‘formats.Rmd’
  ‘invariants.Rmd’
  ‘numbers.Rmd’
  ‘tibble.Rmd’
  ‘types.Rmd’
* checking running R code from vignettes ...
  ‘digits.Rmd’ using ‘UTF-8’... OK
  ‘extending.Rmd’ using ‘UTF-8’... OK
  ‘formats.Rmd’ using ‘UTF-8’... failed
  ‘invariants.Rmd’ using ‘UTF-8’... failed
  ‘numbers.Rmd’ using ‘UTF-8’... failed
  ‘tibble.Rmd’ using ‘UTF-8’... failed
  ‘types.Rmd’ using ‘UTF-8’... OK
 ERROR
Errors in running code in vignettes:
when running code in ‘formats.Rmd’
  ...
+     geom_line()

> text <- paste(readLines(here::here("vignettes/r4ds.mmd")), 
+     collapse = "\n")
Warning in file(con, "r") :
  cannot open file '/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tibble/R-tibble/work/.tmp/RtmpFIWU2v/file3ace786cb0e2/vignettes/vignettes/r4ds.mmd': No such file or directory

  When sourcing ‘formats.R’:
Error: cannot open the connection
Execution halted
when running code in ‘invariants.Rmd’
  ...
[1]  1 NA  3 NA

> df[[1:2]]
[1] NA

> df[[c("n", "c")]]

  When sourcing ‘invariants.R’:
Error: subscript out of bounds
Execution halted
when running code in ‘numbers.Rmd’
  ...
> x <- num(c(1, 2, 4), notation = "eng")

> var(x)
[1] 2.333333

> median(x)

  When sourcing ‘numbers.R’:
Error: `median.pillar_num()` not implemented.
Execution halted
when running code in ‘tibble.Rmd’
  ...
3     3     1

> tibble(a = 1:3, c = 1:2)

  When sourcing ‘tibble.R’:
Error: Tibble columns must have compatible sizes.
• Size 3: Existing data.
• Size 2: Column `c`.
ℹ Only values of size one are recycled.
Execution halted

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

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

Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tibble/R-tibble/work/tibble-3.2.1.9018" && /opt/local/bin/R CMD check ./tibble_3.2.1.9018.tar.gz --no-manual --no-build-vignettes 
Exit code: 1

@krlmlr
Copy link
Member

krlmlr commented Jun 19, 2024

Thanks for the heads-up. Should we add purl = TRUE to some chunks as described in https://stat.ethz.ch/pipermail/r-package-devel/2024q2/010871.html ?

@chainsawriot
Copy link

@krlmlr At least that's what I did.

gesistsa/rio#424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted ❤️ we'd love your help!
Projects
None yet
Development

No branches or pull requests

3 participants