Description
Installing dependencies fails on my local Windows environment with dev version of devtools
package.
devtools::install_github("sinhrks/ggfortify", dependencies = TRUE, force = TRUE)
#> Downloading GitHub repo sinhrks/ggfortify@master
#> from URL https://api.github.com/repos/sinhrks/ggfortify/zipball/master
#> Installing ggfortify
#> trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/dlm_1.1-4.zip'
#> Content type 'application/zip' length 550878 bytes (537 KB)
#> downloaded 537 KB
#>
#> Installing dlm
#> "C:/PROGRA~1/R/R-33~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
#> "C:/Users/user1/AppData/Local/Temp/RtmpCcjLkl/devtools251477d67687/dlm" --library="C:/Users/user1/Documents/R/win-library/3.3" \
#> --install-tests
#>
#> * installing *binary* package 'dlm' ...
#> cp: unknown option -- )
#> Try '/usr/bin/cp --help' for more information.
#> Warning: running command 'cp -R . "C:/Users/user1/Documents/R/win-library/3.3/dlm" || ( internal cd - .| (cd "C:/Users/user1/Documents/R/win-library/3.3/dlm" && internal -xf -))' had status 1
#> ERROR: installing binary package failed
#> * removing 'C:/Users/user1/Documents/R/win-library/3.3/dlm'
#> Error: Command failed (1)
I've dived into the R source code. This code
Warning: running command 'cp -R . "C:/Users/user1/Documents/R/win-library/3.3/dlm" || ( internal cd - .| (cd "C:/Users/user1/Documents/R/win-library/3.3/dlm" && internal -xf -))' had status 1
is from around here.
res <- system(paste("cp -R .", shQuote(instdir),
"|| (", TAR, "cd - .| (cd", shQuote(instdir), "&&", TAR, "-xf -))"
))
But it says this do_install_binary()
is for Unix only. This means something is wrong that this part of code is executed on Windows platform.
The correct way of installing binary packages on Windows platform seems to be using ZIP archive without decompressing. I suspect the problem is that install_remote()
does not follow the way; it seems to ALWAYS decompress()
package archives, around here
Could you consider adding condition branch for Windows?
Session info:
sessionInfo()
#> R version 3.3.0 (2016-05-03)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows >= 8 x64 (build 9200)
#>
#> locale:
#> [1] LC_COLLATE=Japanese_Japan.932 LC_CTYPE=Japanese_Japan.932 LC_MONETARY=Japanese_Japan.932 LC_NUMERIC=C
#> [5] LC_TIME=Japanese_Japan.932
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] httr_1.1.0 R6_2.1.2 tools_3.3.0 withr_1.0.1 curl_0.9.7 memoise_1.0.0
#> [7] git2r_0.15.0 digest_0.6.9 devtools_1.11.1.9000