-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix handling of whitespace in Makevars filename #160
Conversation
I think I would prefer to handle this by unconditionally surrounding the paths in single quotes at Line 156 in 44b309a
Also can you please add a bullet to NEWS? It should briefly describe the change and end with |
How’s this? |
Looks good except that windows apparently can't handle the single quotes 🙈 We could try double quotes, though then I worry POSIX systems will interpolate variables in them. I guess we might have to live with the backslashes... |
What about |
Sure, |
Hmm. The check failure on Windows (release) seems unrelated (?). But it still fails on Windows (3.6). :-( |
I’m not entirely sure what the issue is but it seems that Make on Windows doesn’t like double quotes. So, should I revert back to the first version (escape whitespace with backslashes)? (If that’s alright I’ll push a new commit rather than amending and force-pushing — when squashing the PR the effect would be the same.) |
Yeah, we can revert back to using backslashes and I will squash this before merging. |
Alright, back to escaping whitespace. And I noticed that my original version actually didn’t escape anything (oops!), since … but I’m wondering if this should be caught by a unit test. Unfortunately the only way to test this that I can think of is to create a copy of the whole repo during testing (and put it into a path with spaces), which feels like overkill. … Maybe with vendoring? |
In f6f8772 we accidently were calling shQuote twice on windows, which is why it failed.
Looking at this again I think the problem with f6f8772 is you were accidentily calling |
Also at least on my macOS system |
Oh wow, I completely missed that. Thanks for spotting that, and for adding the tests.
Yes, that symlink is always there and I fall back to it when I need to — but by default I use the canonical path intentionally to flush out just this kind of issue during development. There are actually very few issues: In my experience, Make is the only modern, widely used tool that doesn’t support spaces. |
This PR adds escaping of spaces in path names that are written to the
Makevars
file used by ‘cpp11’ for compilation.I came across this issue because I’m keeping my R package library on macOS in the standard config location, which is
~/Library/Application Support
(note the space). Since ‘cpp11’ adds its own installation directory to the include path, this consequently causes an error when invoking e.g.cpp_source()
, which looks as follows: