r-lib / zip

Platform independent zip compression via miniz
https://r-lib.github.io/zip/
Other
83 stars 19 forks source link

Cannot download the package because of the executable file "cmdunzip.exe" #49

Closed rosinnia closed 4 years ago

rosinnia commented 4 years ago

Our corporate policy prevents downloading any zip folder with executable file (i.e., cmdzip.exe). Any suggestion to get around this (of course not to ask my company to change the policy for me)? I have also tried to install the source file "zip_2.0.4.tar" but got the following error message: arch - i386 c:/Rtools/mingw_32/bin/gcc -O3 -Wall -std=gnu99 -mtune=generic miniz.c zip.c tools/cmdzip.c -o tools/cmdzip.exe make: c:/Rtools/mingw_32/bin/gcc: Command not found make: [Makevars.win:9: tools/cmdzip.exe] Error 127 ERROR: compilation failed for package 'zip'

It seemed to me that this also had something to do with the "cmdzip.exe" file. Thanks!

gaborcsardi commented 4 years ago

To install the source package, you need Rtools (https://cran.r-project.org/bin/windows/Rtools/) But this is also an exe file, so you probably can't install it. :(

I'll think about how we could work around having an .exe in the zip binary package....

gaborcsardi commented 4 years ago

Do you think you would be able to download the file if we just renamed cmdzip.exe to something else? Do you have a way to try that?

rosinnia commented 4 years ago

Thanks a lot for following up! I found a solution to this one. It turned out that my company had an internal website loading all these packages inside the firewall. I think the name change might benefit some of the others who had a similar firewall issue as what I had run into. It might be worth trying. Please let me know if you want me to test it once the name is changed.

Thanks, Hua

Get Outlook for Androidhttps://aka.ms/ghei36


From: Gábor Csárdi notifications@github.com Sent: Friday, May 8, 2020 6:29:06 AM To: r-lib/zip zip@noreply.github.com Cc: rosinnia rosinnia@hotmail.com; Author author@noreply.github.com Subject: Re: [r-lib/zip] Cannot download the package because of the executable file "cmdunzip.exe" (#49)

Do you think you would be able to download the file if we just renamed cmdzip.exe to something else? Do you have a way to try that?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/r-lib/zip/issues/49#issuecomment-625750785, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APA2PPJMHTXDG5P66RUPXQDRQPNHFANCNFSM4LZUQ7BQ.

AshesITR commented 4 years ago

An alternative approach to unzip_process and zip_process would be using the R functions in a new R process using callr. This would eliminate the need for executables altogether at the cost of a little overhead of starting up R instead of a minimal tool.

gaborcsardi commented 4 years ago

The whole point of them is to avoid the startup overhead. Which is 300-500ms, and very significant if you need to uncompress ~100 zip files, e.g. when installing R packages.

AshesITR commented 4 years ago

I see. Vectorisation of unzip would solve that, no? Something along unzip(list.files("zips", pattern = "\\.zip$"), exdir = "out") to extract all zips to the same location and unzip(c("z1.zip", "z2.zip"), exdir = c("o1", "o2")) for differing locations.

gaborcsardi commented 4 years ago

No, it would not, because we also want to run the unzip subprocesses in parallel.

gaborcsardi commented 4 years ago

I am going to close this now, until this comes up again. It might be so rare that it is not worth spending time on it.

rosinnia commented 4 years ago

Thanks for following up. Yeah, agreed.

Hua

Get Outlook for Androidhttps://aka.ms/ghei36


From: Gábor Csárdi notifications@github.com Sent: Wednesday, July 8, 2020 8:07:24 PM To: r-lib/zip zip@noreply.github.com Cc: rosinnia rosinnia@hotmail.com; Author author@noreply.github.com Subject: Re: [r-lib/zip] Cannot download the package because of the executable file "cmdunzip.exe" (#49)

I am going to close this now, until this comes up again. It might be so rare that it is not worth spending time on it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/r-lib/zip/issues/49#issuecomment-655820038, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APA2PPIIG3CIEW2SPZLBDHTR2UC3ZANCNFSM4LZUQ7BQ.

nigeldoyle commented 2 years ago

So... I think this is related. The current (2.2.0) package tries to go off and install zip.exe directly from github. Our web gateway/proxy/firewall blocks this (well, technically it pushes a web user via a "are you sure you want to go against company policy?" screen before allowing) and therefore even if I download the package and install from a local file, it still relies on an internet connection... Is there a way around this? I CAN download the 'https://github.com/rwinlib/zip/blob/master/zip.exe?raw=true' file myself manually, but of course I can't then force the install to look at my local download... can I?

I am more than happy to accept a workaround, but currently this inability to install zip is stopping me from installing the very useful package "usethis", as zip is a dependency of that! I'm afraid I'm too ignorant on packages to know whether there's an option set I can use to avoid this...

gaborcsardi commented 2 years ago

Can you install the binary build of zip?

nigeldoyle commented 2 years ago

Thanks for the speedy response! Sadly not:

install.packages(".../R-model/zip_2.2.0.zip") Installing zip [2.2.0] ... OK [installed binary] Error: DESCRIPTION file at 'G:/.../renv/staging/5/zip/DESCRIPTION' is empty

Is this tied to the use of renv??

nigeldoyle commented 2 years ago

NB: I'm running: R version 4.1.2 (2021-11-01) -- "Bird Hippie" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit)

nigeldoyle commented 2 years ago

If I start a new rstudio session without renv, I get a different error (which confuses me even more):

install.packages(".../R-model/zip_2.2.0.zip") Installing package into ‘C:/Users/xxx/Documents/R/win-library/4.1’ (as ‘lib’ is unspecified) Warning in install.packages : package ‘.../R-model/zip_2.2.0.zip’ is not available for this version of R

A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

nigeldoyle commented 2 years ago

apologies - that worked - I just needed the type="win.binary" - thanks for your help!