daqana / dqrng

Fast Pseudo Random Number Generators for R
https://daqana.github.io/dqrng/
Other
42 stars 8 forks source link

Cannot install on Windows because of symlink #76

Open plietar opened 9 months ago

plietar commented 9 months ago

PR #62 added a symbolic link from include to inst/include.

Unfortunately I cannot get dqrng to install on WIndows anymore, since it seems symbolic links on Windows require admin permissions.

I added this repository to my Remotes in DESCRIPTION:

Remotes:
  daqana/dqrng

See the CI run here: https://github.com/mrc-ide/malariasimulation/actions/runs/7726106082/job/21061725003

Downloading GitHub repo daqana/dqrng@HEAD
sitmo (NA -> 2.0.2   ) [CRAN]
BH    (NA -> 1.84.0-0) [CRAN]
Installing 2 packages: sitmo, BH
Installing packages into 'D:/a/_temp/Library'
(as 'lib' is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.3/sitmo_2.0.2.zip'
Content type 'application/zip' length 585033 bytes (571 KB)
==================================================
downloaded 571 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.3/BH_1.84.0-0.zip'
Content type 'application/zip' length 21468566 bytes (20.5 MB)
==================================================
downloaded 20.5 MB

package 'sitmo' successfully unpacked and MD5 sums checked
package 'BH' successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\runneradmin\AppData\Local\Temp\RtmpW41gcK\downloaded_packages
── R CMD build ─────────────────────────────────────────────────────────────────
* checking for file 'C:\Users\runneradmin\AppData\Local\Temp\RtmpW41gcK\remotesd842c9b3950\daqana-dqrng-dcaaa0e/DESCRIPTION' ... OK

Warning in file.copy(pkgname, Tdir, recursive = TRUE, copy.date = TRUE) :

  problem copying .\daqana-dqrng-dcaaa0e\include to C:\Users\RUNNER~1\AppData\Local\Temp\RtmpOKpL14\Rbuild1bc43a887ed3\daqana-dqrng-dcaaa0e\include: Permission denied

 ERROR

copying to build directory failed

Error: Error: Failed to install 'dqrng' from GitHub:
  ! System command 'Rcmd.exe' failed
Execution halted
Error: Process completed with exit code 1.

Honestly I don't really understand WIndows' support for symlinks, or how the repo could even have been cloned in the first place.

rstub commented 9 months ago

This is odd. I don't understand this since the package is tested regularly on Windows via GHA. But I don't have a Windows environment at the moment, so it is difficult to debug. As potential workaround: Can you remove daqana/dqrng from Remotes and add

Additional_repositories: https://rstub.r-universe.dev

instead?

plietar commented 8 months ago

Sorry for the delayed response. Using the Additional_repositories syntax works without any issues, thanks! I'm guessing the released tarball on r-universe does not contain that symbolic link anymore.

I finally managed to get my hands on a windows machine to try and reproduce the original issue I'd seen on CI, installing from the Git repository again. Oddly enough I get a similar message but only as a warning, not a hard error:

> remotes::install_github("daqana/dqrng")
Downloading GitHub repo daqana/dqrng@HEAD
daqana-dqrng-dcaaa0e/include: Can't create '\\\\?\\C:\\Users\\pl2113\\AppData\\Local\\Temp\\6\\RtmpwReeHJ\\remotes14e03c0d547\\daqana-dqrng-dcaaa0e\\include'
tar.exe: Error exit delayed from previous errors.
-- R CMD build ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
         checking for file 'C:\Users\pl2113\AppData\Local\Temp\6\RtmpwReeHJ\remotes14e03c0d547\daqana-dqrng-dcaaa0e/DESCRIPTION' ...     checking for file 'C:\Users\pl2113\AppData\Local\Temp\6\RtmpwReeHJ\remotes14e03c0d547\daqana-dqrng-dcaaa0e/DESCRIPTION' ...   v  checking for file 'C:\Users\pl2113\AppData\Local\Temp\6\RtmpwReeHJ\remotes14e03c0d547\daqana-dqrng-dcaaa0e/DESCRIPTION'
      -  preparing 'dqrng':
   checking DESCRIPTION meta-information ...     checking DESCRIPTION meta-information ...   v  checking DESCRIPTION meta-information
-  cleaning src
  -  running 'cleanup.win'
      -  checking for LF line-endings in source and make files and shell scripts
      -  checking for empty or unneeded directories
      -  building 'dqrng_0.3.2.2.tar.gz'
  Warning:     Warning: file 'dqrng/cleanup' did not have execute permissions: corrected

* installing *source* package 'dqrng' ...
** using staged installation
** libs
g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I../inst/include -DSTRICT_R_HEADERS -I'C:/Program Files/R/R-4.2.2/library/Rcpp/include' -I'C:/Program Files/R/R-4.2.2/library/BH/include' -I'C:/Program Files/R/R-4.2.2/library/sitmo/include'   -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I../inst/include -DSTRICT_R_HEADERS -I'C:/Program Files/R/R-4.2.2/library/Rcpp/include' -I'C:/Program Files/R/R-4.2.2/library/BH/include' -I'C:/Program Files/R/R-4.2.2/library/sitmo/include'   -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c dqrng.cpp -o dqrng.o
g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I../inst/include -DSTRICT_R_HEADERS -I'C:/Program Files/R/R-4.2.2/library/Rcpp/include' -I'C:/Program Files/R/R-4.2.2/library/BH/include' -I'C:/Program Files/R/R-4.2.2/library/sitmo/include'   -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c generateSeedVectors.cpp -o generateSeedVectors.o
g++ -std=gnu++11 -shared -s -static-libgcc -o dqrng.dll tmp.def RcppExports.o dqrng.o generateSeedVectors.o -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-42~1.2/bin/x64 -lR
installing to C:/Program Files/R/R-4.2.2/library/00LOCK-dqrng/00new/dqrng/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (dqrng)
Warning message:
In utils::untar(tarfile, ...) :
  ‘tar.exe -xf "C:\Users\pl2113\AppData\Local\Temp\6\RtmpwReeHJ\file14e076095cbc.tar.gz" -C "C:/Users/pl2113/AppData/Local/Temp/6/RtmpwReeHJ/remotes14e03c0d547"’ returned error code 1

I can use the package just fine afterwards. I'm not sure why I am not getting the same behaviour as on CI, could be down to a difference in Windows version (I think GitHub Actions uses Windows Server 2022, whereas my machine runs 2019), or in user permissions.

I don't know whether you want to take any further action or not on this issue. Personally don't intend on doing any development on dqrng from a WIndows and the Additional_repositories workaround is fine for me. Feel free to close the issue if you think the status quo is acceptable.

rstub commented 6 months ago

Anybody with a Windows dev environment interested in investigating this?