Why is R using system tar, not Rtools tar?

I'm trying to debug why I'm suddenly getting the error

tar.exe: Error exit delayed from previous errors.

on running install_github, after updating to Windows 10 2004. Thinking there might be a problem with the tar program, I came across this oddity:

> Sys.getenv("PATH")
[1] "C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\CLI2\\wbin;C:\\Rtools\\bin;

> Sys.which("tar")

> file.exists("C:\\Rtools\\bin\\tar.exe")
[1] TRUE

Why is R using the system tar, as opposed to the Rtools-supplied tar, when the Rtools directory is earlier in the path?

OS is Windows 10 2004 (build 19041.330), R 4.0.0.

1 Like

Turns out this is a known issue:

system and Sys.which behave this way because that's what the Win32 SearchPath function does.

The error (really a warning) in this case was because the repo contained a symlink, which tar (both versions) complains about on Windows.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.