Page 1 of 1

Trouble with Haskell Platform SlackBuild

Posted: 10. Dec 2012, 13:18
by mimosa
I recently installed haskell-platform from src and the script failed at the very end where it tries to do

Code: Select all

ghc-pkg recache
I just did it by hand, and everything else had worked up to that point, so all was well. However, I was a bit surprised to find I needed root privileges. Does anyone know if this is normal?

Code: Select all

mimosa[~]$ ghc-pkg recache
ghc-pkg: /usr/lib64/ghc-7.4.2/package.conf.d/package.cache: you don't have permission to modify this file
mimosa[~]$ ls -l /usr/bin | grep ghc
lrwxrwxrwx   1 root   root           9 Dec  8 09:50 ghc -> ghc-7.4.2
-rwxr-xr-x   1 root   root         238 Dec  7 23:44 ghc-7.4.2
lrwxrwxrwx   1 root   root          13 Dec  8 09:50 ghc-pkg -> ghc-pkg-7.4.2
-rwxr-xr-x   1 root   root         264 Dec  7 23:44 ghc-pkg-7.4.2
lrwxrwxrwx   1 root   root          10 Dec  8 09:50 ghci -> ghci-7.4.2
-rwxr-xr-x   1 root   root          60 Dec  7 23:44 ghci-7.4.2
lrwxrwxrwx   1 root   root          17 Dec  8 09:50 haddock -> haddock-ghc-7.4.2
-rwxr-xr-x   1 root   root         229 Dec  7 23:44 haddock-ghc-7.4.2
-rwxr-xr-x   1 root   root         221 Dec  7 23:44 runghc
lrwxrwxrwx   1 root   root           6 Dec  8 09:50 runhaskell -> runghc
I don't imagine that was what caused the problem with the SlackBuild. Looking at the script, I can't see where the variable $GHC_PKG is defined. So doinst.sh will just contain

Code: Select all

recache
and it should always fail like this.

EDIT Here:
http://slackbuilds.org/slackbuilds/14.0 ... SlackBuild

The reason I ask is because I'm struggling with a new version of the GHC package that builds the thing from source rather than just unpacking the GHC binary distribution. So maybe that's somehow causing trouble with haskell-platform.

Re: Trouble with Haskell Platform SlackBuild

Posted: 10. Dec 2012, 15:37
by gapan
It's normal that you need root priviliges to update system files.

GHC_PKG is probably set somewhere during configure or make, so you don't set it yourself. I guess you can either do as the slackbuild does, or just (probably better this way) add something like:

Code: Select all

if [ -x usr/bin/ghc-pkg ]; then
   usr/bin/ghc-pkg recache
fi
in the doinst section, since GHC_PKG is getting the ghc-pkg value anyway. I don't suppose there's a chance it becomes something else, is there?

Re: Trouble with Haskell Platform SlackBuild

Posted: 10. Dec 2012, 17:12
by mimosa
Thanks gapan. So recache requiring root is ok (and it should also work in the SlackBuild, with its root privleges); but that variable really is empty:

Code: Select all

mimosa[~]$ cat /usr/src/slapt-src/haskell/haskell-platform/package-haskell-platform/install/doinst.sh
 recache
Note the space at the beginning of the output of cat, corresponding to the space after the empty variable in the script.

I'm assuming this is a problem with the SlackBuild for haskell-platform, not a side-effect of something to do with the new GHC package I built haskell-platform against. Can anyone who has installed haskell-platform from src recently confirm this?

Incidentally, perhaps it isn't clear: I'm not trying to package the Haskell Platform (though it's next on my list) but GHC itself, in what I hope will be an improved version. And it's got a way to go.

Re: Trouble with Haskell Platform SlackBuild

Posted: 10. Dec 2012, 17:22
by gapan
Yes, this seems like a bug with the slackbuild as well then.