Installing three penny gi with bondage: what did I do wrong?

I tried to fix three pennies and maybe broke things in the process. My questions are (1) how can I fix this, and (2) how should I proceed when the cabal issues a warning about possible reinstallations?

threepenny-gui warned me that it might break regex-compat:

jeffreys-mbp:~ jbb$ cabal install threepenny-gui -fbuildExamples

cabal: The following packages are likely to be broken by the reinstalls:
regex-compat-0.95.1
Use --force-reinstalls if you want to install anyway.

      

I haven't used regex in haskell yet, so it was worth the risk and I continued:

jeffreys-mbp:~ jbb$ cabal install threepenny-gui -fbuildExamples --force-reinstalls

      

This started the process that gave this warning:

Warning: The following packages are likely to be broken by the reinstalls:
regex-compat-0.95.1

      

but otherwise it seems to have worked. Then I tried to run several sample programs without success:

jefferys-mbp:samples jbb$ ./runhaskell Chat.hs
ghc: can't find a package database at ../.cabal-sandbox/*-packages.conf.d
jefferys-mbp:samples jbb$ ./runhaskell MissingDollars.hs 
ghc: can't find a package database at ../.cabal-sandbox/*-packages.conf.d
jefferys-mbp:samples jbb$

      

I searched for this error and only found one page with it that I didn't see how to use.

I thought maybe the problem is that I broke regex-compat, so I tried to reinstall this:

jefferys-mbp:samples jbb$ cabal install regex-compat
Resolving dependencies...
All the requested packages are already installed:
regex-compat-0.95.1
Use --reinstall if you want to reinstall anyway.
jefferys-mbp:samples jbb$ cabal install regex-compat --reinstall
Resolving dependencies...
In order, the following will be installed:
regex-compat-0.95.1 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
    ## It warned me that its suggestion is dangerous only AFTER I had acted on its suggestion.
Downloading regex-compat-0.95.1...
Configuring regex-compat-0.95.1...
Building regex-compat-0.95.1...
Installed regex-compat-0.95.1
Updating documentation index /Users/jbb/Library/Haskell/share/doc/index.html
jefferys-mbp:samples jbb$ 

      

I don't know if this was re-installed by regex-compat or not, but the three-penny-gui samples still don't work for me.

I am running OS X Mavericks early in MBP for 2011. Up to three pennies I tried to install wxWidgets and GTK and both of them seemed to succeed but didn't let me run the sample code. This makes me think about buying another computer and switching to Linux. (Installing Linux on this machine also eluded me.)

+3


source to share


2 answers


Installing the package threepenny-gui

(version 0.5. * At the time of writing) with the option -fbuildExamples

will make the examples available as executables. For example, an example chat can be started by typing

$ threepenny-examples-chat

      



You can also run examples from the folder samples/

directly, but this is more convenient for the library developer. You don't need to use scripts runhaskell

and ghci

; they install some paths, but they also assume that you've created a cabal sandbox in the root of your source tree and installed the dependencies.

The sample code you wrote or copied yourself should work fine.

+2


source


Create it in a sandbox with this recipe:

cabal sandbox init
cabal install --only-dependencies
cabal install

      

Embedded executables will be located in .cabal-sandbox / bin



More information on cabal sandboxes can be found here

Your problems are with tangled nest of dependencies, not OSX.

+1


source







All Articles