[Rcpp-commits] r4204 - in pkg/Rcpp: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jan 13 13:07:14 CET 2013


Author: jjallaire
Date: 2013-01-13 13:07:12 +0100 (Sun, 13 Jan 2013)
New Revision: 4204

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/R/Attributes.R
   pkg/Rcpp/TODO
Log:
stop with explicit error on Windows then the Rcpl libPath or sourceCpp target file contains spaces in it's path

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2013-01-13 11:42:47 UTC (rev 4203)
+++ pkg/Rcpp/ChangeLog	2013-01-13 12:07:12 UTC (rev 4204)
@@ -1,6 +1,9 @@
 2014-01-13  JJ Allaire <jj at rstudio.org>
 
-        * R/Attributes.R: use plugin includes in cppFunction
+        * R/Attributes.R: use plugin includes in cppFunction; stop with 
+        explicit error on Windows then the Rcpl libPath or sourceCpp
+        target file contains spaces in it's path
+       
         * man/pluginsAttribute.Rd: clarify which fields of plugin are
         used by sourceCpp
 

Modified: pkg/Rcpp/R/Attributes.R
===================================================================
--- pkg/Rcpp/R/Attributes.R	2013-01-13 11:42:47 UTC (rev 4203)
+++ pkg/Rcpp/R/Attributes.R	2013-01-13 12:07:12 UTC (rev 4204)
@@ -34,6 +34,20 @@
     
     # resolve the file path
     file <- normalizePath(file, winslash = "/")
+    
+    # validate that there are no spaces in the path on windows
+    if (.Platform$OS.type == "windows") {
+        if (grepl(' ', path.package("Rcpp"), fixed=TRUE)) {
+            stop("Rcpp is installed within a package library that has spaces ",
+                 "in it's path (", path.package("Rcpp"), "). Rcpp cannot be ",
+                 "built against in this configuration. Please re-install ",
+                 "Rcpp in a package library without spaces in it's path.")
+        }
+        if (grepl(' ', basename(file), fixed=TRUE)) {
+            stop("The filename '", basename(file), "' contains spaces. This ",
+                 "is not permitted.")
+        }
+    }
      
     # get the context (does code generation as necessary)
     context <- .Call("sourceCppContext", PACKAGE="Rcpp", 

Modified: pkg/Rcpp/TODO
===================================================================
--- pkg/Rcpp/TODO	2013-01-13 11:42:47 UTC (rev 4203)
+++ pkg/Rcpp/TODO	2013-01-13 12:07:12 UTC (rev 4204)
@@ -114,8 +114,6 @@
 
     o   Allow sourceCpp to build an entire directory
 
-    o   Warn user if Rpp library or source file has spaces in it's path
-
     o   Use source directory as build working directory so that a) error
         messages refer to the correct file; and b) local includes work
 



More information about the Rcpp-commits mailing list