Re: ghc 8.6.4 upgrade Sep 15

2019-09-23 Thread Matthias Kilian
Hi,

On Thu, Sep 19, 2019 at 11:10:20AM -0700, Greg Steuck wrote:
> I feel pretty good about the state of
> https://github.com/blackgnezdo/ports/tree/ghc_864_sep15 on 6.6-beta amd64
> as of Sep 15.
> 
> All the packages transitively depending on lang/ghc build and install in a
> proot of a clean machine. I confirmed I can run darcs, xmonad, hedgewars,
> shellcheck.
[...]

Great. Thanks!

I've started a build on i386, to see how it goes there and to find
a way to get rid of the arch-specific directories
(lib/x86_64-openbsd-ghc-${MODGHC_VER}/) in hs-ports.

> Should we consider putting on any finishing touches and committing after
> post 6.6 release?

If we get it ready before the ports tree is locked, it could also
go in before the release.

Ciao,
Kili



Re: ghc 8.6.4 upgrade Sep 15

2019-09-24 Thread Matthias Kilian
On Mon, Sep 23, 2019 at 11:39:51PM +0200, Matthias Kilian wrote:
> Still to clarify / fix:
> 
> - architecture-dependent directories in hs-ports.

Which can be "fixed" by this one (a better fix would be to patch ghc-pkg
and/or cabal to use libdir/libsubdir for shared libraries the same way
as for static libraries and to drop the $arch-$os-$compiler patterns):

Index: ghc.port.mk
===
RCS file: /cvs/ports/lang/ghc/ghc.port.mk,v
retrieving revision 1.43
diff -u -p -r1.43 ghc.port.mk
--- ghc.port.mk 10 Sep 2019 13:51:21 -  1.43
+++ ghc.port.mk 24 Sep 2019 09:34:24 -
@@ -64,13 +64,15 @@ MODGHC_SETUP_CONF_ENV ?=
 MODGHC_SETUP_CONF_ARGS +=  --datasubdir=hs-\$$pkgid
 MODGHC_SETUP_CONF_ARGS +=  --docdir=\$$datadir/doc/hs-\$$pkgid
 MODGHC_SETUP_CONF_ARGS +=  --libsubdir=ghc/\$$pkgid
+MODGHC_SETUP_CONF_ARGS +=  --dynlibdir=${PREFIX}/lib/ghc/\$$pkgid
 MODGHC_SETUP_CONF_ARGS +=  --enable-library-profiling
 .  else
 # Override Cabal defaults, which are $arch-$os-$compiler/$pkgid for
-# datasubdir and libsubdir and $datadir/doc/$arch-$os-$compiler/$pkgid
-# for docdir.
+# datasubdir and libsubdir, $datadir/doc/$arch-$os-$compiler/$pkgid
+# for docdir and ${PREFIX}/lib/$arch-$os-$compiler/$pkgid for dynlibdir.
 MODGHC_SETUP_CONF_ARGS +=  --datasubdir=\$$pkgid
 MODGHC_SETUP_CONF_ARGS +=  --libsubdir=\$$pkgid
+MODGHC_SETUP_CONF_ARGS +=  --dynlibdir=${PREFIX}/lib/ghc/\$$pkgid
 MODGHC_SETUP_CONF_ARGS +=  --docdir=\$$datadir/doc/\$$pkgid
 .  endif
 

> - the libffi shared library  built from the bundled ffi; not sure wether
>   this is a problem or not, but it looks a little bit scary.

And indeed. After a few iterations of fixing plists of hs-ports (after
the dynlibdir patch above), with pkg_delete -a in between, I ran into
build errors like this one:

===>  Configuring for hs-vector-0.12.0.3
ld.so: ghc: can't load library 'libffi.so.1.2'
Killed 

The ghc binary was linked against our system libffi (from devel/libffi),
and after the pkg_delete -a and a restart of dpb, this was missing. So
I'll now try to build ghc using our libffi instead of the bundled one.

Ciao,
Kili