[R-pkg-devel] Odd R CMD build behaviour on Windows

Imanuel Costigan i@co@tig@n @ending from me@com
Fri Dec 28 01:41:13 CET 2018


Hi all

[Originally posted on R-help which is probably not the right place - hence no response?]

I am finding that on Windows 10:

* the archive file produced by R (i386) CMD build command saves the resulting archive file in the present working directory 
* ...BUT the archive produced by the R (x64) CMD build command is **not** saved in the present working directory. Instead it is saved in the file path produced by `paste0(Sys.getenv("HOMEDRIVE"), Sys.getenv("HOMEPATH"))` or `Sys.getenv("HOMESHARE")` (the former resolves to H:\ which is an alias for the latter). This path is not represented in any other environment variables returned by Sys.getenv()

This behaviour persists for R-3.5.1 (formally release) and R-3.4.4. It also persists after I uninstall R and Rtools and then clean reinstall R-3.4.4 and R-3.5.1.

Has anyone else had this issue? Or tips on what might be causing this? Alternatively a pointer to the part of the R source code that determines the output directory for R CMD build would be much appreciated. 

I am running these commands in Powershell using the following commands:

Thanks.

```
& 'C:\R\R-3.5.1\bin\x64\R.exe' --no-site-file --no-environ --no-save --no-restore --quiet CMD build "C:\users\XXXX\Coding\testpackage\" --no-resave-data --no-manual

# Archive is **not** saved in present working directory, but saved to H:\

& 'C:\R\R-3.5.1\bin\i386\R.exe' --no-site-file --no-environ --no-save --no-restore --quiet CMD build "C:\users\XXXX\Coding\testpackage\" --no-resave-data --no-manual

# Archive is saved in present working directory.
```


More information about the R-package-devel mailing list