Badi' Abdul-Wahid | 31 Oct 16:59 2013
Picon

cabal-install sandbox with happy and alex

Hi

I've run into difficulty building happy and alex using the sandbox feature of cabal-install 1.18.0.2.
Installation of dependencies succeeds but both happy and alex fail with:

    setup: The program happy is required but it could not be found

My workaround is to use the --only-dependencies flag, install the dependencies, and manually install the packages.

This is on Mac OS X 10.8.4 with GHC 7.6.3.

I've copied the steps demonstrating the problem on lpaste:
Summary to reproduce: cabal sandbox init; cabal install happy alex

Below is the script for my workaround.

[0 :)] badi <at> olorin /tmp/sb
~> cat sandbox-install.sh
#!/usr/bin/env bash

packages="$ <at> "

cabal sandbox init
cabal install --only-dependencies $packages

for p in $packages; do
    cabal unpack $p
    pushd $p-*
    cabal sandbox --sandbox ../.cabal-sandbox init
    cabal configure
    cabal build
    runhaskell Setup.lhs install
    popd
done

--

Badi' Abdul-Wahid
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Erik de Castro Lopo | 31 Oct 18:18 2013

Re: cabal-install sandbox with happy and alex

Badi' Abdul-Wahid wrote:

> Hi
> 
> I've run into difficulty building happy and alex using the sandbox feature
> of cabal-install 1.18.0.2.
> Installation of dependencies succeeds but both happy and alex fail with:
> 
>     setup: The program happy is required but it could not be found
> 
> My workaround is to use the --only-dependencies flag, install the
> dependencies, and manually install the packages.
> 
> This is on Mac OS X 10.8.4 with GHC 7.6.3.

I've run into this problem myself on Linux. My solution is to install
ghc, happy, alex, hlint and cabal-install from debian packages and
everything else using cabal install (either with or without using
sandboxes).

I know this isn't a solution for people on OSX, but thought I'd add
it here for people on Linux.

Cheers,
Erik
--

-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
Brandon Allbery | 1 Nov 00:34 2013
Picon

Re: cabal-install sandbox with happy and alex

On Thu, Oct 31, 2013 at 1:18 PM, Erik de Castro Lopo <mle+hs <at> mega-nerd.com> wrote:
Badi' Abdul-Wahid wrote:

> I've run into difficulty building happy and alex using the sandbox feature
> of cabal-install 1.18.0.2.
> Installation of dependencies succeeds but both happy and alex fail with:
>
>     setup: The program happy is required but it could not be found
>
> My workaround is to use the --only-dependencies flag, install the
> dependencies, and manually install the packages.

I've run into this problem myself on Linux. My solution is to install
ghc, happy, alex, hlint and cabal-install from debian packages and
everything else using cabal install (either with or without using
sandboxes).

At a guess, both of you need to find the bin directory created *in the sandbox* and add it to $PATH while working in the sandbox. Perhaps there is some better way for cabal sandboxes to handle this automatically.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Badi' Abdul-Wahid | 1 Nov 01:07 2013
Picon

Re: cabal-install sandbox with happy and alex

Hi Brandon, thanks for the suggestion. Unfortunately, it didn't do the trick:

[0 :)] badi <at> olorin /private/tmp/sb
~> export PATH=/tmp/sb/.cabal-sandbox/bin:$PATH

[0 :)] badi <at> olorin /tmp/sb
~> cabal install happy alex
Resolving dependencies...
Notice: installing into a sandbox located at /private/tmp/sb/.cabal-sandbox
Configuring alex-3.1.0...
Configuring happy-1.19.0...
Building alex-3.1.0...
Building happy-1.19.0...
Failed to install happy-1.19.0
Last 10 lines of the build log ( /private/tmp/sb/.cabal-sandbox/logs/happy-1.19.0.log ):
Building happy-1.19.0...
Preprocessing executable 'happy' for happy-1.19.0...
setup: The program happy is required but it could not be found
Failed to install alex-3.1.0
Last 10 lines of the build log ( /private/tmp/sb/.cabal-sandbox/logs/alex-3.1.0.log ):
Building alex-3.1.0...
Preprocessing executable 'alex' for alex-3.1.0...
setup: The program happy is required but it could not be found
cabal: Error: some packages failed to install:
alex-3.1.0 failed during the building phase. The exception was:
ExitFailure 1
happy-1.19.0 failed during the building phase. The exception was:
ExitFailure 1



On Thu, Oct 31, 2013 at 7:34 PM, Brandon Allbery <allbery.b <at> gmail.com> wrote:
On Thu, Oct 31, 2013 at 1:18 PM, Erik de Castro Lopo <mle+hs <at> mega-nerd.com> wrote:
Badi' Abdul-Wahid wrote:

> I've run into difficulty building happy and alex using the sandbox feature
> of cabal-install 1.18.0.2.
> Installation of dependencies succeeds but both happy and alex fail with:
>
>     setup: The program happy is required but it could not be found
>
> My workaround is to use the --only-dependencies flag, install the
> dependencies, and manually install the packages.

I've run into this problem myself on Linux. My solution is to install
ghc, happy, alex, hlint and cabal-install from debian packages and
everything else using cabal install (either with or without using
sandboxes).

At a guess, both of you need to find the bin directory created *in the sandbox* and add it to $PATH while working in the sandbox. Perhaps there is some better way for cabal sandboxes to handle this automatically.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe




--

Badi' Abdul-Wahid
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane