# ghc0865/cfg - "Build" settings for package #--------------------------------------------------------------------- [technotes] 1. "ghc" upstream releases subsequent to 8.6.5 largely broke the abil- ity for distro maintainers to build "cabal". Proposed solutions included, for example, keeping two copies of "ghc" around and using the older one (8.6.5) to build "cabal". As of Win- ter 2021, the issue remained. Until the issue is corrected, "ghc086" should be locked at release 8.6.5. "cabal" should be locked at releases 2.4.0.0 and 3.4.0.0. Note: This distro provides both of those two "cabal" releases. The package "cabal2400" builds release 2.4.0.0 and the package "cabal" builds 3.4.0.0. #--------------------------------------------------------------------- 2. This package,"ghc0865", builds and installs the core of the sys- tem's Haskell environment. If "cabal" 3.4.0.0 is built subsequently, the result is a Haskell en- vironment that's complete enough to build "pandoc" (which is, in fact, built by the package "haskell-packages"). #--------------------------------------------------------------------- 3. "ghc0865" is a tricky package from a "build" standpoint. 3.1. The package requires a compatible copy of itself to build. Additionally, the package isn't relocatable in the sense of director- ies being movable. I.e., a bootstrap copy can't be kept in the package resource tree and unpacked in a temporary tree at "build" time. #--------------------------------------------------------------------- 3.2. One approach that can be used to rebuild "ghc0865" is to use the package to rebuild itself in-place. #--------------------------------------------------------------------- 3.3. That approach isn't ideal because it leaves possibly obsolete files in place. This issue can be addressed as follows: (a) Delete the existing "$PRODTREE/ghc0865/" directory tree (b) Replace it with a copy that was backed up immediately after the most recent complete build (c) Execute: makelac ghc0865 --force A backed-up copy [or copies] suitable for use in step (b) above is/are provided in the following tarball[s]: special/ghc0865-prebuilt*.tar.bz2 Note: The pathname indicated above is relative to the directory that contains this "cfg" file. #--------------------------------------------------------------------- 3.4. Another approach is as follows. This approach produces an entire- ly new tree that is guaranteed to be clean. However, it's more compli- cated and riskier. So, the approach discussed in part 3.3 above may be preferable. Important: Back-up "$PRODTREE/ghc0865/" first. Rename the directory tree "/src/0*/*_ghc0865/" to the corresponding "/src/0*/*_ghcboot/" pathname temporarily. rm -fr $PRODTREE/ghcboot/ makelac ghcboot --force Rename the directory tree "/src/0*/*_ghcboot/" back to the correspond- ing "/src/0*/*_ghc0865/" pathname. rm -fr $PRODTREE/ghc0865/ USEGHCBOOT=yes makelac ghc0865 --force rm -fr $PRODTREE/ghcboot/ #--------------------------------------------------------------------- 4. Historical note: It's nearly impossible to bootstrap "ghc0865" using prebuilt binaries obtained from upstream and/or from another distro. We used roughly the following procedure to bootstrap this package. It probably wouldn't be possible to reproduce these steps today. * Obtain third-party binaries for the "ghc" package * Install them where they expect to be installed * Append an entry of the form ":/some-directory" to the environment variable "LD_LIBRARY_PATH". In the specified directory, put copies of any dynamic libraries that the third-party binaries require and the distro doesn't provide. * Execute: export LD_LIBRARY_PATH * Set "purge = yes" for the "ghc0865" package * Build the "ghc0865" package using the third-party binaries * Set "purge = no" for the "ghc0865" package * Remove the third-party binaries installed (this part was tricky) * Rebuild the "ghc0865" package using the new native binaries #--------------------------------------------------------------------- [buildtimes] 00.64 hours (or 038.37 minutes) - 2021 L.A. dedi box: 6x2 CPU 32GB RAM 00.68 hours (or 040.73 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM 00.91 hours (or 054.85 minutes) - 2021 Utah dedi box: 4x2 CPU 32GB RAM 00.92 hours (or 055.48 minutes) - ThinkPad W530 i7 4x2 32GB RAM 01.10 hours (or 066.22 minutes) - HP EliteBook 8560w 32GB RAM #--------------------------------------------------------------------- [settings] altpkg = yes defer = glibc64 license = See "license*.txt" in installed tree licfile = LICENSE nosyslinks = yes nowerror = true purge = no strip = no tmpsize = 3746M unpack = relaxed setpaths = gcc ghc0865 libffi libgmp ncurses numactl zlib #--------------------------------------------------------------------- [depends] actools gawk grep libffi libgmp llvmgcc # May not be needed ncurses numactl sed zlib #--------------------------------------------------------------------- [configure] TMPHOME=/tmp/home rm -fr $TMPHOME mkdir $TMPHOME export HOME=$TMPHOME rm -fr $HOME/.cabal rm -fr $HOME/.ghc export LD=`which ld` sed -e 's@^\(LD_STAGE[0-9]\).*=.*@\1=/bin/ld@' \ -i mk/config.mk.in MANBASE=$PKGDIR_PROD/man mkdir -p $MANBASE if [ "@$USEGHCBOOT" == "@1" ]; then USEGHCBOOT=true; fi if [ "@$USEGHCBOOT" == "@yes" ]; then USEGHCBOOT=true; fi if [ "@$USEGHCBOOT" == "@true" ]; then PATH=$PATH:$PRODTREE/ghcboot/bin fi bash ./configure \ --prefix=$PKGDIR_PROD \ --build=$LACARCHBUILD \ --host=$LACARCHHOST \ --disable-dependency-tracking \ --disable-ld-override \ --enable-shared=yes \ --enable-static=no \ --mandir=$MANBASE \ --with-system-libffi #--------------------------------------------------------------------- [build] PATH=`pwd`:$PATH export LD=`which ld` if [ "@$USEGHCBOOT" == "@1" ]; then USEGHCBOOT=true; fi if [ "@$USEGHCBOOT" == "@yes" ]; then USEGHCBOOT=true; fi if [ "@$USEGHCBOOT" == "@true" ]; then PATH=$PATH:$PRODTREE/ghcboot/bin fi smpmake || smpmake || make make install || make install #--------------------------------------------------------------------- # Original URLs. These URLs were valid at one point, but may have died # since then. If you download newer versions of tarballs [etc.], don't # delete the original versions, as you may not be able to replace # them. [urls] url_debian = tbd url_home = tbd url_lfs = tbd url_tarball = https://downloads.haskell.org/~ghc/\ 8.6.5/ghc-8.6.5-src.tar.xz #--------------------------------------------------------------------- [history] 180318 Added package. Started with 8.2.2. 181010 Updated to 8.6.1 191020 Updated to 8.6.5 210205 Restructured distro Haskell packages 240407 Rebuilt using "ghcboot" option