Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing dependencies fails on Windows (which occurs with dev version) #1191

Closed
yutannihilation opened this issue May 25, 2016 · 7 comments
Milestone

Comments

@yutannihilation
Copy link

yutannihilation commented May 25, 2016

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
@jimhester
Copy link
Member

I feel like this is really a bug / shortcoming in R, in that you cannot install binary package on Windows once it is extracted.

dest <- download.packages("zoo", tempdir(), type = "win.binary")[,2]
unzip(dest, exdir = tempdir())
install.packages(file.path(tempdir(), "zoo"), repos = NULL, type = 'source')
#> Installing package into 'C:/library'
#> (as 'lib' is unspecified)
#> Warning in install.packages :
#>   running command '"C:/PROGRA~1/R/R-33~1.0/bin/x64/R" CMD INSTALL -l "C:\library" "C:/pkg/temp/RtmpU7RZbU/zoo"' had status 1
#> Warning in install.packages :
#>   installation of package 'C:/pkg/temp/RtmpU7RZbU/zoo' had non-zero exit status

Nonetheless #1192 fixes your example and should fix the issue.

@yutannihilation
Copy link
Author

yutannihilation commented May 25, 2016

Thanks!

I feel the same as you. This is more like a bug in R...

@hadley hadley added this to the 1.12.0 milestone Jun 2, 2016
@hadley
Copy link
Member

hadley commented Jun 2, 2016

Fixed by #1192

@hadley hadley closed this as completed Jun 2, 2016
@yutannihilation
Copy link
Author

yutannihilation commented Jun 2, 2016

I've confirmed. Thanks! 👍

@saritha080
Copy link

Im trying to install SparkR on 64 bit windows with R3.3.2. Facing the same error while trying to install SparkR through devtools from command line as:

%SPARK_HOME%\R\lib\SparkR>R -e "devtools::install ('.')"

Warning: running command 'cp -R . "C:/Users/HP/Documents/R/win-library/3.3/Spark
R" || ( internal cd - .| (cd "C:/Users/HP/Documents/R/win-library/3.3/SparkR" &&
internal -xf -))' had status 1
ERROR: installing binary package failed

  • removing 'C:/Users/HP/Documents/R/win-library/3.3/SparkR'
    Error: Command failed (1)
    Execution halted

I read the previous posts where this seems to be fixed. Which release is this available? How can I continue with my installation?

@hariramn
Copy link

hariramn commented Nov 6, 2017

Hi @saritha080 any luck resolving this?

@lock
Copy link

lock bot commented Sep 17, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Sep 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants