Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 58588 - dev-lang/ghc-6.2.1-r2 works on amd64 (ebuild)
Summary: dev-lang/ghc-6.2.1-r2 works on amd64 (ebuild)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Chris White (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 58590 58595 69830
  Show dependency tree
 
Reported: 2004-07-27 14:57 UTC by Gabriel Ebner
Modified: 2004-11-25 00:54 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
The sacred ebuild that enables unregisterised build on amd64 (ghc-6.2.1-r2.ebuild,5.35 KB, application/octet-stream)
2004-07-27 14:59 UTC, Gabriel Ebner
Details
A script to create a binary distribution of ghc-amd64 suitable for bootstrapping (deb2tar.sh,1.09 KB, application/octet-stream)
2004-07-28 07:47 UTC, Gabriel Ebner
Details
dev-lang/ghc-deb-6.2.1 (ghc-deb-6.2.1.ebuild,1.17 KB, application/octet-stream)
2004-07-30 09:44 UTC, Gabriel Ebner
Details
dev-lang/ghc-deb-6.2.1-r1 (ghc-deb-6.2.1-r1.ebuild,1.24 KB, text/plain)
2004-09-06 06:14 UTC, Gabriel Ebner
Details
dev-lang/ghc-6.2.2 ebuild with support for unregisterised compilation (needed on amd64) (ghc-6.2.2.ebuild,5.27 KB, text/plain)
2004-10-18 05:11 UTC, Gabriel Ebner
Details
dev-lang/ghc-6.2.2-r1 (ghc-6.2.2-r1.ebuild,4.85 KB, text/plain)
2004-10-20 13:36 UTC, Gabriel Ebner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Ebner 2004-07-27 14:57:11 UTC
With the attached ebuild, dev-lang/ghc-6.2.1-r2 works on amd64.

The ebuild enables unregisterised build on architectures other than x86 or ppc, so it might be useful for other architectures than amd64 too.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Gabriel Ebner 2004-07-27 14:59:09 UTC
Created attachment 36287 [details]
The sacred ebuild that enables unregisterised build on amd64
Comment 2 Gabriel Ebner 2004-07-28 07:47:39 UTC
Created attachment 36327 [details]
A script to create a binary distribution of ghc-amd64 suitable for bootstrapping

The script will create a tmp directory for itself and won't touch anything
else.

Requirements: dpkg, internet connection (to fetch the debian package)
Comment 3 Gabriel Ebner 2004-07-30 09:44:23 UTC
Created attachment 36474 [details]
dev-lang/ghc-deb-6.2.1

This ebuild installs the debian package of ghc in /opt/ghc, in order to emerge
dev-lang/ghc-6.2.1-r2.
Comment 4 Peter 2004-09-06 02:08:40 UTC
After installing ghc-deb I get the following error
# /opt/ghc/bin/ghc
ghc-6.2.1: Can't find package.conf as /opt/ghc/lib/ghc/driver/package.conf.inplace
Comment 5 Gabriel Ebner 2004-09-06 06:12:35 UTC
I assume you've patched the ghc-deb ebuild to get ghc6-6.2.1-5, the ebuild I posted works, but the .deb is no longer available.

dev-lang/ghc-deb-6.2.1-r1 follows.
Comment 6 Gabriel Ebner 2004-09-06 06:14:31 UTC
Created attachment 39044 [details]
dev-lang/ghc-deb-6.2.1-r1
Comment 7 Peter 2004-09-22 13:36:50 UTC
Unfortunately I always get the following error when I trying to compile all but the simplest programs:
ghc-6.2.1: internal error: getMBlock: mmap: Invalid argument
    Please report this as a bug to glasgow-haskell-bugs@haskell.org,
    or http://www.sourceforge.net/projects/ghc/

This is exactly the same error I got when I tried to make an unregistered build myself. Does it work for you?
Comment 8 Gabriel Ebner 2004-09-23 07:44:23 UTC
> Unfortunately I always get the following error when I trying to compile all but the simplest programs:

Could you please post an strace, the output of emerge info and the program you're trying to compile?
Comment 9 Peter 2004-09-27 12:51:29 UTC
Ok forget what I wrote above it seems to work now :-)
regards
Comment 10 Dylan Carlson (RETIRED) gentoo-dev 2004-10-17 02:06:07 UTC
Committed as ghc-bin.  Thanks
Comment 11 Gabriel Ebner 2004-10-17 12:41:12 UTC
First of all, thank you for commiting the binary ebuild.

What was the reason you didn't commit the (actual) ghc ebuild with support for unregisterised compilation?
- Do you dislike the is_unregisterised function?
- Do you want a 6.2.2 version?
- Do you want a patch rather than a full ebuild?

I'd be happy to change it if you don't like something.
Comment 12 Dylan Carlson (RETIRED) gentoo-dev 2004-10-17 19:38:22 UTC
Actually the fact is I don't know anything about Haskell, I'm just trying to find what works and get these Haskell-related bugs out of our queue.  I smacked that ebuild together out of yours, partially.  Don't ask me why, it was late.  :)   I don't understand your comment about unregistered compilation.  I tore out anything that I didn't understand.   But, in any case, binary ebuilds belong in ghc-bin, not ghc.

We need to have dev-lang/ghc-bin up first before we can tackle a source build.  Correct me if I'm wrong here.  So, assuming that people use the new ebuild, the next step is to bootstrap a runtime in dev-lang/ghc using the runtime supplied by ghc-bin.  From there, I don't know how a system makes the distinction between the two.  I need input from people who know how Haskell is supposed to work so that we can get it going on amd64.  I have CC:'d kosmikus.
Comment 13 Gabriel Ebner 2004-10-18 05:10:16 UTC
Ok, so you didn't find the ebuild.  I'll repost it now.

Actually, the source ebuild is what the actual purpose of this bug was.
Comment 14 Gabriel Ebner 2004-10-18 05:11:32 UTC
Created attachment 42095 [details]
dev-lang/ghc-6.2.2 ebuild with support for unregisterised compilation (needed on amd64)
Comment 15 Luke Maurer (Jyrinx) 2004-10-19 18:10:59 UTC
I've got in issue with ghc-bin-6.2.1.ebuild. It merges happily on my AMD64 box, but when I run GHCi:
---
jyrinx@mythrilspoon ~ $ ghci

[...]
Loading package base ... /opt/ghc/lib/HSbase.o: unknown architecture
ghc-6.2.1: panic! (the `impossible' happened, GHC version 6.2.1):
        loadObj: failed
---
I'm not sure what's up ... I'd suspect multilib, which I only recently got (mostly) working, but of course I didn't compile these binaries ...

(Sorry if this is the wrong place ... should I file a new bug?)
Comment 16 Andres Loeh (RETIRED) gentoo-dev 2004-10-20 03:27:02 UTC
Re #15:

As far as I can see it, there are only unregistered builds for ghc
on amd64 at the moment. This means, among other things, that ghci
won't work.

Thus, to my knowledge, this isn't a bug, but expected behaviour,
as strange as it seems ...

ks
Comment 17 Luke Maurer (Jyrinx) 2004-10-20 07:13:47 UTC
Heh ... you're right ... I was assuming that ghci works iff ghc works, especially since the error looked like it was coming from ghc. Ah, well.
Comment 18 Gabriel Ebner 2004-10-20 13:36:57 UTC
Created attachment 42267 [details]
dev-lang/ghc-6.2.2-r1

This ebuild is based on the 6.2.2 ebuild in portage, so you'll need to put
ghc-6.2.hardened.patch in files/ if you put this ebuild into PORTDIR_OVERLAY.

I'm currently emerging this ebuild, so it might not work, but I'll post again
when I've tested it.
Comment 19 Gabriel Ebner 2004-10-25 14:37:50 UTC
ghc-6.2.2-r1 works well.  darcs compiles and runs happily.
Comment 20 Chris White (RETIRED) gentoo-dev 2004-10-25 18:11:43 UTC
I'm currently working on zhen's dev box to get this working.  Things look
positive and I should have a ghc-src ebuild up.  I pretty much used Gabriel's
ebuild in order to achieve this.  If anyone else on haskell herd things there's
a better way to do this, let me know, otherwise I'll keep working with the
unregistered technique.

I'm also doing this for a couple other arches including ppc and sparc, thus
said, I'll soon be tying this to another bug # for the other arches and amd64.

ghc-6.2.2-r1 will be the version, but for testing purposes it will be
package.masked and amd64 keywords will be missing until I can get an amd64 dev
to KEYWORD it.  Once that's done, you guys should be pretty much ok to unmask
it and let er go :).

I also plan on using zhen's box to make some binaries for ghc 6.2.2 so that
you guys don't have such outdated binary versions (I think amd64 uses 5.04 as
their only valid ghc-bin version), and the binaries will be a true Gentoo
tbz binary package.  This sould make things a tad cleaner without having to 
worry about depending on .debs left and right.

I hope this clears things up :).
Comment 21 Gabriel Ebner 2004-10-26 07:32:59 UTC
> Things look positive and I should have a ghc-src ebuild up.

I just hope it's still called 'dev-lang/ghc'.

> so that you guys don't have such outdated binary versions (I think amd64 uses 5.04 as their only valid ghc-bin version)

AFAIK, ghc-5.04 doesn't even work on amd64. The current ghc-bin version for amd64 is 6.2.1 (from debian).

> and the binaries will be a true Gentoo tbz binary package.

Does that have any advantages over the current approach?  Currently building ghc from source is as easy as emerge ghc.  With your proposal, you'd need to download ghc-6.2.2-r1.tbz2, emerge it, and then emerge ghc, wouldn't you?
Comment 22 Andres Loeh (RETIRED) gentoo-dev 2004-10-26 08:21:06 UTC
The source ebuild will still be called dev-lang/ghc.

Fact is, the versions of the binaries are currently very different depending 
on architecture. I agree with chriswhite that we should get 6.2.2 up and running
for as many archs as possible.

With the "true Gentoo binary package", I'm not sure what chriswhite means
exactly either. I definitely think ghc-bin should stay. Where the archive
containing the binary comes from and how it is built, is open for debate,
though.

ks
Comment 23 Gour 2004-11-02 09:34:19 UTC
Hi!

I cannot emerge ghc on amd64. It fails with the sandbox violation (like haddock - see #69830):

[..]
===fptools== Recursively making `install' in includes utils driver docs compiler rts ...
PWD = /var/tmp/portage/ghc-6.2.2-r1/work/ghc-6.2.2/ghc
------------------------------------------------------------------------
------------------------------------------------------------------------
==fptools== make install -wr;
 in /var/tmp/portage/ghc-6.2.2-r1/work/ghc-6.2.2/ghc/includes
------------------------------------------------------------------------
mkdir //usr/lib/ghc-6.2.2
ACCESS DENIED  mkdir:     /usr/lib/ghc-6.2.2
mkdir: cannot create directory `//usr/lib/ghc-6.2.2': Permission denied
mkdir //usr/lib/ghc-6.2.2/include
ACCESS DENIED  mkdir:     /usr/lib/ghc-6.2.2/include
mkdir: cannot create directory `//usr/lib/ghc-6.2.2/include': Permission denied
make[2]: *** [install] Error 1
make[1]: *** [install] Error 1
make[1]: Leaving directory `/var/tmp/portage/ghc-6.2.2-r1/work/ghc-6.2.2/ghc'
make: *** [install] Error 1

!!! ERROR: dev-lang/ghc-6.2.2-r1 failed.
!!! Function src_install, Line 179, Exitcode 2
!!! make install failed


I'm really wondering how does it work for you?

Sincerely,
Gour



Comment 24 Andres Loeh (RETIRED) gentoo-dev 2004-11-03 06:00:05 UTC
In the debian-based ghc-bin-6.2.1 ebuild, the ghc-pkg program
was not installed properly to /opt/ghc/bin. I've added two
symlinks.

I'm not sure whether this is the only problem with the ebuild, though.

Re Gour's problem: I'm not sure what causes this atm -- all I can
say is I cannot reproduce it on x86, and that I need more information ...

ks
Comment 25 Luke Maurer (Jyrinx) 2004-11-05 17:05:59 UTC
I've tried the ghc-6.2.2-r1 ebuild from this bug. It builds fine, either from itself or from ghc-bin-6.2.1, but ghc and ghci don't work for different reasons:

jyrinx@mythrilspoon portage $ ghci

[...]

Loading package base ... //usr/lib/ghc-6.2.2/HSbase.o: unknown architecture
ghc-6.2.2: panic! (the `impossible' happened, GHC version 6.2.2):
        loadObj: failed

---

jyrinx@mythrilspoon dicedist $ ghc --make Dicedist.hs
Chasing modules from: Dicedist.hs
ghc-6.2.2: internal error: getMBlock: mmap: Invalid argument

---

Incidentally, a simple one-line "Hello World" compiles and runs fine.

(I can provide emerge --info and such if needed; didn't want to clutter the bug)
Comment 26 Gour 2004-11-13 00:40:45 UTC
Hi!

> Re Gour's problem: I'm not sure what causes this atm -- all I can
> say is I cannot reproduce it on x86, and that I need more information ...

Just to inform you that after resolving some nptl/prelink issues, dev-lang/ghc-6.2.2-r1 ebuild emerges on amd64 with the same patch as for haddock, i.e. adding "libdir0="${D}/usr/$(get_libdir)" \" in the src_install ()
function and I just compiled darcs without any problem.

Let's add some '~amd64' to Gentoo-Haskell department :-)

Sincerely,
Gour
Comment 27 Anders Höckersten 2004-11-23 01:38:02 UTC
This works for me as well on amd64, WITH the patch that was needed for Haddock. Otherwise I get a sandbox violation.

I have compiled and run darcs and some own code on this build, and they work as expected.
Comment 28 Andres Loeh (RETIRED) gentoo-dev 2004-11-24 07:03:31 UTC
ghc-6.2.2 is now ~amd64.

Cheers,
  ks
Comment 29 Simon Stelling (RETIRED) gentoo-dev 2004-11-24 09:16:18 UTC
i think we can close this bug
Comment 30 Gabriel Ebner 2004-11-24 11:34:30 UTC
As far as I can see the ebuild does not set GhcUnregisterised=YES in mk/build.mk. 
Do newer ghc's contain a ./configure check to enable the unregisterised build?
Comment 31 Andres Loeh (RETIRED) gentoo-dev 2004-11-25 00:54:01 UTC
You're right of course. Should be fixed in CVS now. Thanks.

ks