GHC 7.4.2 on Ubuntu Trusty

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

GHC 7.4.2 on Ubuntu Trusty

Yitzchak Gale
In order support some older software that we released, we need
to get a working GHC 7.4.2 on Ubuntu Trusty. We currently have
GHC 7.8.3.

The binary tarball for GHC 7.4.2 does not install on Trusty due to
multiple incompatibilities. For example, GHC requires GMP 3, but
Trusty only provides GMP >= 4. Etc.

I tried building GHC 7.4.2. from source on Trusty. But the process
won't boot from our currently installed GHC 7.8.3. The oldest
GHC binary I can get is GHC 7.6.3, which happens to be
still available from the Ubuntu distribution itself (neither the binary
tarball nor compiling from source work for GHC 7.6.3 on Trusty
either). But booting from GHC 7.6.3 won't work either.

How do I get a working GHC 7.4.2 on Trusty?

Thanks,
Yitz
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: GHC 7.4.2 on Ubuntu Trusty

Ryan Trinkle-3
Here's an off-the-wall solution idea: you could try the Nix package manager.  It essentially sandboxes everything all the time, so you shouldn't have any trouble with dependencies like this, and ghc 7.4.2 is explicitly supported.  Of course, if your requirements include tight apt integration, this won't help; but if you just need to get things running reliably "somehow", I think Nix can handle it.

Feel free to message me off-list for more details.


Ryan

On Wed, Oct 22, 2014 at 6:48 AM, Yitzchak Gale <[hidden email]> wrote:
In order support some older software that we released, we need
to get a working GHC 7.4.2 on Ubuntu Trusty. We currently have
GHC 7.8.3.

The binary tarball for GHC 7.4.2 does not install on Trusty due to
multiple incompatibilities. For example, GHC requires GMP 3, but
Trusty only provides GMP >= 4. Etc.

I tried building GHC 7.4.2. from source on Trusty. But the process
won't boot from our currently installed GHC 7.8.3. The oldest
GHC binary I can get is GHC 7.6.3, which happens to be
still available from the Ubuntu distribution itself (neither the binary
tarball nor compiling from source work for GHC 7.6.3 on Trusty
either). But booting from GHC 7.6.3 won't work either.

How do I get a working GHC 7.4.2 on Trusty?

Thanks,
Yitz
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: GHC 7.4.2 on Ubuntu Trusty

Yuras Shumovich
In reply to this post by Yitzchak Gale
On Wed, 2014-10-22 at 13:48 +0300, Yitzchak Gale wrote:
> In order support some older software that we released, we need
> to get a working GHC 7.4.2 on Ubuntu Trusty. We currently have
> GHC 7.8.3.
>
> The binary tarball for GHC 7.4.2 does not install on Trusty due to
> multiple incompatibilities. For example, GHC requires GMP 3, but
> Trusty only provides GMP >= 4. Etc.

You can try to make a symlink from libgmp.so.10 to libgmp.so.3 AFAIK ghc
doesn't use anything specific to new gmp. Then you can recompile with
ghc from sources and link it with gmp10.

Also precise provides both gmp3 and gmp10, so you can bootstrap on
precise using 7.4.2/gmp3 to get 7.4.2/gmp10 binary.

> I tried building GHC 7.4.2. from source on Trusty. But the process
> won't boot from our currently installed GHC 7.8.3. The oldest
> GHC binary I can get is GHC 7.6.3, which happens to be
> still available from the Ubuntu distribution itself (neither the binary
> tarball nor compiling from source work for GHC 7.6.3 on Trusty
> either). But booting from GHC 7.6.3 won't work either.
>
> How do I get a working GHC 7.4.2 on Trusty?
>
> Thanks,
> Yitz
> _______________________________________________
> Glasgow-haskell-users mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: GHC 7.4.2 on Ubuntu Trusty

Yitzchak Gale
In reply to this post by Yitzchak Gale
I wrote:
>> How do I get a working GHC 7.4.2 on Trusty?

Thanks to all for the suggestions.

Daniel Trstenjak wrote, off-list:
> I can only recommend: https://launchpad.net/~hvr/+archive/ubuntu/ghc

Thanks Daniel! I hadn't looked at Herbert's ppa for a while. Despite
the comments, which say it is only updated for precise but should
also work for trusty, the ppa actually *is* updated for trusty now.

This is trivially simple to use and worked great, so that's what I
ended up using.

But still - something really really needs to be done about GHC
portability. This thread makes it clear what a mess
we have inherited from the days when GHC was primarily a
research compiler. Let's face it - GHC is now also a serious
production compiler, and this urgently needs to be cleaned up.

Thanks,
Yitz
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: GHC 7.4.2 on Ubuntu Trusty

