Skip to content

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

Closed

Description

@yutannihilation

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

Activity

  1. jimhester commented on May 25, 2016

    @jimhester
    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.

  2. yutannihilation commented on May 25, 2016

    @yutannihilation
    Author

    Thanks!

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

  3. added this to the 1.12.0 milestone on Jun 2, 2016
  4. hadley commented on Jun 2, 2016

    @hadley
    Member

    Fixed by #1192

  5. yutannihilation commented on Jun 2, 2016

    @yutannihilation
    Author

    I've confirmed. Thanks! 👍

  6. saritha080 commented on Jun 19, 2017

    @saritha080

    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?

  7. hariramn commented on Nov 6, 2017

    @hariramn

    Hi @saritha080 any luck resolving this?

  8. lock commented on Sep 17, 2018

    @lock

    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/

  9. locked and limited conversation to collaborators on Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions