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

failed while unpacking the package - windows #1698

Closed
luite opened this issue Feb 22, 2014 · 15 comments
Closed

failed while unpacking the package - windows #1698

luite opened this issue Feb 22, 2014 · 15 comments

Comments

@luite
Copy link
Member

luite commented Feb 22, 2014

installing haskell-src-exts-1.14.0.1 fails with the cabal master on windows 8.1 (tested with ghc 7.6.3 and 7.8.1rc1 i386), i suspect because this package contains a dist directory (with a pre-generated happy parser)

bash.exe"-3.1$ cabal install -v -j1 haskell-src-exts-1.14.0.1
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Ready to install haskell-src-exts-1.14.0.1
Waiting for install task to finish...
Extracting
C:\Users\luite\AppData\Roaming\cabal\packages\hackage.haskell.org\haskell-src-ex
ts\1.14.0.1\haskell-src-exts-1.14.0.1.tar.gz
to C:\Users\luite\AppData\Local\Temp\haskell-src-exts-1.14.0.1-3704...
creating
C:\Users\luite\AppData\Local\Temp\haskell-src-exts-1.14.0.1-3704\haskell-src-ext
s-1.14.0.1\dist
Failed to install haskell-src-exts-1.14.0.1
World file is already up to date.
cabal.exe: Error: some packages failed to install:
haskell-src-exts-1.14.0.1 failed while unpacking the package. The exception
was:
C:\Users\luite\AppData\Local\Temp\haskell-src-exts-1.14.0.1-3704\haskell-src-ext
s-1.14.0.1\dist-tmp:
MoveFileEx
"C:\\Users\\luite\\AppData\\Local\\Temp\\haskell-src-exts-1.14.0.1-3704\\haskell
-src-exts-1.14.0.1\\dist-tmp"
"C:\\Users\\luite\\AppData\\Local\\Temp\\haskell-src-exts-1.14.0.1-3704\\haskell
-src-exts-1.14.0.1\\dist":
permission denied (Access is denied.)
@ghost
Copy link

ghost commented May 1, 2014

I am also experiencing this for haddock.

Doing this:

cabal install haddock --constraint=haddock==2.13.2.1

gives me this:

Resolving dependencies...
Failed to install haddock-2.13.2.1
cabal: Error: some packages failed to install:
haddock-2.13.2.1 failed while unpacking the package. The exception was:
C:\Users\Edwin\AppData\Local\Temp\haddock-2.13.2.1-3624\haddock-2.13.2.1\dist-tmp:
MoveFileEx
"C:\\Users\\Edwin\\AppData\\Local\\Temp\\haddock-2.13.2.1-3624\\haddock-2.13.2.1\\dist-tmp"
"C:\\Users\\Edwin\\AppData\\Local\\Temp\\haddock-2.13.2.1-3624\\haddock-2.13.2.1\\dist":
permission denied (Access is denied.)

@andersarpi
Copy link

I'm getting the exact same messages for the exact same packages.

Also running GHC 7.6.3 on Windows 8.1.

@voland62
Copy link

voland62 commented May 9, 2014

Same for me, but with language-c-0.4.5 package

@romhack
Copy link

romhack commented May 10, 2014

Same here with pandoc-citeproc 0.3.1, which does not let me install hakyll. Windows 7.
For same newbies, as me, the workaround can be installing your package manually, and then continuing normal cabal install procedure.

@anton-dessiatov
Copy link
Contributor

Just wanted to report that I also see this bug with GHC 7.8.2 on Windows 2012 server. I couldn't install happy-1.19.3 and language-c-0.4.5. After extracting and installing these packages tar.gz contents manually everything worked fine.

@anton-dessiatov
Copy link
Contributor

Here is the log with --verbosity=3

Ready to install alex-3.1.3
Waiting for install task to finish...
Extracting
C:\Users\build\AppData\Roaming\cabal\packages\hackage.haskell.org\alex\3.1.3\alex-3.1.3.tar.gz
to C:\Users\build\AppData\Local\Temp\1\alex-3.1.3-736...
Renaming 'C:\Users\build\AppData\Local\Temp\1\alex-3.1.3-736\alex-3.1.3\dist'
to 'C:\Users\build\AppData\Local\Temp\1\alex-3.1.3-736\alex-3.1.3\dist-tmp'.
creating C:\Users\build\AppData\Local\Temp\1\alex-3.1.3-736\alex-3.1.3\dist
Renaming
'C:\Users\build\AppData\Local\Temp\1\alex-3.1.3-736\alex-3.1.3\dist-tmp' to
'C:\Users\build\AppData\Local\Temp\1\alex-3.1.3-736\alex-3.1.3\dist'.
Failed to install alex-3.1.3
World file is already up to date.
cabal.exe: Error: some packages failed to install:
alex-3.1.3 failed while unpacking the package. The exception was:
C:\Users\build\AppData\Local\Temp\1\alex-3.1.3-736\alex-3.1.3\dist-tmp:
MoveFileEx
"C:\\Users\\build\\AppData\\Local\\Temp\\1\\alex-3.1.3-736\\alex-3.1.3\\dist-tmp"
"C:\\Users\\build\\AppData\\Local\\Temp\\1\\alex-3.1.3-736\\alex-3.1.3\\dist":
permission denied (Access is denied.)

Looks like the presense of dist directory in the tar.gz makes cabal rename it to dist-tmp, then create it one more time and then fail trying to rename dist-tmp back to dist.

@kosiakk
Copy link

kosiakk commented May 13, 2014

It is possible to install Pandoc without any conflicts from Git clone using 'cabal install'. So the problem seems to be related to the package, not really the code itself.

@stephensong
Copy link

Any suggested workarounds for this? I didn't really understand kosiakk's reference to cabal install from Git clone.

@anton-dessiatov
Copy link
Contributor

@stephensong You may just clone Pandoc source from git (or download a recent tarball from Hackage and extract it to any folder you like) manually, and then launch cabal install from a directory that contains a source code.

I haven't tried that with Pandoc, but it works for me with packages like alex, happy, and language-c.

@stephensong
Copy link

Thanks for responding, Anton.

I tried your suggestion firstly with Alex, and it failed saying that it
needed happy. So I then tried it with happy ... and it failed thusly:

[17:07:20] $ cabal install
Resolving dependencies...
[1 of 1] Compiling Main ( dist\setup\setup.hs,
dist\setup\Main.o )
Linking .\dist\setup\setup.exe ...
Configuring happy-1.19.3...
Building happy-1.19.3...
Preprocessing executable 'happy' for happy-1.19.3...
setup.exe: The program 'happy' is required but it could not be found
Failed to install happy-1.19.3
cabal.exe: Error: some packages failed to install:
happy-1.19.3 failed during the building phase. The exception was:
ExitFailure 1

Wtf? I have to have happy to build happy?

In desperation, I then reinstalled the entire Haskell Platform, and
realised that I had been missing a requisite search path to extralibs.
Everything seems to be working fine now - managed to install Hakyll (and
PanDoc) with no problems whatsoever (afaict).

Thanks again for your help.

gary

On 16/06/2014 6:03 PM, Anton Dessiatov wrote:

@stephensong https://github.com/stephensong You may just clone
Pandoc source from git (or download a recent tarball from Hackage and
extract it to any folder you like) manually, and then launch cabal
install from a directory that contains a source code.

I haven't tried that with Pandoc, but it works for me with packages
like alex, happy, and language-c.


Reply to this email directly or view it on GitHub
#1698 (comment).

@RyanGlScott
Copy link
Member

Interestingly, this error only arises for me if I try running %APPDATA%\cabal\bin\cabal.exe (i.e., the version installed by cabal install cabal-install). If I run C:\Program Files (x86)\Haskell Platform\2013.2.0.0\lib\extralibs\bin\cabal.exe, then installation works fine. This leads me to believe that there's some sort of special permissions that Windows is giving the latter cabal.exe, but I can't seem to elevate the former cabal.exe's permissions. I have tried:

  • Right-clicking PowerShell and Cygwin and running them as Administrator
  • Right-clicking %APPDATA%\cabal\bin\cabal.exe, clicking Properties, going to the Security tab, clicking Advanced, going to the Owner tab, clicking Edit, and changing the Owner to Administrators.

Neither seemed to change anything.

@23Skidoo
Copy link
Member

@RyanGlScott If the cabal-install exe in %APPDATA%\cabal\bin\ is a newer version, then it's probably a regression.

@RyanGlScott
Copy link
Member

@23Skidoo You're right. The Haskell Platform version of cabal-install is 1.16.0.2. I also tried installing haskell-src-exts with cabal-install-1.18.0.4 and it worked, but installing it with cabal-install-1.20.0.0 yields the above errors.

@sardonicpresence
Copy link
Contributor

I suspect this is due to the createDirectoryIfMissing call at Install.hs line 1200. According to the function documentation renameDirectory fails on Windows if the destination already exists, which this guarantees if distDirPath and distDirPathNew are the same.

As such, a simple fix might be to ensure that the old & new dist paths differ in the preceding when in which case no action is required anyway: pull request.

23Skidoo added a commit that referenced this issue Jun 24, 2014
#1698 - Don't attempt to rename dist if it is already named correctly
@23Skidoo
Copy link
Member

Should be fixed by #1698 and 5c46e78. Please reopen if the bug still occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants