Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork219
Additional file path normalization to protect a windows path#1235
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
eddelbuettel commentedOct 12, 2022
While at it, do we need more |
kevinushey commentedOct 12, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I don't think this is the right fix. Here's what I see on my Windows VM: In other words, A cross-platform fix would be to use |
eddelbuettel commentedOct 12, 2022
Very good. Can you recurse into the discussion in#1234 and see with OP? What I suggested works for him there ... |
eddelbuettel commentedOct 12, 2022
"Empirically speaking" this is a rare case anyway as we had a bazillion uses of |
eddelbuettel commentedOct 12, 2022
Here is the whole block (as I currently have i.e. with the PR). There is a # grab components we need to build commandr<- normalizePath(file.path(R.home("bin"),"R"),winslash="/",mustWork=FALSE)lib<-context$dynlibFilenamedeps<-context$cppDependencySourcePathssrc<-context$cppSourceFilename# prepare the command (output if we are in showOutput mode)args<- c(r,"CMD","SHLIB",if (windowsDebugDLL)"-d",if (rebuild)"--preclean",if (dryRun)"--dry-run","-o", shQuote(lib),if (length(deps)) paste(shQuote(deps),collapse=""), shQuote(src) )cmd<- paste(args,collapse="")if (showOutput) cat(cmd,"\n")# #nocov# execute the build -- suppressWarnings b/c when showOutput = FALSE# we are going to explicitly check for an error and print the outputresult<- suppressWarnings(system(cmd,intern=!showOutput)) |
kevinushey commentedOct 12, 2022
I'm surprised too, to be honest. That said, if there really was an issue affecting Windows users en-masse we surely would've heard a lot more about it by now! |
eddelbuettel commentedOct 12, 2022
Yep! All I can think of is that OP's use case of Given the above I have less appetite for switching wholesale to Lunch time here in flyover country. Will ponder ... |
kirimaru-jp commentedOct 12, 2022
Really sorry, it was my mistake. I changed some code after that to debug, and forgot to restore the original code.
|
eddelbuettel commentedOct 12, 2022
Ah, no worries, and extra brownie points to@kevinushey for catching this. I will amend and (conditionally on being on Windows) wrap |
eddelbuettel commentedOct 12, 2022
Can you please try with these two lines r<- file.path(R.home("bin"),"R")if (.Platform$OS.type=="windows")r<- shQuote(r) in lieu of the faulty one you indentified? |
kirimaru-jp commentedOct 12, 2022
It worked perfectly! |
kirimaru-jp commentedOct 12, 2022
I did not see the short path like yours, here is mine: I checked the help page of
I followed thislink, and run this command It means that (at least on my Windows) the 8.3 short form is enabled only "per volume on the system", which I guess it means it isonly enabled for the system drive C by default, while I installed R in D. |
eddelbuettel commentedOct 12, 2022
It's brilliant because the (underappreciated) 'R on Windows FAQ' has recommended for 20-some years to not do that: install in a path with space. Yet R always did, up until the 4.2.* series which (IIRC) finally converted that. I have not worked on Windows in many years so I am a little removed from that. And agreed on the D:/ vs C:/ difference here -- and that is likely why we generally have not seen this issue bubble up. |
eddelbuettel commentedOct 13, 2022
We (informally) had a review here as@kevinushey spotted a thinko on my part but if anyone has a moment for a more 'formal' review and tick-off I'd appreciate it -- cleaner than me pushing through with a merge. |
Enchufa2 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM!
Motivation
Issue#1234 demonstrated that we had a left-over non-normalized path, this PR addresses this.
Checklist
R CMD checkstill passes all tests