cli icon indicating copy to clipboard operation
cli copied to clipboard

Changes in R-devel break cli

Open TimTaylor opened this issue 1 year ago • 7 comments

Sure you will here this from elsewhere soon enough but I think the latest change in R-devel (https://github.com/wch/r-source/commit/55b259e7ea922acbd4f1f3e92309b6a699c66ff6 or maybe https://github.com/wch/r-source/commit/00c14e770b7568325e0cd7e2b5a8fbbaefd067f1) has broken cli. I'm struggling to pinpoint where as can only really get the error when documenting with roxygen or running R CMD check. One error message I'm capturing when running devtools::document (via rstudio shortcut) is:

Error in nchar(xs) : 
  number of characters is not computable in "bytes" encoding, element 1
Calls: suppressPackageStartupMessages ... <Anonymous> -> clii__xtext -> ansi_strwrap -> lapply -> FUN
Execution halted

Exited with status 1.

Note this is not a problem when running devtools::document(roclets = c('rd', 'collate', 'namespace')) directly.

Apologies for the vagueness of the report. Just wanted to give you a heads up.

TimTaylor avatar Jul 14 '22 11:07 TimTaylor

minimal reprex

R -s -e 'cli::cli_bullets(c(">"="bob"))'
Error in nchar(xs) : 
  number of characters is not computable in "bytes" encoding, element 1
Calls: <Anonymous> ... <Anonymous> -> clii__xtext -> ansi_strwrap -> lapply -> FUN
Execution halted
─ Session info ──────────────────────────────────────────────────────────
 version  R Under development (unstable) (2022-07-14 r82590)
 os       Fedora Linux 36 (Workstation Edition)
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_GB.UTF-8
 ctype    en_GB.UTF-8
 tz       Europe/London
 date     2022-07-14
 pandoc   2.14.0.3 @ /usr/bin/pandoc

─ Packages ──────────────────────────────────────────────────────────────
 package     * version    date (UTC) lib source
 cli           3.3.0.9000 2022-07-14 [1] Github (r-lib/cli@1358a1b)
 sessioninfo   1.2.2      2021-12-06 [1] CRAN (R 4.3.0)

TimTaylor avatar Jul 14 '22 12:07 TimTaylor

I was probably to keen raising this (Tomas has now reverted in https://github.com/wch/r-source/commit/ef0a4a211f92640e71e87cbe7b66323f2c239e4d and all works again).

TimTaylor avatar Jul 15 '22 10:07 TimTaylor

They'll probably still introduce this later, so we might as well work around it now.

gaborcsardi avatar Jul 15 '22 10:07 gaborcsardi

I just ran into this error trying to release to CRAN. A print method uses cli which caused this error.

Will this revision be submitted to CRAN?

JosiahParry avatar Jul 15 '22 14:07 JosiahParry

You mean, will an updated version of cli with a workaround be submitted to CRAN soon?

Eventually yes, but not soon. They reverted this change in R-devel, so the errors should go away by tomorrow, without us having to do anything.

It is unlikely that we could get a fix version of cli on CRAN before tomorrow, especially because probably a bunch of cli reverse dependencies are also failing their checks because of this change.

gaborcsardi avatar Jul 15 '22 14:07 gaborcsardi

@JosiahParry The changes to Rdevel have been reverted but CRAN is likely running a day or so behind in versions. If the submission has been rejected (as opposed to placed in waiting or similar) then I would wait until after the weekend and resubmit once everything has flushed through.

TimTaylor avatar Jul 15 '22 14:07 TimTaylor

Thanks @TimTaylor & @gaborcsardi :)

JosiahParry avatar Jul 15 '22 15:07 JosiahParry