You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lens fails to build on Windows with Cabal install 1.20RC2 #1784
When building my projects and all dependencies from scratch (removed Roaming/cabal and Roaming/ghc) on (Windows 8, HP 2013.2.0.0, GHC7.6.3, Cabal install 1.20 RC2) I got this :
Failed to install lens-4.1.2
Last 10 lines of the build log ( C:\Users\mantkiew\AppData\Roaming\cabal\logs\lens-4.1.2.log ):
[77 of 85] Compiling Data.Vector.Lens ( src\Data\Vector\Lens.hs, dist\build\Data\Vector\Lens.o )
... < cut >
[85 of 85] Compiling Codec.Compression.Zlib.Lens ( src\Codec\Compression\Zlib\Lens.hs, dist\build\Codec\Compression\Zlib
\Lens.o )
c:\dev\HaskellPlatform\2013.2.0.0\mingw\bin\strip.exe: cannot create tempdir for archive copying (error: File exists)
cabal.exe: Error: some packages failed to install:
clafer-0.3.6 depends on lens-4.1.2 which failed to install.
lens-4.1.2 failed during the building phase. The exception was:
ExitFailure 1
Tried again from scratch - nothing helped.
Then I tried with Cabal 1.18.* and everything builds and installs normally.
I'm not sure why it's failing. Perhaps you could run the above command manually after the build fails and pass -v to see what directory it's trying to create? You will ned to change the directory to the compile was done in (C:\Users\mantkiew\AppData\Local\Temp\lens-4.1.2-XXXX I believe, where XXXX is a random number.)
Unfortunately, all temp. directories are removed and strip.exe simply says "File not found". Is there a way to prevent the removal of the temp. files? I also got something different:
("c:\\dev\\HaskellPlatform\\2013.2.0.0\\mingw\\bin\\strip.exe",["dist\\build\\libHSlens-4.1.2.a-2412\\libHSlens-4.1.2.a"
,"--strip-unneeded"])
c:\dev\HaskellPlatform\2013.2.0.0\mingw\bin\strip.exe: cannot create tempdir for archive copying (error: File exists)
c:\dev\HaskellPlatform\2013.2.0.0\mingw\bin\strip.exe returned ExitFailure 1
Updating world file...
cabal.exe: Error: some packages failed to install:
lens-4.1.2 failed while downloading the package. The exception was:
RemoveDirectory
"C:\\Users\\mantkiew\\AppData\\Local\\Temp\\lens-4.1.2-2484\\lens-4.1.2\\dist":
unsatisified constraints (The directory is not empty.)
("c:\\dev\\HaskellPlatform\\2013.2.0.0\\mingw\\bin\\strip.exe",["dist\\build\\libHSlens-4.1.2.a-2412\\libHSlens-4.1.2.a"
,"--strip-unneeded"])
c:\dev\HaskellPlatform\2013.2.0.0\mingw\bin\strip.exe: cannot create tempdir for archive copying (error: File exists)
c:\dev\HaskellPlatform\2013.2.0.0\mingw\bin\strip.exe returned ExitFailure 1
Updating world file...
cabal.exe: Error: some packages failed to install:
lens-4.1.2 failed while downloading the package. The exception was:
RemoveDirectory
"C:\\Users\\mantkiew\\AppData\\Local\\Temp\\lens-4.1.2-2484\\lens-4.1.2\\dist":
unsatisified constraints (The directory is not empty.)
I have suspected parallel builds as well. Unfortunately, -j1 did not help. Still getting:
[85 of 85] Compiling Codec.Compression.Zlib.Lens ( src\Codec\Compression\Zlib\Lens.hs, dist\build\Codec\Compression\Zlib
\Lens.o )
c:\dev\HaskellPlatform\2013.2.0.0\mingw\bin\strip.exe: cannot create tempdir for archive copying (error: File exists)
Failed to install lens-4.1.2
cabal.exe: Error: some packages failed to install:
lens-4.1.2 failed during the building phase. The exception was:
ExitFailure 1
/cc @23Skidoo I believe this is the last remaining issue before I can make a release.
We need to figure out what file/directory already exists and why it exists. Could you try to figure that out? You can pass --ghc-option=-keep-tmp-files to cabal install in case GHC is removing temporary files you want to look at.
Unfortunately I don't have a Windows development setup so I cannot easily debug this.
The problem is that the folder dist\\build\\libHSlens-4.1.2.a-<number> only briefly appears and then the build immediately crashes reporting the error. The --ghc-option=-keep-tmp-files does not help as, I suspect, it's the cabal itself that cleans up, not GHC (there were indeed some temp files left over but nothing useful).
I tried to do the following instead:
cabal get lens-4.1.2
cd lens-4.1.2
cabal install -v3
Indeed, doing so caused the entire contents of dist/build to be left over; however, the libHSlens-4.1.2.a-<number> was also removed from there (by cabal, I presume) immediately. So, it must be something related to building the library. Just calling cabal build reports the same error. In the log, I can see
c:\dev\HaskellPlatform\2013.2.0.0\mingw\bin\ar.exe: creating dist\build\libHSlens-4.1.2.a-4960\libHSlens-4.1.2.a
a - dist\build\Codec\Compression\Zlib\Lens.o
...<cut>...
followed by the strip error. So, the archive is created.
$ strip -v libHSlens-4.1.2.a
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/Lens.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/sta03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/stb03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Action.o)' [pe-i386] to `stb03896/Action.o' [pe-i38
6]
copy from `libHSlens-4.1.2.a(At.o)' [pe-i386] to `stb03896/At.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Combinators.o)' [pe-i386] to `stb03896/Combinators.
o' [pe-i386]
copy from `libHSlens-4.1.2.a(Cons.o)' [pe-i386] to `stb03896/Cons.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Each.o)' [pe-i386] to `stb03896/Each.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Empty.o)' [pe-i386] to `stb03896/Empty.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Equality.o)' [pe-i386] to `stb03896/Equality.o' [pe
-i386]
copy from `libHSlens-4.1.2.a(Extras.o)' [pe-i386] to `stb03896/Extras.o' [pe-i38
6]
copy from `libHSlens-4.1.2.a(Fold.o)' [pe-i386] to `stb03896/Fold.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Getter.o)' [pe-i386] to `stb03896/Getter.o' [pe-i38
6]
copy from `libHSlens-4.1.2.a(Indexed.o)' [pe-i386] to `stb03896/Indexed.o' [pe-i
386]
copy from `libHSlens-4.1.2.a(Internal.o)' [pe-i386] to `stb03896/Internal.o' [pe
-i386]
copy from `libHSlens-4.1.2.a(Action.o)' [pe-i386] to `stb03896/stc03896/Action.o
' [pe-i386]
copy from `libHSlens-4.1.2.a(Bazaar.o)' [pe-i386] to `stb03896/Bazaar.o' [pe-i38
6]
copy from `libHSlens-4.1.2.a(ByteString.o)' [pe-i386] to `stb03896/ByteString.o'
[pe-i386]
copy from `libHSlens-4.1.2.a(Context.o)' [pe-i386] to `stb03896/Context.o' [pe-i
386]
copy from `libHSlens-4.1.2.a(Deque.o)' [pe-i386] to `stb03896/Deque.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Exception.o)' [pe-i386] to `stb03896/Exception.o' [
pe-i386]
copy from `libHSlens-4.1.2.a(Fold.o)' [pe-i386] to `stb03896/std03896/Fold.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Getter.o)' [pe-i386] to `stb03896/ste03896/Getter.o
' [pe-i386]
copy from `libHSlens-4.1.2.a(Indexed.o)' [pe-i386] to `stb03896/stf03896/Indexed
.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Instances.o)' [pe-i386] to `stb03896/Instances.o' [
pe-i386]
copy from `libHSlens-4.1.2.a(Iso.o)' [pe-i386] to `stb03896/Iso.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Level.o)' [pe-i386] to `stb03896/Level.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Magma.o)' [pe-i386] to `stb03896/Magma.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Prism.o)' [pe-i386] to `stb03896/Prism.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Reflection.o)' [pe-i386] to `stb03896/Reflection.o'
[pe-i386]
copy from `libHSlens-4.1.2.a(Review.o)' [pe-i386] to `stb03896/Review.o' [pe-i38
6]
copy from `libHSlens-4.1.2.a(Setter.o)' [pe-i386] to `stb03896/Setter.o' [pe-i38
6]
copy from `libHSlens-4.1.2.a(TH.o)' [pe-i386] to `stb03896/TH.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Zoom.o)' [pe-i386] to `stb03896/Zoom.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Iso.o)' [pe-i386] to `stb03896/stg03896/Iso.o' [pe-
i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/sth03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Level.o)' [pe-i386] to `stb03896/sti03896/Level.o'
[pe-i386]
copy from `libHSlens-4.1.2.a(Loupe.o)' [pe-i386] to `stb03896/Loupe.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Operators.o)' [pe-i386] to `stb03896/Operators.o' [
pe-i386]
copy from `libHSlens-4.1.2.a(Plated.o)' [pe-i386] to `stb03896/Plated.o' [pe-i38
6]
copy from `libHSlens-4.1.2.a(Prism.o)' [pe-i386] to `stb03896/stj03896/Prism.o'
[pe-i386]
copy from `libHSlens-4.1.2.a(Reified.o)' [pe-i386] to `stb03896/Reified.o' [pe-i
386]
copy from `libHSlens-4.1.2.a(Review.o)' [pe-i386] to `stb03896/stk03896/Review.o
' [pe-i386]
copy from `libHSlens-4.1.2.a(Setter.o)' [pe-i386] to `stb03896/stl03896/Setter.o
' [pe-i386]
copy from `libHSlens-4.1.2.a(TH.o)' [pe-i386] to `stb03896/stm03896/TH.o' [pe-i3
86]
copy from `libHSlens-4.1.2.a(Traversal.o)' [pe-i386] to `stb03896/Traversal.o' [
pe-i386]
copy from `libHSlens-4.1.2.a(Tuple.o)' [pe-i386] to `stb03896/Tuple.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Type.o)' [pe-i386] to `stb03896/Type.o' [pe-i386]
copy from `libHSlens-4.1.2.a(Wrapped.o)' [pe-i386] to `stb03896/Wrapped.o' [pe-i
386]
copy from `libHSlens-4.1.2.a(Zoom.o)' [pe-i386] to `stb03896/stn03896/Zoom.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/sto03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/stp03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/stq03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/str03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/sts03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/stt03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/stu03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/stv03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/stw03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/stx03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/sty03896/Lens.o' [p
e-i386]
copy from `libHSlens-4.1.2.a(Lens.o)' [pe-i386] to `stb03896/stz03896/Lens.o' [p
e-i386]
c:\Program Files (x86)\Haskell Platform\2013.2.0.0\mingw\bin\strip.exe: cannot c
reate tempdir for archive copying (error: File exists)
@hvr says that there's no failure on Linux. Either Linux uses a more recent binutils or the MSYS binutils leans on Windows for tempfile naming and that's why the issue only shows up here.
@tibbe The bug still happens with a new version of binutils (2.24 - newer than the one installed on my Linux machine). Probably some Windows-specific limitation.
Activity
tibbe commentedon Apr 18, 2014
Could you please paste the output of
cabal install -v3 lens-4.1.2?mantkiew commentedon Apr 18, 2014
tibbe commentedon Apr 18, 2014
strip.exeitself is failing. We're calling it like so:I'm not sure why it's failing. Perhaps you could run the above command manually after the build fails and pass
-vto see what directory it's trying to create? You will ned to change the directory to the compile was done in (C:\Users\mantkiew\AppData\Local\Temp\lens-4.1.2-XXXXI believe, where XXXX is a random number.)mantkiew commentedon Apr 18, 2014
Unfortunately, all temp. directories are removed and
strip.exesimply says "File not found". Is there a way to prevent the removal of the temp. files? I also got something different:tibbe commentedon Apr 19, 2014
This seems similar to #1785 (comment).
Could you try to pass
-j1to cabal install to avoid building in parallel and report back?mantkiew commentedon Apr 19, 2014
I have suspected parallel builds as well. Unfortunately,
-j1did not help. Still getting:tibbe commentedon Apr 19, 2014
/cc @23Skidoo I believe this is the last remaining issue before I can make a release.
We need to figure out what file/directory already exists and why it exists. Could you try to figure that out? You can pass
--ghc-option=-keep-tmp-filestocabal installin case GHC is removing temporary files you want to look at.Unfortunately I don't have a Windows development setup so I cannot easily debug this.
mantkiew commentedon Apr 19, 2014
The problem is that the folder
dist\\build\\libHSlens-4.1.2.a-<number>only briefly appears and then the build immediately crashes reporting the error. The--ghc-option=-keep-tmp-filesdoes not help as, I suspect, it's the cabal itself that cleans up, not GHC (there were indeed some temp files left over but nothing useful).I tried to do the following instead:
Indeed, doing so caused the entire contents of
dist/buildto be left over; however, thelibHSlens-4.1.2.a-<number>was also removed from there (by cabal, I presume) immediately. So, it must be something related to building the library. Just callingcabal buildreports the same error. In the log, I can seefollowed by the strip error. So, the archive is created.
23Skidoo commentedon Apr 20, 2014
IIRC Cabal also has some option for keeping temporary files around, but I don't remember what it's called off-hand.
23Skidoo commentedon Apr 20, 2014
Managed to reproduce. Interesting that it happens only with
lensand not its dependencies.23Skidoo commentedon Apr 20, 2014
Strange that tries to run
striponlibHSlens-4.1.2.asince from the code it looks like we're only stripping shared libraries...23Skidoo commentedon Apr 20, 2014
Ah, so this is done in
createArLibArchive...23Skidoo commentedon Apr 20, 2014
Sorry, looks like I was misremembering.
23Skidoo commentedon Apr 20, 2014
Replacing GHC's
stripwith a more recent version doesn't help...23Skidoo commentedon Apr 20, 2014
Output of
strip -v:Notice the
n...x,y,zprogression. Looks like a bug triggered by having too many identically-named .o files (look at http://hackage.haskell.org/package/lens : apparently every module with a name ending with.Lensproduces aLens.ofile).I suggest disabling library stripping on Windows for now and filing a bug report at the binutils bug tracker. Maybe this can be also fixed in GHC?
Don't strip libraries on Windows
tibbe commentedon Apr 20, 2014
tibbe commentedon Apr 20, 2014
@hvr says that there's no failure on Linux. Either Linux uses a more recent binutils or the MSYS binutils leans on Windows for tempfile naming and that's why the issue only shows up here.
tibbe commentedon Apr 20, 2014
Thanks to Jafet on IRC we've verified that my fix above works.
23Skidoo commentedon Apr 20, 2014
@tibbe The bug still happens with a new version of binutils (2.24 - newer than the one installed on my Linux machine). Probably some Windows-specific limitation.
Toxaris commentedon May 20, 2014
This is not fixed for me, using:
Toxaris commentedon May 20, 2014
I tried to investigate this, and now it seems to work. Maybe I misunderstood some output. Anyway, I cannot reproduce this anymore.
michalfapso commentedon Mar 3, 2016
I had the same problem on mingw. Here is a simple script overcoming the strip's issue with creating temp files: https://gist.github.com/michalfapso/833d4198244698e4266e