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
CRAN complains about user_cache_dir()
#27
Comments
And this is on Windows: R.version.string
#> [1] "R version 4.0.3 (2020-10-10)"
tools::R_user_dir('foo', which = 'cache')
#> [1] "C:\\Users\\chris\\AppData\\Local/R/cache/R/foo"
rappdirs::user_cache_dir('foo')
#> [1] "C:\\Users\\chris\\AppData\\Local\\foo\\foo\\Cache" |
rappdirs uses the
If you don't want the
I am not entirely sure why
Or you can also use |
As for leaving files around, it is good practice to support an environment variable to specify the cache/config location, and you can set this to a temporary directory at the beginning of your tests, and then clean it up after the tests. |
(@gaborcsardi The reason we can't use |
Right. Maybe then we can add a wrapper that is essentially a backport of
the tools function.
…On Mon, 18 Jan 2021, 14:42 Hadley Wickham, ***@***.***> wrote:
***@***.*** <https://github.com/gaborcsardi> The reason we can't use
tools::R_user_dir() is that it only works on >= 4.0.0)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFBGQHN24VGBQPLZIOEJNDS2Q3D7ANCNFSM4WEJFRSQ>
.
|
We should provide a backport somewhere, although I'm not sure if it should go here or in backports. I wonder if fixing this issue just requires teaching rappdirs to respect |
I think you are right. Having such an env var would make sense in general, anyway. |
I'm pretty sure the root cause of the issue is not respecting the env vars that I think CRAN is setting, but I've also emailed Kurt to double check, and opened r-lib/backports#55 since folks now can just use the R implementation directly. |
We got this message from CRAN when we used
rappdirs::user_cache_dir()
:The code is here:
https://github.com/rstudio/bslib/blob/80a5059bcef0bec16c9d914b6458f70077d2707b/R/fonts.R#L387
@gaborcsardi has said that we should stick with rappdirs, since
tools::R_user_dir()
doesn't always do the right thing on Windows, but this is causing problems with packages submitted to CRAN.For the record, on my Mac:
And on Linux (using the wch1/r-debug docker image):
cc @cpsievert, @schloerke
The text was updated successfully, but these errors were encountered: