Skip to content

Possible package.skeleton issue affecting Rcpp, RcppArmadillo, RStudio (!!), ... #1087

@eddelbuettel

Description

@eddelbuettel

So I just did the live webinar on Rcpp and got to show live how package generation now fails (from RStudio) for both Rcpp and RcppArmadillo 😢

It looks the NAMESPACE file now gets an 'echo' from a temp function we create but which is no longer there when the package is finished. And misses an actual exportPatter().

So a simple first fix for RcppArmadillo could be (done and tested)

modified   R/RcppArmadillo.package.skeleton.R
@@ -78,6 +78,8 @@ RcppArmadillo.package.skeleton <- function(name="anRpackage", list=character(),
     ## add a useDynLib to NAMESPACE,
     NAMESPACE <- file.path( root, "NAMESPACE")
     lines <- readLines( NAMESPACE )
+    lines <- lines[!grepl("^export.*fake", lines)]
+    lines <- c(lines, "exportPattern(\"^[[:alpha:]]+\")")
     if (! grepl("useDynLib", lines)) {
         lines <- c(sprintf("useDynLib(%s, .registration=TRUE)", name),
                    "importFrom(Rcpp, evalCpp)",        ## ensures Rcpp instantiation

do not print the fake one but add the pattern. Is my fear justified that the RStudio generator may need this too? Paging @kevinushey ....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions