Closed mcandre closed 12 years ago
I'm not able to reproduce this here. I'm running Vista 32-bit on VMWare, I did a fresh install of the Haskell platform (GHC 7.0.4, cabal-install 0.10.2, Cabal 1.10.2.0), ran "cabal update" and "cabal install random-fu" and it built version 0.2.1.1 successfully.
From your error messages it looks to me more like there are old broken packages in your ghc-pkg database. For example, where it says:
<command line>: cannot satisfy -package-id random-source-0.3.0.2-3d669417cb45bca9678de9943dbdc9fe:
random-source-0.3.0.2-3d669417cb45bca9678de9943dbdc9fe is unusable due to missing or recursive dependencies:
flexible-defaults-0.0.0.3-22c17f0e579a7185b4c42e3b41b44483 template-haskell-2.5.0.0-87f4f416a22a910e480ac9f269479a5f th-extras-0.0.0.1-ffc8557b5d37ebd5852a23d82de5203a
The fact that it's got an ABI hash at the end of the version number means it's trying to use a version already installed, but then it says it can't because it has missing dependencies (other packages that were already installed). This happens sometimes when you re-build existing packages. Different choices of dependencies, build flags, etc., cause the new version to have a different ABI hash, which breaks other installed packages that depend on the one that was rebuilt.
Incidentally, this is why it's generally considered a Bad Idea to use "cabal upgrade" - it rebuilds packages too eagerly and often leads to breakages exactly like this one.
I recommend running "ghc-pkg check" to see what installed packages are broken and using "ghc-pkg unregister" to remove them. If that still doesn't fix it, it might be helpful to send me the output of "ghc-pkg list" so I can see whether something else you have installed might be depending on something that conflicts with random-fu.
On my machine, Source.DevRandom was missing, so I attempted to install random-source. That's then the problem occurred. Try cabal install random-source
.
random-source installed fine for me as a part of the process of installing random-fu. I also had no problem re-installing it from scratch. Would you mind posting the output of "ghc-pkg check" and "cabal install -v random-fu-0.2.1.1"?
BTW, Data.Random.Source.DevRandom will always be missing on windows because on windows there's no such thing as /dev/random. If you use the MonadRandom instance for IO, it will use /dev/random on unix systems and something else on windows (currently either the mwc package or System.Random, depending on GHC version).
BTW, Data.Random.Source.DevRandom will always be missing on windows because on windows there's no such thing as /dev/random.
Ah, I thought so. Would it be a good idea to use System.Random
so that my code works on both Windows and Unix?
All of the other sources work on both windows and unix. If you don't have a strong preference for which algorithm to use, I would recommend just using "sample" in IO.
Was this issue ever resolved? If so, I'd like to close it. If not, would you mind posting the output of "ghc-pkg check" and "cabal install -v random-fu-0.2.1.1"?
Thanks!
When I try to install the latest version of random-fu on Windows, Cabal reports a dependency error.
Specs:
Trace: