-
Notifications
You must be signed in to change notification settings - Fork 216
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
Include the SVN revision in the r-devel package cache key #699
Conversation
Thanks! Including the SVN revision there is not great, because the graphics API only changes ~ once a year, and the SVN revision changes practically every day. So maybe we could query the graphics API version instead, plus maybe |
I like the idea of using the I'm not familiar enough on the internals to suggest a better value 😢 . (I did not know about
Fair. There were ~15 commits just today. This would bust the cache quite often. I'll defer to you if we can enhance the cache key. But finding the error message while testing was quite confusing and I'd rather err on longer compute times than confusing errors. |
I meant the graphics api version + the internal ID. There is only one graphics api version number, an integer number. Those are just symbolic names for the various (recent) versions.
But we only have at most one R-devel build per day, so it is once a day at most. But that's not ideal, either. Anyway, I think the graphics api version + the internal ID would work. |
That sounds reasonable to me. There's value in these workflows completing quickly. |
Graphics API Version + Internal ID sounds good then! @gaborcsardi Do you have another incantation to expose this value? I could not find a way without making/compiling/calling a C function. Thank you! |
Yeah, one is lines <- c(
"#include <Rinternals.h>",
"#include <R_ext/GraphicsEngine.h>",
"SEXP ghapi_version() {",
"return ScalarInteger(R_GE_getVersion());",
"}"
)
dir.create(tmp <- tempfile())
src <- file.path(tmp, "ghapi.c")
writeLines(lines, src)
so <- file.path(tmp, paste0("ghapi", .Platform$dynlib.ext))
rbin <- file.path(R.home("bin"), "R")
tools:::.shlib_internal(c("-o", so, src))
dl <- dyn.load(so)
ghapi_version <- getNativeSymbolInfo("ghapi_version", dl)
cat(.Call(ghapi_version)) and you need to look at the last line of the output only. IDK if there is a way to discard the rest of the output. |
Looks like you can get it by calling |
…r to bust R-devel package cache
Running the devel code path on R 4.1.3:
|
Codecov Report
@@ Coverage Diff @@
## v2-branch #699 +/- ##
===========================================
Coverage 100.00% 100.00%
===========================================
Files 2 2
Lines 10 10
===========================================
Hits 10 10 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Thanks! |
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this pull request. |
When testing on r-devel, breaking internal core R code changes can happen within the same day. It would be good to try to allow for rapid GHA development with a consistent cache key while busting the cache if the internal core R code changes. To bust this cache, the SVN revision number has been included (in addition to make formatting similar with regular
r-version
values).Existing output of non-devel
r-version
value:Existing output of an r-devel
r-version
value:Proposed output of an r-devel
r-version
value:Recent motivation:
Error: Graphics API version mismatch
cc @jcheng5