snowleopard / hadrian

Hadrian: a new build system for the Glasgow Haskell Compiler. Now merged into the GHC tree!
https://gitlab.haskell.org/ghc/ghc/tree/master/hadrian
MIT License
208 stars 37 forks source link

Provide legacy interface #255

Open hvr opened 8 years ago

hvr commented 8 years ago

I've mentioned this already elsewhere, but I think this deserves a ticket of its own:

When we switch over to Hadrian as the only buildsystem, there needs to be a legacy interface in place so that existing ci-build-scripts & deb/rpm recipes (which currently work back till at least GHC 7.0) have a chance continuing to work without having to special-case post-Hadrian GHC trees. This specifically means that the sequence of commands such as

git clone git://git.haskell.org/ghc.git --recursive
cd ghc/
./boot
./configure $some_flags
make -j4 V=0 sdist-ghc

needs to produce a tarball in ./sdistprep

Moreover, for the resulting source-tarball we need a sequence such as (radically simplified, the Debian packaging scripts do actually a lot more, and a assume a conventional autoconf/makefile interface while doing so -- diverging from that causes pain as we can't reuse debhelper's scriptlets which rely on that assumption)

        echo "HADDOCK_DOCS=YES"         >  mk/build.mk
        echo "HSCOLOUR_SRCS=YES"        >> mk/build.mk
        echo "LATEX_DOCS=NO"            >> mk/build.mk
        echo "BUILD_SPHINX_HTML=NO"     >> mk/build.mk
        echo "BUILD_SPHINX_PDF=NO"      >> mk/build.mk
        echo "BUILD_DOCBOOK_HTML=NO"    >> mk/build.mk
        echo "BUILD_DOCBOOK_PDF=NO"     >> mk/build.mk
        echo "BUILD_DOCBOOK_PS=NO"      >> mk/build.mk
        echo "GhcLibWays=v dyn p"       >> mk/build.mk
        PATH=...:$PATH ./configure --prefix=/opt/ghc/$GHCDEBVER CC=... CFLAGS=...  $some_other_flags

        make V=0 -j3

        make install prefix=/opt/ghc/$GHCDEBVER

        make clean -k

to keep working. So the minimal basic interface for source-tarballs is ENVVARS=.. ./configure $flags + make {(all),install,clean}, and this needs to be provided unless we want CI-bots & packaging to break

PS: we also need

snowleopard commented 8 years ago

@hvr Many thanks for documenting this!

Providing a make wrapper calling to Hadrian should not be difficult.

Starting by forwarding (all) and clean targets to Hadrian with all command line arguments and adding the --skip-configure flag seems to be the simplest approach.

KaiHa commented 8 years ago

I have added a sdist-ghc rule to hadrian (see here). @hvr @snowleopard maybe you can have a look at it and tell me if the direction I am heading makes sense to you. @snowleopard if you like you can assign this ticket to me.

snowleopard commented 8 years ago

@KaiHa Wow, thanks for starting to work on this. To be honest I haven't yet looked at distribution rules, so I can't really review properly. It's unclear though why you are discussing sdist rule here -- #219 seems to be a more relevant issue? Shall we continue there? Sure, I'll happily assign you.

KaiHa commented 8 years ago

It's unclear though why you are discussing sdist rule here -- #219 seems to be a more relevant issue?

You are right, let's move this discussion to #219.

izgzhen commented 7 years ago

@snowleopard What do you think about the urgency of this before merging with GHC?

snowleopard commented 7 years ago

@izgzhen It's hard for me to judge. Personally, I think it's not that hard to edit one line in a script (change make blah to build qwe), but I can see how this can be tedious if there are hundreds of such scripts.

Perhaps @bgamari can comment?