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

deployments using older versions of foreign package produce spurious warnings #436

Closed
kevinushey opened this issue Jun 18, 2020 · 7 comments

Comments

@kevinushey
Copy link
Contributor

When rsconnect checks to see whether a package is available on CRAN, it does so by checking whether the latest-available version of that package is available on CRAN:

repo.packages <- available.packages(contriburl = contrib.url(repos, type = "source"), type = "source")

However, the default filters (which define an inclusion / exclusion criteria for the packages returned by available.packages()) are left on. From ?available.packages:

Argument filters can be used to select which of the packages on the repositories are reported. It is called with its default value (NULL) by functions such as install.packages: this value corresponds to getOption("available_packages_filters") and to c("R_version", "OS_type", "subarch", "duplicates") if that is unset or set to NULL.

The built-in filters are

"R_version"
Exclude packages whose R version requirements are not met.

< ... snip ... >

The current source version of foreign requires R 4.0.0:

> db <- available.packages(type = "source")
> db["foreign", "Depends"]
[1] "R (>= 4.0.0)"

which implies that the aforementioned check would fail to see that foreign is a package available on CRAN, if the current version of R were older than 4.0.0.

Since this is ultimately just a warning, we could relax this check by removing the filters used by available.packages().

@jmcphers
Copy link
Member

Does #432 address this?

@kevinushey
Copy link
Contributor Author

Yes, I believe so!

@jmcphers
Copy link
Member

Fixed by #432

@ronblum
Copy link

ronblum commented Mar 25, 2021

@jmcphers and/or @kevinushey I'm trying to reproduce this in the current CRAN version of rsconnect. Is the foreign package special to publishing to Connect, or is it just an example of a package that I would use in the Rmd?

@kevinushey
Copy link
Contributor Author

This is specifically for any R package for which the latest-available source package requires R (>= 4.0.0); foreign is just one example of such a package: https://cran.r-project.org/web/packages/foreign/index.html

XML is another example: https://cran.r-project.org/web/packages/XML/index.html

@ronblum
Copy link

ronblum commented Mar 26, 2021

@kevinushey Thanks! I'll try out these packages with R 3.6.3 first.

@ronblum
Copy link

ronblum commented Mar 31, 2021

Verified by using foreign on 3.6.3. Deployment happened cleanly with no errors.

[All thanks to @kevinushey for walking me through the reprex, etc.]

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

No branches or pull requests

3 participants