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

Error: invalid version specification ‘6003’ #441

Closed
JohnCoene opened this issue Mar 30, 2022 · 6 comments · Fixed by #445 or #452
Closed

Error: invalid version specification ‘6003’ #441

JohnCoene opened this issue Mar 30, 2022 · 6 comments · Fixed by #445 or #452
Labels
bug an unexpected problem or unintended behavior

Comments

@JohnCoene
Copy link

I originally opened an issue on testthat: r-lib/testthat#1597
This is where I first encountered the issue.

Going through the traceback it seems to be caused by:

if (nzchar(VTE_VERSION <- Sys.getenv("VTE_VERSION"))) {

On my machine:

 Sys.getenv("VTE_VERSION")
#> "6003"

package_version("6003")
#> Error: invalid version specification ‘6003’

It throws this error: https://github.com/wch/r-source/blob/cd17e8a41e33186af6aee0f17b4e558540ba8e5c/src/library/base/R/version.R#L51

R version 4.1.3 (2022-03-10) -- "One Push-Up"
Platform: x86_64-pc-linux-gnu (64-bit)

r$> sessioninfo::session_info()                                                                       
─ Session info ─────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.1.3 (2022-03-10)
 os       Linux Mint 20.3
 system   x86_64, linux-gnu
 ui       X11
 language en_US
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/Zurich
 date     2022-03-30
 pandoc   2.5 @ /usr/bin/pandoc

─ Packages ─────────────────────────────────────────────────────────────────────────────────────────
 package     * version    date (UTC) lib source
 cli           3.2.0      2022-02-14 [1] CRAN (R 4.1.2)
 sessioninfo   1.2.2.9000 2022-03-30 [1] Github (r-lib/sessioninfo@27965c2)

 [1] /home/john/R/x86_64-pc-linux-gnu-library/4.1
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library
@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Mar 30, 2022
@trevorld
Copy link

trevorld commented Apr 6, 2022

FYI: setting options(cli.hyperlink=FALSE) got devtools::test() working again for me

@MichaelChirico
Copy link
Contributor

Is VTE_VERSION referring to the VteTerminal? https://developer-old.gnome.org/vte/unstable/VteTerminal.html

@MichaelChirico
Copy link
Contributor

OK, based on this:

https://gitlab.gnome.org/GNOME/pygobject/-/issues/214

and on my system:

echo $VTE_VERSION
# 5202

and

python
import gi
gi.require_version("Vte", "2.91")
from gi.repository import Vte

print(f"{ Vte.get_major_version() }.{ Vte.get_minor_version() }.{ Vte.get_micro_version() }")
# 0.52.2

I feel confident we can check for \d{4} and treat it as f"{minor}{micro}". Would be even better if someone could find documentation of this so we can know what would happen if major > 0... but I think we have enough for a PR for now.

@reedacartwright
Copy link

I'm running cli version 3.2.0.9000 downloaded from github, and I get an invalid version specification error:

Error: invalid version specification ‘0.68’

On my system VTE_VERSION = 6800. And when 68.0 is encoded as a string in package_version() the .0 gets dropped. I haven't tested it, but I believe that either of the following pieces of code will work:

# Option 1
VTE_VERSION <- sprintf("%0.2f", as.numeric(VTE_VERSION) / 100)
VTE_VERSION <- package_version(list(major = 0, minor = VTE_VERSION))

# Option 2
VTE_VERSION <- sub("(\d\d)(\d\d)", "0.\1.\2", VTE_VERSION)
VTE_VERSION <- package_version(VTE_VERSION)

@gaborcsardi gaborcsardi reopened this Apr 23, 2022
@gaborcsardi
Copy link
Member

@reedacartwright Thanks! You can set VTE_VERSION in your .Renviron to something sensible as a workaround, until we fix this.

MichaelChirico added a commit to MichaelChirico/cli that referenced this issue Apr 23, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Closes r-lib#441 again
@MichaelChirico
Copy link
Contributor

Great catch, thanks! Fixed again in #452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
5 participants