Yitzchak Gale
I wrote:
>> This thread makes it clear what a mess
>> we have inherited from the days when GHC was primarily a
>> research compiler. Let's face it - GHC is now also a serious
>> production compiler, and this urgently needs to be cleaned up.

hvr wrote:
> Are you referring to the GMP dependency or something else?
> ...I'm not sure what can be done differently here.

Agreed. No, not any one of those many little details. I mean
the general extreme difficulty of getting almost any version
of GHC working on almost any platform, unless the two
were released within a fairly short time of each other.

Well, that is, not counting your wonderful ppa for Ubuntu.
That is fantastic - but the dire need for it is evidence for
the severity of the problem.

How about this: Currently, every GHC source distribution
requires no later than its own version of GHC for bootstrapping.
Going backwards, that chops up the sequence of GHC versions
into tiny incompatible pieces - there is no way to start with a
working GHC and work backwards to an older version by compiling
successively older GHC sources.

If instead each GHC could be compiled using at least one
subsequent version, the chain would not be broken. I.e.,
always provide a compatibility flag or some other reasonably
simple mechanism that would enable the current GHC to
compile the source code of at least the last previous released
version.

I realize that this might be disruptive to GHC devs, because
as a compiler with a research heritage, GHC experiments with
its own new features on its own source code. But as a compiler
that is used commercially, some general kind of backward
portability is critically important.

The other direction is equally problematic. Although
GHC does support bootstrapping itself from a few previous
releases, porting GHC to a new platform has become harder
and harder as GHC becomes more complex. I think this could
become a threat to the viability of GHC - technology is always
changing.

As a commercial developer, I am always plagued by nagging
worry about GHC portability, forward and backward. Will we
always be able in the future to support code we release, or will
it die someday because there will no longer exist a GHC able
to compile it? Will our whole technology die someday just
because we can't get GHC working on a platform we need
to support?

Thanks,
Yitz
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: GHC 7.4.2 on Ubuntu Trusty

Edward Z. Yang
Excerpts from Yitzchak Gale's message of 2014-10-28 13:58:08 -0700:

> How about this: Currently, every GHC source distribution
> requires no later than its own version of GHC for bootstrapping.
> Going backwards, that chops up the sequence of GHC versions
> into tiny incompatible pieces - there is no way to start with a
> working GHC and work backwards to an older version by compiling
> successively older GHC sources.
>
> If instead each GHC could be compiled using at least one
> subsequent version, the chain would not be broken. I.e.,
> always provide a compatibility flag or some other reasonably
> simple mechanism that would enable the current GHC to
> compile the source code of at least the last previous released
> version.

Here is an alternate proposal: when we make a new major version release,
we should also make a minor version release of the previous series, which
is prepped so that it can compile from the new major version.  If it
is the case that one version of the compiler can compile any other
version in the same series, this would be sufficient to go backwards.

Concretely, the action plan is very simple too: take 7.6 and apply as
many patches as is necessary to make it compile from 7.8, and cut
a release with those patches.

Edward
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: GHC 7.4.2 on Ubuntu Trusty

Yitzchak Gale
Resurrecting this thread:

My impression was that Edward's suggestion was a simple and
obvious solution to the problem of previous GHC versions quickly
becoming orphaned and unbuildable. But Austin thought that this
thread was stuck.

Would Edward's suggestion be difficult to implement for any
reason? Specifically, right now would be the time to do it, and
it would mean:

1. Create a 7.8.5 branch.
2. Tweak the stage 1 Haskell sources to build with 7.10 and tag
3. Create only a source tarball and upload it to the download
site

Thanks,
Yitz


On Wed, Oct 29, 2014 at 12:10 AM, Edward Z. Yang wrote:

> Excerpts from Yitzchak Gale's message of 2014-10-28 13:58:08 -0700:
>> How about this: Currently, every GHC source distribution
>> requires no later than its own version of GHC for bootstrapping.
>> Going backwards, that chops up the sequence of GHC versions
>> into tiny incompatible pieces - there is no way to start with a
>> working GHC and work backwards to an older version by compiling
>> successively older GHC sources.
>>
>> If instead each GHC could be compiled using at least one
>> subsequent version, the chain would not be broken. I.e.,
>> always provide a compatibility flag or some other reasonably
>> simple mechanism that would enable the current GHC to
>> compile the source code of at least the last previous released
>> version.
>
> Here is an alternate proposal: when we make a new major version release,
> we should also make a minor version release of the previous series, which
> is prepped so that it can compile from the new major version.  If it
> is the case that one version of the compiler can compile any other
> version in the same series, this would be sufficient to go backwards.
>
> Concretely, the action plan is very simple too: take 7.6 and apply as
> many patches as is necessary to make it compile from 7.8, and cut
> a release with those patches.
>
> Edward
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: GHC 7.4.2 on Ubuntu Trusty

