-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
CxxFlags (and friends) should quote their library paths on Unix #1188
Comments
I was ready to bet that we protected just about every possible path (because we relied so heavily on this with So I would strongly urge packages like We somewhat actively discourage the LDFLAGS equivalent to the one you dug up. I think I once looked into putting a |
That's a good point -- and |
I have no problem with us being good samaritans and offer a helping hand so the PR idea is still good ... but some packages should also face reality. It is 2021. We have not needed CxxFlags since 2013. It persists because it got copied out of skeleton packages and of course older tutorials so we're not turning it off or removing it (unlike <cough, cough> some other frameworks) but it really should be changed at their end. Now, your PS Also, I probably meant third decade. Programmers and one-off errors and all that... |
Originally filed from here: rstudio/renv#862
The ultimate issue is that
Rcpp:::CxxFlags()
doesn't quote the include path used, so packages installed into a path containing spaces (I know, I know...) won't be propagated to the compiler correctly. For example:gives me, on macOS:
Note that the include path is not quoted, which implies that installing other packages from sources which try to use
Rcpp:::CxxFlags()
will fail. For example, withinstall.packages("scrypt", type = "source")
:The
scrypt
package has this in its Makevars:I can't see where Rcpp officially documents how
CxxFlags()
should be used, other than some examples via environment variables in e.g.but I think this is the correct way to invoke the function (that is, the onus is not on the user to try and quote whatever is returned by
Rcpp:::CxxFlags()
).Rcpp has a function called
asBuildPath()
, which is intended to create paths that are more easily consumed by the compiler / linker. It is defined here:Rcpp/R/tools.R
Lines 35 to 50 in 2868f38
We use that, and quote the returned path in a number of spots, e.g. (note the use of
"
around the path)Rcpp/R/Attributes.R
Lines 869 to 880 in 2868f38
But we don't quote it here:
Rcpp/R/RcppLdpath.R
Lines 48 to 56 in 2868f38
My proposal is that we quote the path in the above routine.
The text was updated successfully, but these errors were encountered: