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

Description too strongly worded #8

Open
eddelbuettel opened this issue Sep 9, 2022 · 11 comments
Open

Description too strongly worded #8

eddelbuettel opened this issue Sep 9, 2022 · 11 comments

Comments

@eddelbuettel
Copy link

When updating major or minor R versions all packages should be re-installed.

I do not think this is true as stated. I have been running R since just before 1.0 and there were about a handful of releases that required it and stated this in NEWS entry. Clearly the majors (1.0.0, 2.0.0, 3.0,0) and one or two of the minors because internals changed -- but far from all. So it is not generally required for the minors, for example neither one of the 4.[12].0 releases required it for all packages. (The plotting interfaces changed, but that affected a handful of packages implementing plotting devices.)

So I think you should temper the statement. It is still useful to be able to do this, but we should not propagate the illusion that it is mandatory. Updates are good, one should do that and they are not that costly.

@ddsjoberg
Copy link
Owner

Thanks @eddelbuettel !

While it is true that most packages are unaffected and will work in 4.1 when built with 4.0, for example; there is no guarantee that a package built on R 4.0 will work on R 4.1.

There was a case recently (I can't recall if it was from 4.0 to 4.1 or 4.1 to 4.2) with lubridate. Users who copied their libraries instead of re-installing the packages were getting mysterious error messages, and it took quite some time for the luibridate team to track down the issue. This affected some of my colleagues as well, which is why I am recommending that users always re-install.

I can tone it down, but want a clear recommendation to not copy pkgs from an old R install to the newer install pkg library.

@ddsjoberg
Copy link
Owner

@eddelbuettel

I have this in the README

Importantly, the package re-installs the packages and does not copy them from the previous R installation library. R packages for minor R releases (e.g. R 4.1 to R 4.2) may not be compatible, which is why it’s important to re-install the packages and not copy them.

Maybe I can incorporate this softer wording

@eddelbuettel
Copy link
Author

eddelbuettel commented Sep 9, 2022

Yes, an open recommendation that you may want to rebuild packages is fine. I just want to combat the notion that R forces you do. It does not.

On many systems, Windows included (!!), you don't even have to copy the libraries. On Unix, the system libpath is fixed. On Windows, when I still used, I copied that same trick in the early 2000s and always installed into C:/opt/R/lib/ when I would put R itself in C:/opt/R/R-x.y.z/ and updated Rprofile.site locally by copying. That worked 20 years ago. It still does today

I install into a fixed system path here, and hence I have packages of yore that install fine. (Testing this I of course immediately hit one old enough:

edd@rob:~$ Rscript -e 'library(RcppUTS); print(search())'
Error: package or namespace load failed for ‘RcppUTS’:
 package ‘RcppUTS’ was installed before R 4.0.0: please re-install it
Execution halted
edd@rob:~$ 

but to my claim I have dozens here that are well over two years old and picking one randomly (happy to script all as well) works as you would think:

edd@rob:~$ ls -lh /usr/local/lib/R/site-library/reshape2/libs/reshape2.so 
-rwxrwxr-x 1 edd staff 125K Apr 26  2020 /usr/local/lib/R/site-library/reshape2/libs/reshape2.so
edd@rob:~$ Rscript -e 'library(reshape2); options(width="75"); print(search())'
 [1] ".GlobalEnv"        "package:reshape2"  "package:stats"    
 [4] "package:graphics"  "package:grDevices" "package:utils"    
 [7] "package:datasets"  "package:methods"   "Autoloads"        
[10] "package:base"     
edd@rob:~$ 

Note the Apr 2020 date. Rebuilt after R 4.0.0, not since. So no, "you do NOT have to". That is a user-unfriendlyness notion we should not spread.

Happy to read up on the purported lubridate issue. I am betting my $0.02 that it is a third-party issue with compiler or library making that package wanting a rebuild which would not generalize to all packages. I could be wrong, of course. I often am.

(Also of note I maintain dozens of CRAN package for Debian. Other maintainers there insist we rebuild on new API version and we have a tag for that: r-4.0 for the API. Not r-4.2.)

That said, I have nothing against your package. I am sure many find it useful. I just would like, if I may, be a little more clear in the language of R does, or does not, make mandatory.

@ddsjoberg
Copy link
Owner

Thanks for the clarifications 💯

Here's what the manual says:
image

And here's the issue in lubridate I was referring to
tidyverse/lubridate#1041

@eddelbuettel
Copy link
Author

eddelbuettel commented Sep 9, 2022

Thanks for that citation, but that is simply not true as stated in that manual of a single package. If you and I cared enough we could likely construct an easy counterexample with (Ubuntu or Debian) binaries for R 4.1.* and 4.2.*, a lubridate binary from the former and I reckon it simply will work aftrr an update disproving that overly general language in the manual. And my broader point is that you may (possibly accidentally) extrapolate too far in generalizing what you see in the docs for one package to all 18.5k packages.

The only 'real' manual (in the sense of 'by R Core') is R Installation and Administration and AFAIK you will not fine a line in there advocating to 'slash and burn' all packages on upgrade.

Anyway, your package, your rules. I just think we should not attribute overly strong requirements to R and R updates when its authors do not say so.

@eddelbuettel
Copy link
Author

A minimal (?) example is to start with plain old Ubuntu 22.04 and install its (r-cran-)lubridate (binary) version 1.8.0. It will pull R 4.1.2 in as that was the R when that Ubuntu release was made. Then:

root@29ebd3f984a0:/# R

R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(lubridate)

Attaching package: 'lubridate'

The following objects are masked from 'package:base':

    date, intersect, setdiff, union

> 

We can then follow the simple steps at https://cloud.r-project.org/bin/linux/ubuntu/ to update to R 4.2.1. If I do so, I do indeed get misbehavior:

root@29ebd3f984a0:/# R

R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(lubridate)
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

Attaching package: 'lubridate'

The following objects are masked from 'package:base':

    date, intersect, setdiff, union

Warning message:
In system("timedatectl", intern = TRUE) :
  running command 'timedatectl' had status 1
> 

How to interpret this may differ between you and me. You may argue "see, one package borked, so let me rebuild all just in case". My view is that the known and affected packages can and should be rebuild.

That last part is not available on all OSs and platform. So if one chooses to do so, a full rebuild (while potentially costly in time) may save other headaches. But it doesn't exactly follow that every R user has to rebuild all packages on each update.

Thanks for bearing with me.

@ddsjoberg
Copy link
Owner

Thanks Dirk, appreciate the conversations and clarifications. I will soften the language.

FYI, that quote came from https://cran.r-project.org/bin/windows/base/rw-FAQ.html, rather than from a single R package. That is a Windows-specific page.

@eddelbuettel
Copy link
Author

PS Forgot to stress it does of course still work it just gets a warning message:

> example(yday)

yday> x <- as.Date("2009-09-02")

yday> wday(x) #4
[1] 4

yday> wday(ymd(080101))
[1] 3

yday> wday(ymd(080101), label = TRUE, abbr = FALSE)
[1] Tuesday
7 Levels: Sunday < Monday < Tuesday < Wednesday < Thursday < ... < Saturday

yday> wday(ymd(080101), label = TRUE, abbr = TRUE)
[1] Tue
Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat

yday> wday(ymd(080101) + days(-2:4), label = TRUE, abbr = TRUE)
[1] Sun Mon Tue Wed Thu Fri Sat
Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat

yday> x <- as.Date("2009-09-02")

yday> yday(x) #245
[1] 245

yday> mday(x) #2
[1] 2

yday> yday(x) <- 1  #"2009-01-01"

yday> yday(x) <- 366 #"2010-01-01"

yday> mday(x) > 3
[1] FALSE
> 

@eddelbuettel
Copy link
Author

Yes, windows is different. And it has been 15 years for me -- maybe my memory is shot and on x.y updates I reinstalled. I do know that Uwe does full rebuilds even on package updates. Windows is special....

@ddsjoberg
Copy link
Owner

Windows is sooooo 'special' sometimes! 😆

@eddelbuettel
Copy link
Author

Which is why it is so 'beloved' ❤️

😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants