Closed geanders closed 7 years ago
somehow urbanek
is getting injected into the user cache directory - happened on my machine as well. looking into how that can happen
it only happens when I installed the binary version from CRAN, works fine when installing source version from CRAN
@kevinushey so this is really weird.
On installation of a binary version from cran of this package, somehow the rappdirs::user_cache_dir
call injects urbanek
as the user instead of whoever the user is (e.g., sacmac
for me)
This doesn't happen when installing source from cran, or installing from local git repo, etc.
I'm guessing this could be a problem in rappdirs:::file_path
, which has
<r> file_path
function(...) {
normalizePath(do.call("file.path", as.list(c(...))), mustWork = FALSE)
}
so a potential problem in normalizePath
maybe i'm missing something obvious
I see something similar on a Windows install:
> ghcnd_search("AGE00147704", var = "PRCP")
Warning in file(file, ifelse(append, "a", "w")) :
cannot open file 'C:\Users\CRAN\AppData\Local\rnoaa\rnoaa\Cache/ghcnd/AGE00147704.dly': No such file or directory
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
Perhaps the rnoaa
package is calling an rappdirs
function when the package is built, rather than at runtime / in a .onLoad
handler?
The issue is here:
https://github.com/ropensci/rnoaa/blob/e5f8bfef6e0b850c65ca7025341e1bc832f82f44/R/aaa.r#L1-L3
That code in aaa.R
gets run on package build, so the username used when the package is built is what gets used by the package. Moving that code into the .onLoad
handler should help.
ah yeah, makes sense, thanks @kevinushey !
@geanders i'll get a new version on cran by tomorrow
this is sorted now, pushing to cran today
Thanks so much!
From: Scott Chamberlain notifications@github.com
Sent: Friday, October 21, 2016 8:12:47 PM
To: ropensci/rnoaa
Cc: Anderson,Brooke; Mention
Subject: Re: [ropensci/rnoaa] Error running ghcnd_search
with CRAN version of rnoaa
but not GitHub version (#173)
@geandershttps://github.com/geanders i'll get a new version on cran by tomorrow
You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ropensci/rnoaa/issues/173#issuecomment-255501297, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFVFiN-7l1IkzfnGaqthBY2NmYLs1OESks5q2XEfgaJpZM4Kdq-G.
When running examples from the help file for
ghcnd_search
with the version ofrnoaa
on GitHub (ropensci/rnoaa
), it's working fine:However, when I try with the current version on CRAN, I'm getting an error running the same thing:
From the commit history, it doesn't look like there have been any commits to the GitHub version since the latest version was released to CRAN, so I'm confused about why the CRAN version isn't working while the GitHub version is. It looks like something to do with the caching, based on the error message, but I'm having a hard time figuring out what's going wrong with the CRAN version. Any tips?
For the record, here's the rest of my
session_info
while running this: