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

Enable parse data when installing packages for R devel #309

Closed
jimhester opened this issue Apr 26, 2018 · 2 comments
Closed

Enable parse data when installing packages for R devel #309

jimhester opened this issue Apr 26, 2018 · 2 comments

Comments

@jimhester
Copy link
Member

R-devel will disable use of parse data by default, so we will need to explicitly enable it in those versions. This patch from @kalibera is what is needed in R-devel, although we will need to use something like option("keep.parse.data.pkgs" = TRUE) and Sys.setenv( R_KEEP_PKG_PARSE_DATA="yes") so we can maintain backwards compatibility.

diff -ru orig/covr/R/covr.R covr/R/covr.R
--- orig/covr/R/covr.R  2017-08-15 06:53:59.000000000 -0500
+++ covr/R/covr.R       2018-04-24 03:23:47.758433338 -0500
@@ -85,7 +85,7 @@
   env <- new.env(parent = parent_env)

   lapply(source_files,
-     sys.source, keep.source = TRUE, envir = env)
+     sys.source, keep.source = TRUE, keep.parse.data = TRUE, envir = env)

   trace_environment(env)
   on.exit({
@@ -94,7 +94,7 @@
   })

   lapply(test_files,
-     sys.source, keep.source = TRUE, envir = env)
+     sys.source, keep.source = TRUE, keep.parse.data = TRUE, envir = env)

   coverage <- structure(as.list(.counters), class = "coverage")

@@ -257,6 +257,7 @@
                             INSTALL_opts = c("--example",
                                              "--install-tests",
"--with-keep.source",
+ "--with-keep.parse.data",
                                              "--no-multiarch"),
                             quiet = quiet))
@gaborcsardi
Copy link
Member

Is it possible to get the parse data from parsing the source references?

@jimhester
Copy link
Member Author

Yeah, that would be another way to do it, re-parse the code using the source references.

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