Minimally reproducing project (as far as I can make it) here: https://github.com/seanparsons/cantloaderror
➜ cantloaderror git:(master) stack build
cantloaderror-0.1.0.0: build
-- While building package cantloaderror-0.1.0.0 using:
/home/sean/.stack/programs/x86_64-linux/ghc-7.10.1/bin/runhaskell -package=Cabal-1.22.2.0 - clear-package-db -global-package-db -package-db=/home/sean/.stack/snapshots/x86_64-linux/nightly- 2015-07-30/7.10.1/pkgdb/ /tmp/stack26392/Setup.hs --builddir=.stack-work/dist/x86_64-linux/Cabal- 1.22.2.0/ build
Process exited with code: ExitFailure 1
Logs have been written to: "/home/sean/workspace/cantloaderror/.stack-work/logs/cantloaderror- 0.1.0.0.log"
Building cantloaderror-0.1.0.0...
Preprocessing executable 'cantloaderror' for cantloaderror-0.1.0.0...
[2 of 3] Compiling CantLoadError.Types ( src/CantLoadError/Types.hs, .stack-work/dist/x86_64- linux/Cabal-1.22.2.0/build/cantloaderror/cantloaderror-tmp/CantLoadError/Types.o )
<command line>: can't load .so/.DLL for: /home/sean/workspace/cantloaderror/.stack- work/install/x86_64-linux/nightly-2015-07-30/7.10.1/lib/x86_64-linux-ghc- 7.10.1/fastl_2Slugq3CyPh7AFUfPDWpX2/libHSfast-logger-2.4.0-2Slugq3CyPh7AFUfPDWpX2- ghc7.10.1.so (/home/sean/workspace/cantloaderror/.stack-work/install/x86_64-linux/nightly-2015-07- 30/7.10.1/lib/x86_64-linux-ghc-7.10.1/fastl_2Slugq3CyPh7AFUfPDWpX2/libHSfast-logger-2.4.0- 2Slugq3CyPh7AFUfPDWpX2-ghc7.10.1.so: undefined symbol: direczu3TcTyYedch32o1zzTH2MR00_SystemziDirectory_findExecutable4_info)
This was working when the amazonka library was depended on using extra-deps, but I needed the more recent version that is unreleased.
Perhaps directory isn't specified as a package dependency in a place that it should be?
@chrisdone Adding it to the .cabal file of my project doesn't change anything.
Perhaps do a clean and rebuild?
Still the same.
I've seen this error a few times as well, it seems to happen pretty randomly for me and a stack clean resolves it. I've also seen this happen while using cabal-install...
In my case there is no git repository involved.
Again, stack clean does nothing. I didn't create the minimally reproducing project for my own entertainment.
It reproduces for me! Strange error, I have no idea what would cause this.
I have the targets overhaul to work on for the next few days. If this is
still unresolved at that point, I can look into it
On Mon, Aug 10, 2015, 2:26 AM Michael Sloan [email protected]
wrote:
Reopened #740 https://github.com/commercialhaskell/stack/issues/740.
—
Reply to this email directly or view it on GitHub
https://github.com/commercialhaskell/stack/issues/740#event-377503853.
This still occurs in 0.1.3.0.
What's the reason for having time as an extra-dep? It's using the same version (1.5.0.1) that's provided in the snapshot.
(This wouldn't be a valid reason for the behavior, but I'm trying to understand what I'm looking at.)
Just completed my build, and removing time-1.5.0.1 from extra-deps fixed the problem for me. @seanparsons can you confirm?
If that's the case, we need to decide what to do with this. We can write it off as a corner case until it crops up again, or investigate further. Given that this is a very large reproducing case, I'd rather wait for another example to crop up before diving in.
Hi, I've got a minimised example of this issue: https://github.com/samdoshi/stack-error
If you clone it on OSX 10.10 and try and stack build, you get:
$ stack build
hmidi-0.2.2.0: configure
hmidi-0.2.2.0: build
hmidi-0.2.2.0: install
stack-error-0.1.0.0: configure
Configuring stack-error-0.1.0.0...
stack-error-0.1.0.0: build
Preprocessing executable 'stack-error' for stack-error-0.1.0.0...
[1 of 1] Compiling Main ( src/Main.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/stack-error/stack-error-tmp/Main.o )
<command line>: can't load .so/.DLL for: /Users/sam/Dropbox/Projects/stack-error/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/lib/x86_64-osx-ghc-7.10.2/hmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc/libHShmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc-ghc7.10.2.dylib (dlopen(/Users/sam/Dropbox/Projects/stack-error/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/lib/x86_64-osx-ghc-7.10.2/hmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc/libHShmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc-ghc7.10.2.dylib, 5): Symbol not found: _kMIDIPropertyManufacturer
Referenced from: /Users/sam/Dropbox/Projects/stack-error/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/lib/x86_64-osx-ghc-7.10.2/hmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc/libHShmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc-ghc7.10.2.dylib
Expected in: flat namespace
in /Users/sam/Dropbox/Projects/stack-error/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/lib/x86_64-osx-ghc-7.10.2/hmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc/libHShmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc-ghc7.10.2.dylib)
Completed all 2 a
-- While building package stack-error-0.1.0.0 using:
/Users/sam/.stack/programs/x86_64-osx/ghc-7.10.2/bin/runhaskell -package=Cabal-1.22.4.0 -clear-package-db -global-package-db -package-db=/Users/sam/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/pkgdb/ /var/folders/s2/4_93jgb54fx5f8_twm8714sc0000gn/T/stack7864/Setup.hs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/ build exe:stack-error --ghc-options -hpcdir .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/hpc/.hpc/ -ddump-hi -ddump-to-file
Process exited with code: ExitFailure 1
ctions.
$ stack --version
Version 0.1.3.1
If you comment out hmidi in the build-depends in stack-error.cabal then it compiles, similarly if you comment out my_id and the call to it, and reinstate all the midi stuff it compiles.
Looks to be an issue with template haskell.
If you can't reproduce I can try and get it do so on travis-ci
@samdoshi That issue does not reproduce on my Windows box. A Travis-based repro would be great.
@snoyberg Here you go: https://travis-ci.org/samdoshi/stack-error/branches
I've created four branches:
brew supplied ghchmidi removed from stack-error.cabalmy_id commented outI've also added a cabal branch, which doesn't use stack, it fails with the same error
<command line>: can't load .so/.DLL for: /Users/travis/.cabal/lib/x86_64-osx-ghc-7.10.2/hmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc/libHShmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc-ghc7.10.2.dylib (dlopen(/Users/travis/.cabal/lib/x86_64-osx-ghc-7.10.2/hmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc/libHShmidi-0.2.2.0-K5Hp8RffNhV6yaFNhdp3bc-ghc7.10.2.dylib, 5): Symbol not found: _kMIDIPropertyManufacturer
I'm guessing this is an upstream issue then?
I'm afraid I'm a bit of a Haskell beginner, so I'm not quite sure where to take this next.
I think this is a completely different issue actually, and is correct behavior. It looks like you need to tell GHC to add in an extra system library containing the _kMIDIPropertyManufacturer identifier. It's also likely to be impossible to get this to work on Linux, since that function won't exist on Linux.
@snoyberg Surely all someone needs to do to get confirmation of this is to try building the project I posted right at the very start?
It looks like my bug relates to this haskell/cabal#2715
@seanparsons Indeed, I did confirm it, and then confirmed that removing the time extra-dep fixed the bug. Since these kinds of issues generally are non-obviously-deterministic, I wanted to confirm with you that making that change fixed it for you too.
@snoyberg Aha! That does appear to have stopped it from happening, I'm baffled.
It has to do most likely with where time falls in the dependency tree, specifically below some packages that ship with GHC. Generally it can be problematic to upgrade those. I don't know exactly what happened in this case, and whether it's a bug in GHC, Cabal, or stack, but given that this change works for now, closing.
@samdoshi I can't find a better place to ask, since the minimal example repository was deleted, but I'm having that exact problem when trying to build https://github.com/5outh/Bang; did you ever figure out the solution to the problem you were experiencing, or any possible causes?
Again, sorry for polluting a closed issue, just not sure where else to ask.
I too am getting this with a Yesod scaffolded site, with minimal changes. It was building fine then just stopped one day. Stack trace:
<no location info>:
<command line>: can't load .so/.DLL for: /home/garry/.stack/snapshots/x86_64-linux/lts-5.0/7.10.3/lib/x86_64-linux-ghc-7.10.3/yesod-core-1.4.19-2khL1Psa766GsQyshWLKC6/libHSyesod-core-1.4.19-2khL1Psa766GsQyshWLKC6-ghc7.10.3.so (/home/garry/.stack/snapshots/x86_64-linux/lts-5.0/7.10.3/lib/x86_64-linux-ghc-7.10.3/yesod-core-1.4.19-2khL1Psa766GsQyshWLKC6/libHSyesod-core-1.4.19-2khL1Psa766GsQyshWLKC6-ghc7.10.3.so: undefined symbol: warpzu3hKUmkinBwE2hEn1kQG9Cs_NetworkziWaiziHandlerziWarpziSettings_defaultSettings13_closure)
Downgrading to lts-4.2 seems to have fixed my issue.
Note that the downgrading itself probably isn't the fix, just starting with a different snapshot. Also, lts-4.* isn't recommended due to aeson-0.10 being a bit broken. If this theory is correct, then deleting ~/.stack/snapshots should resolve the issue.
https://github.com/commercialhaskell/stack/issues/1476 is tracking adding support for selectively reinstalling packages.
Just ran into this. rm -r ~/.stack/snapshots worked wonderfully. I am also using git repos in my stack build, so that does seem to be the problem.
For posterity here are my error messages from stack setup:
-- While building package th-lift-instances-0.1.11 using:
/Users/user/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.0.0_ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.0.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /Users/user/.stack/programs/x86_64-osx/ghcjs-0.2.1.9007019_ghc-8.0.1/src/.stack-work/logs/th-lift-instances-0.1.11.log
Configuring th-lift-instances-0.1.11...
Building th-lift-instances-0.1.11...
Preprocessing library th-lift-instances-0.1.11...
[1 of 1] Compiling Instances.TH.Lift ( src/Instances/TH/Lift.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/Instances/TH/Lift.o )
<command line>: can't load .so/.DLL for: /Users/user/.stack/snapshots/x86_64-osx/lts-7.2/8.0.1/lib/x86_64-osx-ghc-8.0.1/primitive-0.6.1.0-Ip44DqhfCp21tTUYbecwa/libHSprimitive-0.6.1.0-Ip44DqhfCp21tTUYbecwa-ghc8.0.1.dylib (dlopen(/Users/user/.stack/snapshots/x86_64-osx/lts-7.2/8.0.1/lib/x86_64-osx-ghc-8.0.1/primitive-0.6.1.0-Ip44DqhfCp21tTUYbecwa/libHS
primitive-0.6.1.0-Ip44DqhfCp21tTUYbecwa-ghc8.0.1.dylib, 5): Library not loaded: /usr/local/opt/ghc/lib/ghc-8.0.1/transformers-0.5.2.0/libHStransformers-0.5.2.0-ghc8.0.1.dylib
Referenced from: /Users/user/.stack/snapshots/x86_64-osx/lts-7.2/8.0.1/lib/x86_64-osx-ghc-8.0.1/primitive-0.6.1.0-Ip44DqhfCp21tTUYbecwa/libHSprimitive-0.6.1.0-Ip44DqhfCp21tTUYbecwa-ghc8.0.1.dylib
Reason: image not found)
-- While building package profunctors-5.2 using:
/Users/user/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.0.0_ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.0.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /Users/user/.stack/programs/x86_64-osx/ghcjs-0.2.1.9007019_ghc-8.0.1/src/.stack-work/logs/profunctors-5.2.log
Configuring profunctors-5.2...
Building profunctors-5.2...
Preprocessing library profunctors-5.2...
[ 1 of 15] Compiling Data.Profunctor.Unsafe ( src/Data/Profunctor/Unsafe.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/Data/Profunctor/Unsafe.o )
<command line>: can't load .so/.DLL for: /Users/user/.stack/snapshots/x86_64-osx/lts-7.2/8.0.1/lib/x86_64-osx-ghc-8.0.1/base-orphans-0.5.4-5IQvrjd7gNP548VkOOyIq6/libHSbase-orphans-0.5.4-5IQvrjd7gNP548VkOOyIq6-ghc8.0.1.dylib (dlopen(/Users/user/.stack/snapshots/x86_64-osx/lts-7.2/8.0.1/lib/x86_64-osx-ghc-8.0.1/base-orphans-0.5.4-5IQvrjd7gNP548VkOOyIq6
/libHSbase-orphans-0.5.4-5IQvrjd7gNP548VkOOyIq6-ghc8.0.1.dylib, 5): Library not loaded: /usr/local/opt/ghc/lib/ghc-8.0.1/base-4.9.0.0/libHSbase-4.9.0.0-ghc8.0.1.dylib
Referenced from: /Users/user/.stack/snapshots/x86_64-osx/lts-7.2/8.0.1/lib/x86_64-osx-ghc-8.0.1/base-orphans-0.5.4-5IQvrjd7gNP548VkOOyIq6/libHSbase-orphans-0.5.4-5IQvrjd7gNP548VkOOyIq6-ghc8.0.1.dylib
Reason: image not found)
I've been running into this intermittently when running stack exec yesod devel and at least in my case it was caused by something unexpected:
When adding a new module (like a yesod handler), I forgot to add it to my project's cabal file to the exposed-modules section. Adding the module there, made the can't load .so/.DLL-error go away.
rm -r ~/.stack/snapshots didn't help. still got the problem while trying to install hakyll on my mac :'(
Ran into this today on macOS. Tried doing stack clean to no avail, but stack clean --full worked.
Also ran into this today, but @stackptr's suggestions of running stack clean --full did the trick.
Note that once #4385 is merged you can use stack purge as an alias to stack clean --full
I also ran into this, also on macOS. I ran stack clean --full, but it didn't fix the problem.
Constantly running into this, when I switch between a git dependency to a local one and go back. Tried all possible ways of solving it and nothing but removing ~/.stack/snapshots helps.
Stack 2.1.3, OSX 10.15
Found a better way of working around this: by deleting the broken package and its .so files in every snapshot.
Also you might be able to reproduce the issue by first setting the resolver to resolver: https://raw.githubusercontent.com/metrix-ai/stack-snapshot/55.2/snapshot.yaml and then switching to resolver: https://raw.githubusercontent.com/metrix-ai/stack-snapshot/55.3.1/snapshot.yaml and using the predropWhile function out of the "foldl" package.
Most helpful comment
Note that the downgrading itself probably isn't the fix, just starting with a different snapshot. Also, lts-4.* isn't recommended due to aeson-0.10 being a bit broken. If this theory is correct, then deleting ~/.stack/snapshots should resolve the issue.
https://github.com/commercialhaskell/stack/issues/1476 is tracking adding support for selectively reinstalling packages.