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

remove check for R built version in onLoad #4009

Closed
jangorecki opened this issue Oct 29, 2019 · 2 comments
Closed

remove check for R built version in onLoad #4009

jangorecki opened this issue Oct 29, 2019 · 2 comments
Milestone

Comments

@jangorecki
Copy link
Member

I think we should remove the following check

data.table/R/onLoad.R

Lines 30 to 34 in fc8d079

builtUsing = readRDS(system.file("Meta/package.rds",package="data.table"))$Built$R
if (!identical(base::getRversion()>="4.0.0", builtUsing>="4.0.0")) {
stop("This is R ", base::getRversion(), " but data.table has been installed using R ",builtUsing,". The major version must match. Please reinstall data.table.")
# the if(R>=4.0.0) in NAMESPACE when registering S3 methods rbind.data.table and cbind.data.table happens on install; #3968
}

It was added as a port of #3972 to improve consistency in checking for recent R version where cbind and rbind are capable to dispatch to class methods.

The version match is not always the case, for example R-devel binaries on CRAN might have been built using R release version. This was reported in r-hub/rhub#310

@mattdowle
Copy link
Member

mattdowle commented Oct 29, 2019

But if we remove it, how to give the message that it doesn't work. Because it doesn't work. Which is why I added the message. The if() is in NAMESPACE.

@mattdowle mattdowle added this to the 1.12.7 milestone Oct 29, 2019
@mattdowle
Copy link
Member

mattdowle commented Oct 30, 2019

I've confirmed that packageDescription()$Built is not the version of R used to run R CMD build and create the package tar.gz, or .zip on Windows. What Built really refers to is the version of R used to R CMD INSTALL the package. And it is the version of R used to install the package which is the version of R that executes the if() in NAMESPACE. Which is why to use data.table 1.12.6+ in R 4+, it must be installed using R 4+ too.

The error message is correctly using the words "installed using" for this reason.

This is R 4.0.0 but data.table has been installed using R 3.6.1. The major version must match. Please reinstall data.table.

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