Closed richfitz closed 3 years ago
Weirdly, even this doesn't work:
tt <- obj$enqueue({
Sys.setenv(PATH=paste0("\\\\fi--didef2\\tmp\\Rtools\\Rtools33\\bin;",
Sys.getenv("PATH")))
Sys.which("ls")})
tt$wait(100)
Still finding the windows one. But the Rtools ls
does work if called directly....
I bet this is a system specific thing actually.
Scanning through the R source, looks like Sys.which
on windows goes through do_syswhich
(src/gnuwin32/run.c
) which calls expandcmd
(same file) which passes off to the windows API function SearchPath
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365527(v=vs.85).aspx
That function says that the system path is searched first, which is also the case in this old KB article
How the path is built
The Path is constructed from the system path, which can be viewed in the System Environment Variables field in the System dialog box. The User path is appended to the system path. Then the path from the AUTOEXEC.BAT file is appended.
noone has reported this recently and stan has changed how it does compiler detections a bajillionty times
rstan's rtools detection does not seem to pick up Rtools in the location that we put it.
It finds gcc in
T:\Rtools\Rtools33\gcc-4.6.3\bin
but findsls
inC:'\windows
so rstan gives a warning that it can't be found. HoweverPATH
seems correct as