From r-devel at akersting.de  Fri Jan 26 20:39:27 2018
From: r-devel at akersting.de (Andreas Kersting)
Date: Fri, 26 Jan 2018 20:39:27 +0100
Subject: [Rd] utils::install.packages with quiet=TRUE fails for source
 packages on Windows
In-Reply-To: <26EDE174-CE20-4570-A2A5-F147A8E696EF@gmail.com>
References: <12f4f428-a424-404b-eee4-e01af07758c3@akersting.de>
 <bd80b1f7-2f97-1640-3550-8dd14be2bf7b@akersting.de>
 <26EDE174-CE20-4570-A2A5-F147A8E696EF@gmail.com>
Message-ID: <d3c64a9d-34e4-1a12-4a8a-593826a5b430@akersting.de>

I have filed a bug report here: 
https://github.com/rstudio/rstudio/issues/2070

-------- Original Message --------
From: peter dalgaard [mailto:pdalgd at gmail.com]
Sent: Friday, Jan 26, 2018 10:15 AM GMT
To: Andreas Kersting
Cc: r-devel at r-project.org
Subject: [Rd] utils::install.packages with quiet=TRUE fails for source 
packages on Windows

> The obvious guess would be that Rstudio is attempting something like redirecting output and getting itself confused. However, it is pretty clearly Their Problem, no? Rstudio has their own support infrastructure.
> 
> -pd
> 
> 
>> On 26 Jan 2018, at 09:17 , Andreas Kersting <r-devel at akersting.de> wrote:
>>
>> Just noticed that this problem only occurs from within RStudio (v1.1.414). Any ideas why?
>>
>> Am 26.01.2018 um 08:56 schrieb Andreas Kersting:
>>> Hi,
>>> Installing a source package on Windows using utils::install.packages() with quiet=TRUE fails, while it works with the default quiet = FALSE. The problem seems to be caused by the fact that when quiet = TRUE, stdout and stderr are set to FALSE when calling "R CMD INSTALL" with base::system2() here: https://github.com/wch/r-source/blob/tags/R-3-4-3/src/library/utils/R/packages2.R#L660-L661.
>>>> trace(base::system2, quote(print(ls.str())))
>>> Tracing function "system2" in package "base"
>>> [1] "system2"
>>>> utils::install.packages("partDF_1.0.0.9001.tar.gz", repos = NULL, lib
>>> = tempdir(), quiet = TRUE)
>>> Tracing system2(cmd0, args, env = env, stdout = output, stderr = output) on entry
>>> args :  chr [1:5] "CMD" "INSTALL" "-l" "\"C:\\Users\\askers\\AppData\\Local\\Temp\\RtmpoRb97l\"" ...
>>> command :  chr "C:/PROGRA~1/R/R-34~1.3/bin/x64/R"
>>> env :  chr(0)
>>> input :  NULL
>>> invisible :  logi TRUE
>>> minimized :  logi FALSE
>>> stderr :  logi FALSE
>>> stdin :  chr ""
>>> stdout :  logi FALSE
>>> wait :  logi TRUE
>>> Warning messages:
>>> 1: running command '"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\askers\AppData\Local\Temp\RtmpoRb97l" "partDF_1.0.0.9001.tar.gz"' had status 1
>>> 2: In utils::install.packages("partDF_1.0.0.9001.tar.gz", repos = NULL,  :
>>>    installation of package 'partDF_1.0.0.9001.tar.gz' had non-zero exit status
>>>> utils::install.packages("partDF_1.0.0.9001.tar.gz", repos = NULL, lib
>>> = tempdir(), quiet = FALSE)
>>> Tracing system2(cmd0, args, env = env, stdout = output, stderr = output) on entry
>>> args :  chr [1:5] "CMD" "INSTALL" "-l" "\"C:\\Users\\askers\\AppData\\Local\\Temp\\RtmpoRb97l\"" ...
>>> command :  chr "C:/PROGRA~1/R/R-34~1.3/bin/x64/R"
>>> env :  chr(0)
>>> input :  NULL
>>> invisible :  logi TRUE
>>> minimized :  logi FALSE
>>> stderr :  chr ""
>>> stdin :  chr ""
>>> stdout :  chr ""
>>> wait :  logi TRUE
>>> * installing *source* package 'partDF' ...
>>> ** libs
>>> c:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG         -O2 -Wall  -std=gnu99 -mtune=generic -c partDF.c -o partDF.o
>>> c:/Rtools/mingw_64/bin/gcc -shared -s -static-libgcc -o partDF.dll tmp.def partDF.o -LC:/PROGRA~1/R/R-34~1.3/bin/x64 -lR
>>> installing to C:/Users/askers/AppData/Local/Temp/RtmpoRb97l/partDF/libs/x64
>>> ** R
>>> ** inst
>>> ** byte-compile and prepare package for lazy loading
>>> ** help
>>> *** installing help indices
>>>    converting help for package 'partDF'
>>>      finding HTML links ... done
>>>      anti_glob                               html
>>>      partDF                                  html
>>>      read_partDF                             html
>>>      write_partDF                            html
>>> ** building package indices
>>> ** testing if installed package can be loaded
>>> * DONE (partDF)
>>> In R CMD INSTALL
>>>> sessionInfo()
>>> R version 3.4.3 (2017-11-30)
>>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>>> Running under: Windows >= 8 x64 (build 9200)
>>> Matrix products: default
>>> locale:
>>> [1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252
>>> [4] LC_NUMERIC=C                    LC_TIME=German_Germany.1252
>>> attached base packages:
>>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>> loaded via a namespace (and not attached):
>>> [1] compiler_3.4.3 tools_3.4.3    yaml_2.1.16
>>> This problem is also there when installing source packages from CRAN:
>>>> utils::install.packages("mvtnorm", lib = tempdir(), quiet = TRUE)
>>>    There is a binary version available but the source version is later:
>>>          binary source needs_compilation
>>> mvtnorm  1.0-6  1.0-7              TRUE
>>> Do you want to install from sources the package which needs compilation?
>>> y/n: y
>>> installing the source package 'mvtnorm'
>>> Tracing system2(cmd0, args, env = env, stdout = outfile, stderr = outfile) on entry
>>> args :  Named chr [1:5] "CMD" "INSTALL" "-l" "\"C:\\Users\\askers\\AppData\\Local\\Temp\\RtmpoRb97l\"" ...
>>> command :  chr "C:/PROGRA~1/R/R-34~1.3/bin/x64/R"
>>> env :  chr(0)
>>> input :  NULL
>>> invisible :  logi TRUE
>>> minimized :  logi FALSE
>>> stderr :  logi FALSE
>>> stdin :  chr ""
>>> stdout :  logi FALSE
>>> wait :  logi TRUE
>>> Warning messages:
>>> 1: running command '"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\askers\AppData\Local\Temp\RtmpoRb97l" C:\Users\askers\AppData\Local\Temp\RtmpoRb97l/downloaded_packages/mvtnorm_1.0-7.tar.gz' had status 1
>>> 2: In utils::install.packages("mvtnorm", lib = tempdir(), quiet = TRUE) :
>>>    installation of package 'mvtnorm' had non-zero exit status
>>> I do not encounter this problem on my Linux machine.
>>> Andreas
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] utils::install.packages with quiet=TRUE fails for source packages on Windows
Andreas Kersting