Skip to content

Install should fail if there's an error copying DLL on Windows #113

@wch

Description

@wch

If a package is currently loaded on Windows and you try to install over it, some of the files will be copied over, but the DLL will not.

Real-world example here: r-lib/scales#101

To reproduce:

> library(scales)
> remotes::install_github("hadley/scales")
Downloading GitHub repo hadley/scales@master
Installing package into ‘C:/Users/IEUser/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
* installing *source* package 'scales' ...
** libs

*** arch - i386
c:/Rtools/mingw_32/bin/g++  -I"C:/PROGRA~1/R/R-34~1.0/include" -DNDEBUG  -I"C:/Users/IEUser/Documents/R/win-library/3.4/Rcpp/include"   -I"d:/Compiler/gcc-4.9.3/local330/include"     -O2 -Wall  -mtune=core2 -c RcppExports.cpp -o RcppExports.o
c:/Rtools/mingw_32/bin/g++  -I"C:/PROGRA~1/R/R-34~1.0/include" -DNDEBUG  -I"C:/Users/IEUser/Documents/R/win-library/3.4/Rcpp/include"   -I"d:/Compiler/gcc-4.9.3/local330/include"     -O2 -Wall  -mtune=core2 -c colors.cpp -o colors.o
c:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o scales.dll tmp.def RcppExports.o colors.o -Ld:/Compiler/gcc-4.9.3/local330/lib/i386 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-34~1.0/bin/i386 -lR
installing to C:/Users/IEUser/Documents/R/win-library/3.4/scales/libs/i386

*** arch - x64
c:/Rtools/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-34~1.0/include" -DNDEBUG  -I"C:/Users/IEUser/Documents/R/win-library/3.4/Rcpp/include"   -I"d:/Compiler/gcc-4.9.3/local330/include"     -O2 -Wall  -mtune=core2 -c RcppExports.cpp -o RcppExports.o
c:/Rtools/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-34~1.0/include" -DNDEBUG  -I"C:/Users/IEUser/Documents/R/win-library/3.4/Rcpp/include"   -I"d:/Compiler/gcc-4.9.3/local330/include"     -O2 -Wall  -mtune=core2 -c colors.cpp -o colors.o
c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o scales.dll tmp.def RcppExports.o colors.o -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-34~1.0/bin/x64 -lR
installing to C:/Users/IEUser/Documents/R/win-library/3.4/scales/libs/x64
Warning in file.copy(files, dest, overwrite = TRUE) :
  problem copying .\scales.dll to C:\Users\IEUser\Documents\R\win-library\3.4\scales\libs\x64\scales.dll: Permission denied
** R
** preparing package for lazy loading
** help
Loading required package: scales
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (scales)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions