[Haskell-cafe] runghc Setup.hs doitall

0 views
Skip to first unread message

Alberto G. Corona

unread,
Jan 17, 2009, 5:20:18 PM1/17/09
to haskel...@haskell.org
Hi guys:

I don´t know how difficult really is, but it seens that it could be done because all the necessary elements are there (except perhaps the mapping package name-hackage url): Why hasn´t been done yet Is unknown to me. 

It would be very useful and a big save of time  to have a cabal commad "chech-dependencies-and-install-them-by-downloading-them-from-hackage-then-configure-build-and-install-this-package?. The unix installers do is t from binaries and are obsolete, so I have to do it manually with cabal everytime  when i download a new compiler version  from haskell.org

Cheers
  Alberto.

Daniel Fischer

unread,
Jan 17, 2009, 5:35:43 PM1/17/09
to Alberto G. Corona, haskel...@haskell.org

Use cabal-install:

cabal update && cabal install foo

checks for dependencies, downloads and builds them automatically (if
possible).

_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Sebastian Sylvan

unread,
Jan 18, 2009, 11:22:50 AM1/18/09
to Daniel Fischer, Alberto G. Corona, haskel...@haskell.org
Is there some sort of bundle that you can use to install cabal-install
easily? Because it looks to me like I'd have to spend the better part of an
evening manually downloading and installing the gazillion of dependencies it
has, which is far too much work when I just wanted to spend ten minutes
playing with some package...

--------------------------------------------------
From: "Daniel Fischer" <daniel.i...@web.de>
Sent: Saturday, January 17, 2009 10:35 PM
To: "Alberto G. Corona " <agoc...@gmail.com>; <haskel...@haskell.org>
Subject: Re: [Haskell-cafe] runghc Setup.hs doitall

Jeff Wheeler

unread,
Jan 18, 2009, 11:27:51 AM1/18/09
to haskel...@haskell.org
On Sun, 2009-01-18 at 16:22 +0000, Sebastian Sylvan wrote:

> Is there some sort of bundle that you can use to install cabal-install
> easily? Because it looks to me like I'd have to spend the better part of an
> evening manually downloading and installing the gazillion of dependencies it
> has, which is far too much work when I just wanted to spend ten minutes
> playing with some package...

There's a bootstrap.sh file in root of the cabal-install that can do
this automatically.

In my experience, it usually fails because of missing dependencies like
zlib-dev on my own system, but those are easy to fix, at which point I
can rerun the bootstrap script.

Jeff Wheeler

Peter Robinson

unread,
Jan 18, 2009, 11:33:31 AM1/18/09
to Sebastian Sylvan, haskel...@haskell.org
2009/1/18 Sebastian Sylvan <sebastia...@gmail.com>:

> Is there some sort of bundle that you can use to install cabal-install
> easily?

Newer versions contain a bootstrap.sh script that works just fine for me.

Cheers,
Peter

Sebastian Sylvan

unread,
Jan 18, 2009, 11:48:16 AM1/18/09
to Jeff Wheeler, haskel...@haskell.org
Doesn't work on windows.

--------------------------------------------------
From: "Jeff Wheeler" <je...@nokrev.com>
Sent: Sunday, January 18, 2009 4:27 PM
To: <haskel...@haskell.org>


Subject: Re: [Haskell-cafe] runghc Setup.hs doitall

> On Sun, 2009-01-18 at 16:22 +0000, Sebastian Sylvan wrote:

Daniel Fischer

unread,
Jan 18, 2009, 11:58:51 AM1/18/09
to Sebastian Sylvan, haskel...@haskell.org
Am Sonntag, 18. Januar 2009 17:22 schrieb Sebastian Sylvan:
> Is there some sort of bundle that you can use to install cabal-install
> easily? Because it looks to me like I'd have to spend the better part of an
> evening manually downloading and installing the gazillion of dependencies
> it has, which is far too much work when I just wanted to spend ten minutes
> playing with some package...
>

Wait, 'gazillion of dependencies'? If you have the extralibs bundle built,
there are only three dependencies to take care of
- a recent Cabal library
- HTTP
- zlib
Of course, downloading and building them manually may take half an hour or so,
but it's time well spent, cabal-install makes playing around for ten minutes
with some other package so much easier.
And of course, as has already been mentioned, there's now a bootstrap.sh
included which takes care of the above dependencies for you.

David Leimbach

unread,
Jan 18, 2009, 12:12:32 PM1/18/09
to Sebastian Sylvan, haskel...@haskell.org
On Sun, Jan 18, 2009 at 8:22 AM, Sebastian Sylvan <sebastia...@gmail.com> wrote:
Is there some sort of bundle that you can use to install cabal-install easily? Because it looks to me like I'd have to spend the better part of an evening manually downloading and installing the gazillion of dependencies it has, which is far too much work when I just wanted to spend ten minutes playing with some package...

You typically need HTTP and zlib.  Perhaps cabal-install could have it's own minimal implementations to be standalone?

However I don't find needing to cabal build and install 2 packages to be so difficult.

And once you have cabal-install, you've got it ;-)  It should be able to update itself.

Maybe adding cabal-install to the ghc packaging solves all the problems, then they just need zlib and http in the main distribution.

Dave

Duncan Coutts

unread,
Jan 18, 2009, 1:20:39 PM1/18/09
to Sebastian Sylvan, haskel...@haskell.org
On Sun, 2009-01-18 at 16:48 +0000, Sebastian Sylvan wrote:
> Doesn't work on windows.

http://haskell.org/~duncan/cabal/cabal.exe

It's not the latest version but you can use it to self-update. I'll post
a more recent build after the next release. I might also put it in a
slightly more discoverable place ;-)

Duncan

Duncan Coutts

unread,
Jan 18, 2009, 1:24:25 PM1/18/09
to Jeff Wheeler, haskel...@haskell.org
On Sun, 2009-01-18 at 10:27 -0600, Jeff Wheeler wrote:
> On Sun, 2009-01-18 at 16:22 +0000, Sebastian Sylvan wrote:
>
> > Is there some sort of bundle that you can use to install cabal-install
> > easily? Because it looks to me like I'd have to spend the better part of an
> > evening manually downloading and installing the gazillion of dependencies it
> > has, which is far too much work when I just wanted to spend ten minutes
> > playing with some package...
>
> There's a bootstrap.sh file in root of the cabal-install that can do
> this automatically.

I've also improved the bootstrap.sh script for unix users. Feedback as
to whether it still works on everyone's unix flavor would be much
appreciated.

http://darcs.haskell.org/cabal-install/bootstrap.sh

It's slightly smarter about not re-installing things that are already
installed. It should have rather better error handling too.

In fact I've heard reports that this new one even works on Windows,
though only for the people with MSYS of course.

> In my experience, it usually fails because of missing dependencies like
> zlib-dev on my own system, but those are easy to fix, at which point I
> can rerun the bootstrap script.

Patches accepted.

Duncan

Duncan Coutts

unread,
Jan 18, 2009, 1:26:53 PM1/18/09
to Daniel Fischer, haskel...@haskell.org
On Sun, 2009-01-18 at 17:58 +0100, Daniel Fischer wrote:
> Am Sonntag, 18. Januar 2009 17:22 schrieb Sebastian Sylvan:
> > Is there some sort of bundle that you can use to install cabal-install
> > easily? Because it looks to me like I'd have to spend the better part of an
> > evening manually downloading and installing the gazillion of dependencies
> > it has, which is far too much work when I just wanted to spend ten minutes
> > playing with some package...
> >
>
> Wait, 'gazillion of dependencies'? If you have the extralibs bundle built,
> there are only three dependencies to take care of
> - a recent Cabal library
> - HTTP
> - zlib

I think the problem is that hackage is misleading. It looks from the
hackage page like there are a gazillion dependencies when in fact as you
say there are only 2 that are not included with the latest ghc.

The solution some have suggested would be for hackage to only list
dependencies that are not in some core set.

Duncan

Jeff Wheeler

unread,
Jan 18, 2009, 1:28:49 PM1/18/09
to haskel...@haskell.org
On Sun, 2009-01-18 at 18:24 +0000, Duncan Coutts wrote:

> > In my experience, it usually fails because of missing dependencies like
> > zlib-dev on my own system, but those are easy to fix, at which point I
> > can rerun the bootstrap script.
>
> Patches accepted.

Without digressing too much, I don't think much can be done here. I
would not (and should not) expect the bootstrap.sh file to use apt to
get the missing dependencies as I had to do.

I don't think there's any general solution to this, beyond better error
handling (which apparently you just improved).

Jeff Wheeler

Don Stewart

unread,
Jan 18, 2009, 1:35:12 PM1/18/09
to Duncan Coutts, haskel...@haskell.org
duncan.coutts:

> On Sun, 2009-01-18 at 17:58 +0100, Daniel Fischer wrote:
> > Am Sonntag, 18. Januar 2009 17:22 schrieb Sebastian Sylvan:
> > > Is there some sort of bundle that you can use to install cabal-install
> > > easily? Because it looks to me like I'd have to spend the better part of an
> > > evening manually downloading and installing the gazillion of dependencies
> > > it has, which is far too much work when I just wanted to spend ten minutes
> > > playing with some package...
> > >
> >
> > Wait, 'gazillion of dependencies'? If you have the extralibs bundle built,
> > there are only three dependencies to take care of
> > - a recent Cabal library
> > - HTTP
> > - zlib
>
> I think the problem is that hackage is misleading. It looks from the
> hackage page like there are a gazillion dependencies when in fact as you
> say there are only 2 that are not included with the latest ghc.
>
> The solution some have suggested would be for hackage to only list
> dependencies that are not in some core set.

Hmm. That's interesting. As we do in the distro tools, for example,

makedepends=('ghc=6.10.1' 'haskell-http<4000' 'haskell-zlib')

http://repos.archlinux.org/viewvc.cgi/community/devel/cabal-install/PKGBUILD?revision=1.1&root=community&pathrev=CURRENT

So the distro packaging tools already have the 'implicit set' of things
we know are on the system if ghc is on it too.

-- Don

Sebastian Sylvan

unread,
Jan 18, 2009, 1:35:49 PM1/18/09
to Duncan Coutts, haskel...@haskell.org
On a similar note, would it not be nice if cabal install understood about
platforms and could tell you straight away that a package won't install
under e.g. windows, rather then spending ages trying and then failing
because a package tries to run a unix command?

I always get a bit annoyed trying to do anything in windows with Haskell
libraries, at the very least I'd like it to be clear from the start that
something won't work (if it's by design) so I don't waste time trying.
Ideally the hackage website would even allow you to filter packages by the
OS you're using and would remove packages that won't build on that OS (by
recursively checking dependencies too).

--------------------------------------------------
From: "Duncan Coutts" <duncan...@worc.ox.ac.uk>
Sent: Sunday, January 18, 2009 6:20 PM
To: "Sebastian Sylvan" <sebastia...@gmail.com>
Cc: "Jeff Wheeler" <je...@nokrev.com>; <haskel...@haskell.org>


Subject: Re: [Haskell-cafe] runghc Setup.hs doitall

> On Sun, 2009-01-18 at 16:48 +0000, Sebastian Sylvan wrote:

Duncan Coutts

unread,
Jan 18, 2009, 1:50:17 PM1/18/09
to Jeff Wheeler, haskel...@haskell.org
On Sun, 2009-01-18 at 12:28 -0600, Jeff Wheeler wrote:
> On Sun, 2009-01-18 at 18:24 +0000, Duncan Coutts wrote:
>
> > > In my experience, it usually fails because of missing dependencies like
> > > zlib-dev on my own system, but those are easy to fix, at which point I
> > > can rerun the bootstrap script.
> >
> > Patches accepted.
>
> Without digressing too much, I don't think much can be done here. I
> would not (and should not) expect the bootstrap.sh file to use apt to
> get the missing dependencies as I had to do.
>
> I don't think there's any general solution to this, beyond better error
> handling (which apparently you just improved).

It'll still fall over when it fails to find the zlib C lib. That's a
slightly more general issue:

Check for required C libraries during configure
http://hackage.haskell.org/trac/hackage/ticket/262

Again, patches gratefully accepted :-)

Duncan

Duncan Coutts

unread,
Jan 18, 2009, 2:03:54 PM1/18/09
to Sebastian Sylvan, haskel...@haskell.org
On Sun, 2009-01-18 at 18:35 +0000, Sebastian Sylvan wrote:
> On a similar note, would it not be nice if cabal install understood about
> platforms and could tell you straight away that a package won't install
> under e.g. windows, rather then spending ages trying and then failing
> because a package tries to run a unix command?

We're pretty near to that. It does understand platforms. What we lack is
in the information that it does not work. We can get it in two ways. One
is if we cannot find sh.exe then we know straight away that all
configure based packages will not work.

We should be able to do similar things for packages that need C libs
headers etc that we cannot find. We should only need manual additional
info for a few packages.

The tickets in this context are:
http://hackage.haskell.org/trac/hackage/ticket/342
http://hackage.haskell.org/trac/hackage/ticket/400

> I always get a bit annoyed trying to do anything in windows with Haskell
> libraries, at the very least I'd like it to be clear from the start that
> something won't work (if it's by design) so I don't waste time trying.
> Ideally the hackage website would even allow you to filter packages by the
> OS you're using and would remove packages that won't build on that OS (by
> recursively checking dependencies too).

Yes, we should be able to use the same info on hackage as in
cabal-install.

So, as usual the limiting factor is the number of people hacking on the
infrastructure. Time to get involved! :-)

Alberto G. Corona

unread,
Jan 19, 2009, 9:04:19 AM1/19/09
to haskel...@haskell.org


I finally installed cabal-install in windows.. I had a copy of sh.exe for windows time ago so I could use bootstrap. The only additional thing needed is wget(http://users.ugent.be/~bpuype/wget/). 

finally I moved the resulting cabal.exe to ghc/bin 

2009/1/19 Duncan Coutts <duncan...@worc.ox.ac.uk>

On Mon, 2009-01-19 at 01:36 +0100, Alberto G. Corona wrote:
> The problem with Windows can be solved once and for all when CygWIN
> will be considered  for Windows instead of MinGW. Is that possible?

The standard Windows build of GHC does not use Cygwin. So all the
programs built with GHC (like cabal) are native Windows programs and do
not understand Cygwin paths etc.

If you want to build GHC for Cygwin then there is quite a bit of work
for you to do to update GHC to build that way.

I get the general impression that most users would prefer not to have to
install Cygwin or MinGW at all.

Duncan



Alberto G. Corona

unread,
Jan 19, 2009, 12:18:42 PM1/19/09
to haskel...@haskell.org
C:\Documents and Settings\Administrator>cabal install plugins
Resolving dependencies...
cabal: dependencies conflict: ghc-6.10.1 requires Cabal ==1.6.0.1 however
Cabal-1.6.0.1 was excluded because plugins-1.3.1 requires Cabal ==1.4.*

2009/1/19 Alberto G. Corona <agoc...@gmail.com>

Alberto G. Corona

unread,
Jan 19, 2009, 12:18:42 PM1/19/09
to haskel...@haskell.org
C:\Documents and Settings\Administrator>cabal install plugins
Resolving dependencies...
cabal: dependencies conflict: ghc-6.10.1 requires Cabal ==1.6.0.1 however
Cabal-1.6.0.1 was excluded because plugins-1.3.1 requires Cabal ==1.4.*

2009/1/19 Alberto G. Corona <agoc...@gmail.com>
Reply all
Reply to author
Forward
0 new messages