Edward Z. Yang
Hey guys,

I have a local branch of ghc-7.8 which can be compiled by 7.10.
The most annoying patch that needed to be backported was AMP
adjustment changes.  I also messed up some stuff involving LANGUAGE
pragmas which I am going to go back and clean up.

    https://github.com/ezyang/ghc/tree/ghc-7.8

There are also some changes to hoopl, transformers and hpc (mostly
because their bootstrap libraries.)

Unfortunately I can't easily Phab these changes.  Any suggestions
for how to coordinate landing these changes?

Edward

Excerpts from Yitzchak Gale's message of 2014-12-28 13:38:47 -0500:

> Resurrecting this thread:
>
> My impression was that Edward's suggestion was a simple and
> obvious solution to the problem of previous GHC versions quickly
> becoming orphaned and unbuildable. But Austin thought that this
> thread was stuck.
>
> Would Edward's suggestion be difficult to implement for any
> reason? Specifically, right now would be the time to do it, and
> it would mean:
>
> 1. Create a 7.8.5 branch.
> 2. Tweak the stage 1 Haskell sources to build with 7.10 and tag
> 3. Create only a source tarball and upload it to the download
> site
>
> Thanks,
> Yitz
>
> On Wed, Oct 29, 2014 at 12:10 AM, Edward Z. Yang wrote:
> > Excerpts from Yitzchak Gale's message of 2014-10-28 13:58:08 -0700:
> >> How about this: Currently, every GHC source distribution
> >> requires no later than its own version of GHC for bootstrapping.
> >> Going backwards, that chops up the sequence of GHC versions
> >> into tiny incompatible pieces - there is no way to start with a
> >> working GHC and work backwards to an older version by compiling
> >> successively older GHC sources.
> >>
> >> If instead each GHC could be compiled using at least one
> >> subsequent version, the chain would not be broken. I.e.,
> >> always provide a compatibility flag or some other reasonably
> >> simple mechanism that would enable the current GHC to
> >> compile the source code of at least the last previous released
> >> version.
> >
> > Here is an alternate proposal: when we make a new major version release,
> > we should also make a minor version release of the previous series, which
> > is prepped so that it can compile from the new major version.  If it
> > is the case that one version of the compiler can compile any other
> > version in the same series, this would be sufficient to go backwards.
> >
> > Concretely, the action plan is very simple too: take 7.6 and apply as
> > many patches as is necessary to make it compile from 7.8, and cut
> > a release with those patches.
> >
> > Edward
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: GHC 7.4.2 on Ubuntu Trusty

Edward Z. Yang
For transformers, I needed:

diff --git a/Control/Monad/Trans/Error.hs b/Control/Monad/Trans/Error.hs
index 0158a8a..0dea478 100644
--- a/Control/Monad/Trans/Error.hs
+++ b/Control/Monad/Trans/Error.hs
@@ -57,6 +57,10 @@ instance MonadPlus IO where
     mzero       = ioError (userError "mzero")
     m `mplus` n = m `catchIOError` \_ -> n
 
+instance Alternative IO where
+    empty = mzero
+    (<|>) = mplus
+
 #if !(MIN_VERSION_base(4,4,0))
 -- exported by System.IO.Error from base-4.4
 catchIOError :: IO a -> (IOError -> IO a) -> IO a

For hpc, I needed:

     Build-Depends:
-        base       >= 4.4.1 && < 4.8,
+        base       >= 4.4.1 && < 4.9,
         containers >= 0.4.1 && < 0.6,
         directory  >= 1.1   && < 1.3,
-        time       >= 1.2   && < 1.5
+        time       >= 1.2   && < 1.6

For hoopl, I needed:

-  Build-Depends:     base >= 4.3 && < 4.8
+  Build-Depends:     base >= 4.3 && < 4.9

For the latter two, I think this should be a perfectly acceptable
point release.  For transformers, we could also just ifdef the
Alternative into the GHC sources.

Edward

Excerpts from Herbert Valerio Riedel's message of 2015-01-04 00:22:28 -0800:

> Hello Edward,
>
> On 2015-01-04 at 08:54:58 +0100, Edward Z. Yang wrote:
>
> [...]
>
> > There are also some changes to hoopl, transformers and hpc (mostly
> > because their bootstrap libraries.)
>
> ...what kind of changes specifically?
>
> Once thing that needs to be considered is that we'd require to upstream
> changes to transformers (it's not under GHC HQ's direct control) for a
> transformers point(?) release ... and we'd need that as we can't release
> any source-tarball that contains libraries (which get installed into the
> pkg-db) that don't match their upstream version on Hackage.
>
> Cheers,
>   hvr
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users