[arch-haskell] Make-based incremental build for arch-haskell

Peter Simons simons at cryp.to
Fri Oct 22 10:35:01 EDT 2010

Hi Rémy,

 >> - generates a PKGBUILD for every Cabal package,
 > Remember that except for dependency management you can use
 > manycabal2arch for this kind of task.

yes, that it is true, but manycabal2arch doesn't scale nearly as well on
multi-core machines as "make -j<n>" will.

 >> - compile the package, and
 > Due to variations in makepkg.conf, the packages generated by makepkg
 > may end up in a different directory.

What variations do you mean exactly?

 > In addition, you may want to build packages in a chroot, because we
 > need to check whether external dependencies (C libraries) are
 > correctly encoded in the PKGBUILD.

Unfortunately, I don't know much about chroot builds in ArchLinux, so
it's not obvious to me how to add that feature. It sure sounds like a
good idea, though.

 >>  hledger_name = hledger
 > This name can be obtained by the following Haskell function: [...]

It would be nice if cabeal2arch would have a flag that could be used to
obtain that information, as in the following (imaginary) examples:

  $ cabal2arch --arch-name hledger

  $ cabal2arch --arch-name HUnit

 >> $(pandoc_tarball) : $(HTTP_tarball) $(xhtml_tarball) $(texmath_tarball) $(zip-archive_tarball)
 >> $(network_tarball) : $(parsec_tarball)
 >> $(HTTP_tarball) : $(network_tarball)
 >> $(texmath_tarball) : $(xml_tarball) $(parsec_tarball)
 >> $(zip-archive_tarball) : $(digest_tarball) $(zlib_tarball) $(binary_tarball)
 >> Maintaining that information manually is out of question, IMHO, and we
 >> really ought to generate that information from the Cabal files.
 > This is mainly why I chose shell scripts over Makefiles for my own
 > system.

I don't see how that would make much of a difference. An accurate
dependency graph is required no matter whether bash or make is used to
build the packages. The two tools just differ in the way that they
represent those dependencies. IMHO, make is clearly superior for this
kind of task because it's been designed to traverse dependency graphs.

 > Dependency checks should not necessarily be done according to the
 > modification time of file, but according to the pkgrel (which should
 > be bumped when necessary).

Well, cabal2arch generally sets pkgrel=1, and I am not aware of any way
to change that behavior. So I don't see how anyone could use $pkgrel for
anything at all, really? Am I missing something?

 > #!/bin/bash
 > #This is makedepends.sh
 > for pkg in *
 > do
 >   source $pkg/PKGBUILD
 >   echo -n "\$(${pkg}_tarball):"
 >   for dep in $depends[@] $makedepends[@]
 >   do
 >     dep=${dep%>*}
 >     dep=${dep%=*}
 >     dep=${dep%<*}
 >     [ -d "$dep" ] && echo -n " \$(${dep}_tarball)"
 >   done
 >   echo
 > done

I would prefer to generate the dependency graph from the Cabal files,
because the information found in PKGBUILDs cannot be considered reliable
until the test builds have succeeded. It seems to be easy enough to
write a short cabal2make converter, so from the looks of it that's the
solution I favor at the moment.

Take care,

More information about the arch-haskell mailing list