Managing multiple installations of GHC

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

Managing multiple installations of GHC

Robert Clausecker
Hi folks!

I want to test the new version 7 of GHC, but don't want to replace the
packaged version 6.12 with it.  I'm not very advanced with the internals
of GHC and have some problems.  So these are my questions:

I installed GHC into a subdir of my homedir, let's call it ~/ghc7. How
can I install additional libs there?

How can I install GHC 7 parallel to GHC 6.12 with the option to choose?
My OS is GNU/Linux, my Distro is Ubuntu (Lucid).

Thank you very much, yours Robert Clausecker


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

Re: Managing multiple installations of GHC

Antoine Latter-2
On Wed, Dec 1, 2010 at 10:16 PM, Robert Clausecker <[hidden email]> wrote:

> Hi folks!
>
> I want to test the new version 7 of GHC, but don't want to replace the
> packaged version 6.12 with it.  I'm not very advanced with the internals
> of GHC and have some problems.  So these are my questions:
>
> I installed GHC into a subdir of my homedir, let's call it ~/ghc7. How
> can I install additional libs there?
>
> How can I install GHC 7 parallel to GHC 6.12 with the option to choose?
> My OS is GNU/Linux, my Distro is Ubuntu (Lucid).
>
> Thank you very much, yours Robert Clausecker

If you're doing user installations of packages with 'cabal-install' it
will take care of everything - all of the things that it installs are
in per-GHC-version directories. I do this quite a bit and I haven't
run into many hiccups yet.

Except for the haddock documentation that cabal-install installs -
different versions of GHC/haddock are pretty much always breaking each
other when I switch back and forth.

I pick which one I want by adjusting which ghc/ghci binaries are in my
path. You can also tell Cabal which GHC you'd like to use as a command
line option when installing packages.

Antoine

>
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>

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

Re: Managing multiple installations of GHC

Mark Lentczner

On Dec 1, 2010, at 8:38 PM, Antoine Latter wrote:
> If you're doing user installations of packages with 'cabal-install' it
> will take care of everything - all of the things that it installs are
> in per-GHC-version directories.
...
> Except for the haddock documentation that cabal-install installs -
> different versions of GHC/haddock are pretty much always breaking each
> other when I switch back and forth.

This is because cabal's default layout *doesn't* install everything in per-GHC-version directories. The layout is:

<prefix>          -- /usr/local if --global, ~/.cabal if --user
  bin             -- binaries ($bindir)
  lib             -- ($libdir)
    <pkgid>
      <compiler>  -- libraries & .hi files ($libdir/$libsubdir, $dynlibdir)
        include   -- include files ($includedir)
  libexec         -- private binaries ($libexecdir)
  share           -- ($datadir)
    <pkgid>       -- data files ($datadir/$datasubdir)    
    doc
      <pkgid>     -- documentation ($docdir)
        html      -- html doc ($htmldir, $haddockdir)
    man           -- man pages ($mandir)

Notice that only libraries, .hi files and includes are uner a per-compiler directory. All the other things aren't, and as you notice they clobber each other.

I propose that the default in Cabal be changed to:

<prefix>          -- /usr/local/haskell if --global, ~/.cabal if --user,
  <compiler>
    <pkgid>
      bin         -- binaries ($bindir)
      lib         -- libraries & .hi files ($libdir, $libdir/$libsubdir, $dynlibdir)
        include   -- include files ($includedir)
      libexec     -- private binaries ($libexecdir)
      share       -- data files ($datadir, $datadir/$datasubdir)    
      doc         -- documentation ($docdir)
        html      -- html doc ($htmldir, $haddockdir)
        man       -- man pages ($mandir)
    bin           -- symlinks to binaries
    doc
      html        -- master index of html doc
      man         -- symlinks to man pages
  current         -- symlink to current <compiler>
  bin             -- symlink to current/bin      
  doc             -- symlink to current/doc

This would put everything under a per-compiler top level dir, which is how most other language systems install (for example perl and python both do it this way) This would also allow very easy removal of an old compiler and everything that was installed for it. Removing packages is also easier: you just one <pkgid> dir per <compiler> to find and get rid of -- and you can do it with a wildcard!

Thoughts?

        - Mark




Mark Lentczner
http://www.ozonehouse.com/mark/
IRC: mtnviewmark




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

Re: Managing multiple installations of GHC

steffen-19
> On Dec 1, 2010, at 8:38 PM, Antoine Latter wrote:
>
> > If you're doing user installations of packages with 'cabal-install' it
> > will take care of everything - all of the things that it installs are
> > in per-GHC-version directories.
> ...
> > Except for the haddock documentation that cabal-install installs -
> > different versions of GHC/haddock are pretty much always breaking each
> > other when I switch back and forth.
>
> This is because cabal's default layout *doesn't* install everything in per-GHC-version directories. The layout is:
>
> <prefix>          -- /usr/local if --global, ~/.cabal if --user
>   bin             -- binaries ($bindir)
>   lib             -- ($libdir)
>     <pkgid>
>       <compiler>  -- libraries & .hi files ($libdir/$libsubdir, $dynlibdir)
>         include   -- include files ($includedir)
>   libexec         -- private binaries ($libexecdir)
>   share           -- ($datadir)
>     <pkgid>       -- data files ($datadir/$datasubdir)    
>     doc
>       <pkgid>     -- documentation ($docdir)
>         html      -- html doc ($htmldir, $haddockdir)
>     man           -- man pages ($mandir)
>
> Notice that only libraries, .hi files and includes are uner a per-compiler directory. All the other things aren't, and as you notice they clobber each other.
>
> I propose that the default in Cabal be changed to:
>
> <prefix>          -- /usr/local/haskell if --global, ~/.cabal if --user,
>   <compiler>
>     <pkgid>
>       bin         -- binaries ($bindir)
>       lib         -- libraries & .hi files ($libdir, $libdir/$libsubdir, $dynlibdir)
>         include   -- include files ($includedir)
>       libexec     -- private binaries ($libexecdir)
>       share       -- data files ($datadir, $datadir/$datasubdir)    
>       doc         -- documentation ($docdir)
>         html      -- html doc ($htmldir, $haddockdir)
>         man       -- man pages ($mandir)
>     bin           -- symlinks to binaries
>     doc
>       html        -- master index of html doc
>       man         -- symlinks to man pages
>   current         -- symlink to current <compiler>
>   bin             -- symlink to current/bin      
>   doc             -- symlink to current/doc
>
> This would put everything under a per-compiler top level dir, which is how most other language systems install (for example perl and python both do it this way) This would also allow very easy removal of an old compiler and everything that was installed for it. Removing packages is also easier: you just one <pkgid> dir per <compiler> to find and get rid of -- and you can do it with a wildcard!
>
+1

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

Re: Managing multiple installations of GHC

Sean Leather
In reply to this post by Robert Clausecker

On Thu, Dec 2, 2010 at 05:16, Robert Clausecker wrote:
How can I install GHC 7 parallel to GHC 6.12 with the option to choose?
My OS is GNU/Linux, my Distro is Ubuntu (Lucid).

I created this for my Ubuntu VM: https://github.com/spl/multi-ghc

Regards,
Sean

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe