[Git][haskell-team/DHG_packages][experimental] 23 commits: ghc: Add hadrian bootstrap plans for GHC 9.4.6

Ilias Tsitsimpis (@iliastsi) gitlab at salsa.debian.org
Tue Oct 10 20:54:49 BST 2023



Ilias Tsitsimpis pushed to branch experimental at Debian Haskell Group / DHG_packages


Commits:
8aaf7f63 by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Add hadrian bootstrap plans for GHC 9.4.6

- - - - -
21887039 by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Patch hadrian to pass Haddock options

- - - - -
e73ed86c by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Patch hadrian to use realpath

- - - - -
1429eab4 by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Patch hadrian to properly install iserv

- - - - -
a51bffd3 by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Build using hadrian

- - - - -
74c80846 by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Disable patches that depend on the Makefile build system

- - - - -
4da55905 by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Minor fixes

Fix the symlink for '/usr/lib/ghc/lib/package.conf.d'. Aslo do not
move unlit since ghc expects to find it in '/usr/lib/ghc/lib/bin/unlit'.

- - - - -
cefe2845 by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Set LLVM version during configuration

- - - - -
54ae063f by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Set LC_ALL=C.UTF-8 which is needed to build docs

- - - - -
5c1ba29e by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Remove .stamp file

- - - - -
5ecf9ea8 by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Support cross compilation (WIP)

- - - - -
ab91fcae by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Disable cross-compilation

Unfortunately, cross compilation seems to be impossible with newer
versions of GHC. For more information, see
https://gitlab.haskell.org/ghc/ghc/-/issues/23975.

- - - - -
0d08bdbd by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Replace pkgroot

- - - - -
f4aba036 by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: New upstream release (9.4.7)

- - - - -
af7405ea by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Add Hadrian bootstrapping plans for GHC 9.4.7

- - - - -
ab3c0e6b by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Disable threaded RTS in hadrian

- - - - -
9598e16c by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Build registerised on s390x and riscv64

- - - - -
1948e99e by Ilias Tsitsimpis at 2023-10-10T22:06:26+03:00
ghc: Backport patch to fix hs_cmpxchg64

- - - - -
9005088f by Ilias Tsitsimpis at 2023-10-10T22:06:27+03:00
ghc: Remove obsolete patch

- - - - -
4f0a7149 by Ilias Tsitsimpis at 2023-10-10T22:06:27+03:00
ghc: Pass host/target in install configure script

- - - - -
7644e412 by Ilias Tsitsimpis at 2023-10-10T22:06:27+03:00
ghc: Backport patch for 32-bit unreg

- - - - -
e7bda87f by Ilias Tsitsimpis at 2023-10-10T22:06:27+03:00
ghc: Re-generate the stage2 package cache

I have noticed that on some rare cases the package cache generated for
stage2 is stale. This is probably an upstream bug, and it wouldn't
affect us (the package cache for binary-dist-dir is correct), but we use
ghc-pkg from stage2 when we generate our control file. Maybe we should
consider using ghc-pkg from binary-dist-dir instead.

As a work-around for now, regenerate the stage2 package cache.

Also, drop the hadrian-no-pkg-recache patch for now, since we don't
support cross building GHC yet.

- - - - -
f26884ae by Ilias Tsitsimpis at 2023-10-10T22:09:08+03:00
ghc: Upload to experimental

- - - - -


29 changed files:

- p/ghc/debian/changelog
- p/ghc/debian/control
- p/ghc/debian/ghc-doc.doc-base.users-guide
- − p/ghc/debian/ghc-haddock.manpages
- + p/ghc/debian/ghc.links
- − p/ghc/debian/ghc.preinst
- − p/ghc/debian/ghc6-doc.prerm
- − p/ghc/debian/ghc6.preinst
- + p/ghc/debian/patches/allow-setting-llvm-program
- − p/ghc/debian/patches/build-fix-hs-constants.patch
- + p/ghc/debian/patches/fix-32-bit-unreg
- − p/ghc/debian/patches/fix-bytestring-9.4.6
- + p/ghc/debian/patches/fix-cross-compilation
- + p/ghc/debian/patches/fix-hs_cmpxchg64
- − p/ghc/debian/patches/fix-index-html-removal
- − p/ghc/debian/patches/ghc-warnings.mk-CC-Wall.patch
- + p/ghc/debian/patches/hadrian-disable-threaded
- + p/ghc/debian/patches/hadrian-haddock-opts
- + p/ghc/debian/patches/hadrian-iserv
- + p/ghc/debian/patches/hadrian-plans
- + p/ghc/debian/patches/hadrian-relpath
- − p/ghc/debian/patches/separate-docs
- p/ghc/debian/patches/series
- + p/ghc/debian/patches/sparc-support
- − p/ghc/debian/patches/use-debian-gen_contents_index
- − p/ghc/debian/patches/use-stage1-binaries-for-install.patch
- p/ghc/debian/provided_substvars
- p/ghc/debian/rules
- p/ghc/debian/watch


Changes:

=====================================
p/ghc/debian/changelog
=====================================
@@ -1,8 +1,15 @@
-ghc (9.4.6-2) UNRELEASED; urgency=medium
+ghc (9.4.7-1~exp1) experimental; urgency=medium
 
+  * New upstream release
   * Declare compliance with Debian policy 4.6.2
-
- -- Ilias Tsitsimpis <iliastsi at debian.org>  Sun, 27 Aug 2023 12:33:23 +0300
+  * Use the Hadrian build system (Closes: #1051493)
+  * Pass '-optcggc-min-expand=10' when building for hppa (Closes: #1050879)
+  * Add patch to restore minimal build support for sparc and
+    sparc64 (Closes: #1052142)
+  * Build registerised on s390x and riscv64
+  * Backport patch for 32-bit unregisterised builds (Closes: #1052306)
+
+ -- Ilias Tsitsimpis <iliastsi at debian.org>  Tue, 10 Oct 2023 22:08:48 +0300
 
 ghc (9.4.6-1) unstable; urgency=medium
 


=====================================
p/ghc/debian/control
=====================================
@@ -9,21 +9,21 @@ Standards-Version: 4.6.2
 Rules-Requires-Root: no
 Build-Depends:
   debhelper-compat (= 12),
-  haskell-devscripts-minimal <!cross>,
+  haskell-devscripts-minimal (>= 0.16.31) <!cross>,
   devscripts,
-  grep-dctrl,
   pkg-config,
   ghc:native (>= 9.0),
+  hadrian:native (>= 9.4) <!pkg.ghc.nohadrian>,
+  hadrian:native (<< 9.5) <!pkg.ghc.nohadrian>,
+  llvm-15 [armel armhf s390x riscv64],
   libgmp-dev,
-  llvm-15 [armel armhf],
   libffi-dev,
   libncurses-dev,
+  python3:native,
   python3-sphinx <!cross>,
-  python3-sphinx-rtd-theme <!cross>,
-  dpkg-dev (>= 1.16.1.1)
 Build-Depends-Indep:
   hscolour,
-  fop
+  python3-sphinx-rtd-theme,
 Build-Conflicts: ccache
 Homepage: https://haskell.org/ghc/
 Vcs-Git: https://salsa.debian.org/haskell-team/DHG_packages.git [p/ghc]
@@ -32,7 +32,7 @@ Vcs-Browser: https://salsa.debian.org/haskell-team/DHG_packages/tree/master/p/gh
 Package: ghc
 Architecture: any
 Depends:
-  llvm-15 [armel armhf],
+  llvm-15 [armel armhf s390x riscv64],
   gcc,
   libgmp-dev,
   libffi-dev,
@@ -51,34 +51,28 @@ Provides:
   haddock,
   ghc-haddock,
   ${haddock:Provides}
-Replaces: ghc6 (<< 7), ghc-dynamic (<< 7.8), ghc-haddock (<< 7.10), ${conflicting-devs}
-Conflicts: ghc6 (<< 7), ghc-dynamic (<< 7.8)
-Breaks: cabal-install (<< 1.22), haskell-devscripts (<< 0.8.13),
- ghc-doc (<< 7.10), ghc-haddock (<< 7.10), ${conflicting-devs}
-Suggests: perl, ghc-prof, ghc-doc, haskell-doc, llvm-15
+Replaces: ${conflicting-devs}
+Breaks: ${conflicting-devs}
+Suggests: perl, ghc-prof, ghc-doc, llvm-15
 Description: The Glasgow Haskell Compilation system
  The Glorious Glasgow Haskell Compilation system (GHC) is a compiler for
  Haskell.
  .
  Haskell is "the" standard lazy functional programming language.  The language
- definition and additional documentation can be found in the `haskell-doc'
- package.  Alternatively, there is an online version at
- http://haskell.org/onlinereport/.
+ definition and additional documentation can be found at
+ https://www.haskell.org/documentation/.
 
 Package: ghc-prof
 Architecture: any
 Provides: ${provided-profs}, ${haskell:Provides}
 Depends: ghc (= ${binary:Version}), ${misc:Depends}
-Replaces: ghc6-prof (<< 7)
-Conflicts: ghc6-prof (<< 7)
 Description: Profiling libraries for the Glasgow Haskell Compilation system
  The Glorious Glasgow Haskell Compilation system (GHC) is a compiler for
  Haskell.
  .
  Haskell is "the" standard lazy functional programming language.  The language
- definition and additional documentation can be found in the `haskell-doc'
- package.  Alternatively, there is an online version at
- http://haskell.org/onlinereport/.
+ definition and additional documentation can be found at
+ https://www.haskell.org/documentation/.
  .
  This package contains additional profiling libraries. They are only needed,
  if you want to take a closer look on where exactly your program burns CPU
@@ -87,11 +81,7 @@ Description: Profiling libraries for the Glasgow Haskell Compilation system
 Package: ghc-doc
 Section: doc
 Architecture: all
-Suggests: haskell-doc
 Provides: ${provided-docs}
-Replaces: ghc6-doc (<< 7), libghc-terminfo-doc (<< 0.3.2.5-4), libghc-transformers-doc (<< 0.3.0.0-6), libghc-xhtml-doc (<< 3000.2.1-5)
-Conflicts: ghc6-doc (<< 7), ghc (<= 7.0.3-1)
-Breaks: libghc-terminfo-doc (<< 0.3.2.5-4), libghc-transformers-doc (<< 0.3.0.0-6), libghc-xhtml-doc (<< 3000.2.1-5)
 Depends: ${haddock:Depends}, ${misc:Depends}, perl, libjs-mathjax
 Pre-Depends: dpkg (>= 1.16.1)
 Description: Documentation for the Glasgow Haskell Compilation system
@@ -99,9 +89,8 @@ Description: Documentation for the Glasgow Haskell Compilation system
  Haskell.
  .
  Haskell is "the" standard lazy functional programming language.  The language
- definition and additional documentation can be found in the `haskell-doc'
- package.  Alternatively, there is an online version at
- http://haskell.org/onlinereport/.
+ definition and additional documentation can be found at
+ https://www.haskell.org/documentation/.
  .
  This package includes HTML, DVI and PS versions of the SGML-based
  documentation around GHC.


=====================================
p/ghc/debian/ghc-doc.doc-base.users-guide
=====================================
@@ -1,14 +1,13 @@
 Document: ghc-users-guide
-Title: GHC6 User's manual
+Title: GHC User's manual
 Author: The GHC Team
 Abstract: Glorious Glasgow Haskell Compilation system
- (GHC). GHC is a compiler for Haskell98.
+ (GHC). GHC is a compiler for Haskell.
  <br>
- Haskell is "the" standard lazy functional programming language. Haskell98
- is the current version of the language. The language definition and
- additional documentation can be found in the `haskell-doc' package.
- Alternatively, there is an online version at
- http://haskell.org/onlinereport/.
+ Haskell is "the" standard lazy functional programming language.
+ The language definition and additional documentation can be found in the
+ `haskell-doc' package. Alternatively, there is an online version at
+ https://www.haskell.org/documentation/.
 Section: Programming/Haskell
 
 Format: HTML


=====================================
p/ghc/debian/ghc-haddock.manpages deleted
=====================================
@@ -1 +0,0 @@
-debian/haddock.1


=====================================
p/ghc/debian/ghc.links
=====================================
@@ -0,0 +1,7 @@
+# The package-db (for ghc-pkg) is '/usr/lib/ghc/lib/package.conf.d',
+# but all our Haskell library packages install their package configuration
+# files in '/var/lib/ghc/package.conf.d'.
+# Create a symlink, so that 'ghc-pkg' continues to work.
+# In the future, we should decide whether it makes sense to modify the
+# default package-db for ghc-pkg, or move everything under /usr/lib.
+/var/lib/ghc/package.conf.d /usr/lib/ghc/lib/package.conf.d


=====================================
p/ghc/debian/ghc.preinst deleted
=====================================
@@ -1,29 +0,0 @@
-#! /bin/sh
-# preinst script for ghc
-
-set -e
-
-case "$1" in
-    install)
-	if test -n "$2"; then
-	    if dpkg --compare-versions "$2" "<<" "6.10.3" && dpkg --compare-versions "$2" ">>" "6.10.1"; then
-		rm -f /usr/lib/ghc-6.10.1/package.conf*
-		rmdir --ignore-fail-on-non-empty /usr/lib/ghc-6.10.1
-	    fi
-	fi
-	;;
-    upgrade|abort-upgrade)
-	exit 0
-	;;
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 0
-	;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0


=====================================
p/ghc/debian/ghc6-doc.prerm deleted
=====================================
@@ -1,39 +0,0 @@
-#! /bin/sh
-# prerm script for ghc6-doc
-
-set -e
-
-# summary of how this script can be called:
-#        * <prerm> `remove'
-#        * <old-prerm> `upgrade' <new-version>
-#        * <new-prerm> `failed-upgrade' <old-version>
-#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
-#        * <deconfigured's-prerm> `deconfigure' `in-favour'
-#          <package-being-installed> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see /usr/doc/packaging-manual/
-
-case "$1" in
-    remove|upgrade|deconfigure|failed-upgrade)
-        rm -f /usr/share/doc/ghc6-doc/libraries/doc-index*.html
-        rm -f /usr/share/doc/ghc6-doc/libraries/haddock.css
-        rm -f /usr/share/doc/ghc6-doc/libraries/haddock.js
-        rm -f /usr/share/doc/ghc6-doc/libraries/index.html
-        rm -f /usr/share/doc/ghc6-doc/libraries/libraries.txt
-        rm -f /usr/share/doc/ghc6-doc/libraries/haskell_icon.gif
-        rm -f /usr/share/doc/ghc6-doc/libraries/minus.gif
-        rm -f /usr/share/doc/ghc6-doc/libraries/plus.gif
-    ;;
-    *)
-        echo "prerm called with unknown argument \`$1'" >&2
-        exit 0
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-


=====================================
p/ghc/debian/ghc6.preinst deleted
=====================================
@@ -1,27 +0,0 @@
-#! /bin/sh
-# preinst script for ghc6
-
-set -e
-
-case "$1" in
-    upgrade)
-    	# Remove the .cache file of any previous ghc6 installation, to avoid dpkg warnings 
-	# about non-empty directories to be remoed.
-    	rm -f /var/lib/ghc-6.*/package.conf.d/package.cache || true
-	exit 0
-	;;
-    install|abort-upgrade)
-	exit 0
-	;;
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 0
-	;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0


=====================================
p/ghc/debian/patches/allow-setting-llvm-program
=====================================
@@ -0,0 +1,55 @@
+Description: Allow setting path for LLC/OPT during configuration
+ Patch configure.ac to allow us to modify the path for LLC/OPT during
+ configuration.
+Author: Ilias Tsitsimpis <iliastsi at debian.org>
+
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -600,14 +600,18 @@ AC_SUBST([ClangCmd])
+ dnl ** Which LLVM llc to use?
+ dnl --------------------------------------------------------------
+ AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]])
+-FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion])
++if test -z "$LLC"; then
++  FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion])
++fi
+ LlcCmd="$LLC"
+ AC_SUBST([LlcCmd])
+ 
+ dnl ** Which LLVM opt to use?
+ dnl --------------------------------------------------------------
+ AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]])
+-FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion])
++if test -z "$OPT"; then
++  FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion])
++fi
+ OptCmd="$OPT"
+ AC_SUBST([OptCmd])
+ 
+Index: b/distrib/configure.ac.in
+===================================================================
+--- a/distrib/configure.ac.in
++++ b/distrib/configure.ac.in
+@@ -145,14 +145,18 @@ LlvmMaxVersion=@LlvmMaxVersion@
+ dnl ** Which LLVM llc to use?
+ dnl --------------------------------------------------------------
+ AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]])
+-FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion])
++if test -z "$LLC"; then
++  FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion])
++fi
+ LlcCmd="$LLC"
+ AC_SUBST([LlcCmd])
+ 
+ dnl ** Which LLVM opt to use?
+ dnl --------------------------------------------------------------
+ AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]])
+-FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion])
++if test -z "$OPT"; then
++  FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion])
++fi
+ OptCmd="$OPT"
+ AC_SUBST([OptCmd])
+ 


=====================================
p/ghc/debian/patches/build-fix-hs-constants.patch deleted
=====================================
@@ -1,25 +0,0 @@
-Origin: https://gitlab.haskell.org/ghc/ghc/-/issues/20287#note_422320
-Description: Fix build on all architectures.
- exited with an error:
- ghc: panic! (the 'impossible' happened)
- (GHC version 9.2.0.20210821:
- Couldn't find #define HS_CONSTANTS " in
-Index: b/compiler/GHC/Unit/State.hs
-===================================================================
---- a/compiler/GHC/Unit/State.hs
-+++ b/compiler/GHC/Unit/State.hs
-@@ -661,7 +661,13 @@ initUnits logger dflags cached_dbs home_
-       -- really need to use the platform constants but they have not been loaded.
-       case lookupUnitId unit_state rtsUnitId of
-         Nothing   -> return Nothing
--        Just info -> lookupPlatformConstants (fmap ST.unpack (unitIncludeDirs info))
-+        Just info ->
-+          let
-+            p :: String
-+            p = topDir dflags ++ "/include"
-+            ps :: [String]
-+            ps = fmap ST.unpack (unitIncludeDirs info)
-+          in lookupPlatformConstants (p : ps)
- 
-   return (dbs,unit_state,home_unit,mconstants)
- 


=====================================
p/ghc/debian/patches/fix-32-bit-unreg
=====================================
@@ -0,0 +1,38 @@
+commit 9194c9c066a31cbb7a49830e4b5e2454fd4af6ba
+Author: Cheng Shao <terrorjack at type.dance>
+Date:   Mon Jan 23 13:17:07 2023 +0000
+
+    CmmToC: fix CmmRegOff for 64-bit register on a 32-bit target
+    
+    We used to print the offset value to a platform word sized integer.
+    This is incorrect when the offset is negative (e.g. output of cmm
+    constant folding) and the register is 64-bit but on a 32-bit target,
+    and may lead to incorrect runtime result (e.g. #22607).
+    
+    The fix is simple: just treat it as a proper MO_Add, with the correct
+    width info inferred from the register itself.
+    
+    Metric Increase:
+        T12707
+        T13379
+        T4801
+        T5321FD
+        T5321Fun
+    
+    (cherry picked from commit d151546e59a50158f25c3df6728b00d3c27bb4b9)
+
+Index: b/compiler/GHC/CmmToC.hs
+===================================================================
+--- a/compiler/GHC/CmmToC.hs
++++ b/compiler/GHC/CmmToC.hs
+@@ -382,8 +382,8 @@ pprExpr platform e = case e of
+     CmmRegOff reg 0    -> pprCastReg reg
+ 
+     -- CmmRegOff is an alias of MO_Add
+-    CmmRegOff reg i -> pprCastReg reg <> char '+' <>
+-                       pprHexVal platform (fromIntegral i) (wordWidth platform)
++    CmmRegOff reg i    -> pprExpr platform $ CmmMachOp (MO_Add w) [CmmReg reg, CmmLit $ CmmInt (toInteger i) w]
++      where w = cmmRegWidth platform reg
+ 
+     CmmMachOp mop args -> pprMachOpApp platform mop args
+ 


=====================================
p/ghc/debian/patches/fix-bytestring-9.4.6 deleted
=====================================
@@ -1,28 +0,0 @@
-From 2bdeb7b0e7dd100fce9e1f4d1ecf1cd6b5b9702c Mon Sep 17 00:00:00 2001
-From: Matthew Craven <clyring at gmail.com>
-Date: Tue, 8 Aug 2023 14:25:03 -0400
-Subject: [PATCH] Use a more specific include than Rts.h (#607)
-
-The Rts.h include seems to cause build problems.
-See also:
-  https://gitlab.haskell.org/ghc/ghc/-/issues/23789
-  https://github.com/haskell/bytestring/issues/606
-
-(cherry picked from commit e8a9b522063a203424eac3357873e4a8f2a09965)
----
- cbits/is-valid-utf8.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: b/libraries/bytestring/cbits/is-valid-utf8.c
-===================================================================
---- a/libraries/bytestring/cbits/is-valid-utf8.c
-+++ b/libraries/bytestring/cbits/is-valid-utf8.c
-@@ -50,7 +50,7 @@ SUCH DAMAGE.
- #endif
- 
- #include <MachDeps.h>
--#include "Rts.h"
-+#include "ghcplatform.h"
- 
- #ifdef WORDS_BIGENDIAN
- #define to_little_endian(x) __builtin_bswap64(x)


=====================================
p/ghc/debian/patches/fix-cross-compilation
=====================================
@@ -0,0 +1,46 @@
+commit bd92182cd56140ffb2f68ec01492e5aa6333a8fc
+Author: Ben Gamari <bgamari.foss at gmail.com>
+Date:   Tue Jun 21 14:05:59 2022 +0000
+
+    configure: Use AC_PATH_TOOL to detect tools
+    
+    Previously we used AC_PATH_PROG which, as noted by #21601, does not
+    look for tools with a target prefix,
+    breaking cross-compilation.
+    
+    Fixes #21601.
+
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -357,20 +357,17 @@ FP_FIND_ROOT
+ if test "$HostOS" = "mingw32" -a "$EnableDistroToolchain" = "NO"; then
+     FP_SETUP_WINDOWS_TOOLCHAIN
+ else
+-    # Ideally should use AC_CHECK_TARGET_TOOL but our triples
+-    # are screwed up. Configure doesn't think they're ever equal and
+-    # so never tried without the prefix.
+-    AC_PATH_PROG([CC],[gcc], [clang])
+-    AC_PATH_PROG([CXX],[g++], [clang++])
+-    AC_PATH_PROG([NM],[nm])
++    AC_PATH_TOOL([CC],[gcc], [clang])
++    AC_PATH_TOOL([CXX],[g++], [clang++])
++    AC_PATH_TOOL([NM],[nm])
+     # N.B. we don't probe for LD here but instead
+     # do so in FIND_LD to avoid #21778.
+-    AC_PATH_PROG([AR],[ar])
+-    AC_PATH_PROG([RANLIB],[ranlib])
+-    AC_PATH_PROG([OBJDUMP],[objdump])
+-    AC_PATH_PROG([DllWrap],[dllwrap])
+-    AC_PATH_PROG([Windres],[windres])
+-    AC_PATH_PROG([Genlib],[genlib])
++    AC_PATH_TOOL([AR],[ar])
++    AC_PATH_TOOL([RANLIB],[ranlib])
++    AC_PATH_TOOL([OBJDUMP],[objdump])
++    AC_PATH_TOOL([DllWrap],[dllwrap])
++    AC_PATH_TOOL([Windres],[windres])
++    AC_PATH_TOOL([Genlib],[genlib])
+ 
+     HAVE_GENLIB=False
+     if test "$HostOS" = "mingw32"; then


=====================================
p/ghc/debian/patches/fix-hs_cmpxchg64
=====================================
@@ -0,0 +1,39 @@
+commit 9fa545722f9151781344446dd5501db38cb90dd1
+Author: Cheng Shao <terrorjack at type.dance>
+Date:   Mon Feb 27 19:11:27 2023 +0000
+
+    ghc-prim: fix hs_cmpxchg64 function prototype
+    
+    hs_cmpxchg64 must return a StgWord64, otherwise incorrect runtime
+    results of 64-bit MO_Cmpxchg will appear in 32-bit unregisterised
+    builds, which go unnoticed at compile-time due to C implicit casting
+    in .hc files.
+
+Index: b/libraries/ghc-prim/cbits/atomic.c
+===================================================================
+--- a/libraries/ghc-prim/cbits/atomic.c
++++ b/libraries/ghc-prim/cbits/atomic.c
+@@ -308,8 +308,8 @@ hs_cmpxchg32(StgWord x, StgWord old, Stg
+   return __sync_val_compare_and_swap((volatile StgWord32 *) x, (StgWord32) old, (StgWord32) new);
+ }
+ 
+-extern StgWord hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new);
+-StgWord
++extern StgWord64 hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new);
++StgWord64
+ hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
+ {
+   return __sync_val_compare_and_swap((volatile StgWord64 *) x, old, new);
+Index: b/rts/include/stg/Prim.h
+===================================================================
+--- a/rts/include/stg/Prim.h
++++ b/rts/include/stg/Prim.h
+@@ -41,7 +41,7 @@ StgWord64 hs_atomic_xor64(StgWord x, Stg
+ StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new_);
+ StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new_);
+ StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new_);
+-StgWord hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new_);
++StgWord64 hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new_);
+ StgWord hs_atomicread8(StgWord x);
+ StgWord hs_atomicread16(StgWord x);
+ StgWord hs_atomicread32(StgWord x);


=====================================
p/ghc/debian/patches/fix-index-html-removal deleted
=====================================
@@ -1,18 +0,0 @@
-Description: Do not remove docs/index.html
- Commit 9ddda31cd3a208411c642d8c081207718782f80c changed ./configure
- which now doesn't generate the docs/index.html file, but forgot to
- modify the 'distclean' rule to not remove this file.
-Author: Ilias Tsitsimpis <iliastsi at debian.org>
-
-Index: b/ghc.mk
-===================================================================
---- a/ghc.mk
-+++ b/ghc.mk
-@@ -1460,7 +1460,6 @@ distclean : clean
- 	$(call removeFiles,docs/users_guide/ug-book.xml)
- 	$(call removeFiles,docs/users_guide/ug-ent.xml)
- 	$(call removeFiles,docs/users_guide/ghc_config.py)
--	$(call removeFiles,docs/index.html)
- 	$(call removeFiles,libraries/prologue.txt)
- 	$(call removeFiles,distrib/configure.ac)
- 	$(call removeFiles,ch01.html ch02.html index.html)


=====================================
p/ghc/debian/patches/ghc-warnings.mk-CC-Wall.patch deleted
=====================================
@@ -1,12 +0,0 @@
---- ghc-8.4.3/mk/warnings.mk~	2018-02-04 02:30:11.000000000 +0900
-+++ ghc-8.4.3/mk/warnings.mk	2018-09-29 14:33:37.607884921 +0900
-@@ -1,6 +1,6 @@
- # See Note [Order of warning flags].
--SRC_CC_OPTS     += -Wall $(WERROR)
-+#SRC_CC_OPTS     += -Wall $(WERROR)
- SRC_HC_OPTS     += -Wall
- # Don't add -Werror to SRC_HC_OPTS_STAGE0 (or SRC_HC_OPTS), because otherwise
- # validate may unnecessarily fail when booting with an older compiler.
- # It would be better to only exclude certain warnings from becoming errors
-
-Diff finished.  Sat Sep 29 14:35:43 2018


=====================================
p/ghc/debian/patches/hadrian-disable-threaded
=====================================
@@ -0,0 +1,28 @@
+Index: b/hadrian/hadrian.cabal
+===================================================================
+--- a/hadrian/hadrian.cabal
++++ b/hadrian/hadrian.cabal
+@@ -18,7 +18,7 @@ source-repository head
+ -- To accommodate #16873
+ flag threaded
+     manual:              True
+-    default:             True
++    default:             False
+     description:         Build with the threaded runtime for improved
+                          performance. Users with bootstrap compilers
+                          which don't support the threaded runtime should
+@@ -167,14 +167,6 @@ executable hadrian
+                        -rtsopts
+                        -fno-ignore-asserts
+ 
+-    if flag(threaded)
+-      ghc-options:
+-                       -- * -I0: Disable idle GC to avoid redundant GCs while
+-                       --        waiting for external processes
+-                       -- * -qg: Don't use parallel GC as the synchronization
+-                       --        time tends to eat any benefit.
+-                       "-with-rtsopts=-I0 -qg"
+-                       -threaded
+ 
+     if flag(selftest)
+       other-modules:   Rules.Selftest


=====================================
p/ghc/debian/patches/hadrian-haddock-opts
=====================================
@@ -0,0 +1,26 @@
+Description: Pass 'mathjax' to Haddock
+ Hadrian currently doesn't allow us to modify Haddock options, so
+ patch Hadrian to manually pass the 'mathjax' option.
+Author: Ilias Tsitsimpis <iliastsi at debian.org>
+Bug: https://gitlab.haskell.org/ghc/ghc/-/issues/23625
+
+Index: b/hadrian/src/Settings/Builders/Haddock.hs
+===================================================================
+--- a/hadrian/src/Settings/Builders/Haddock.hs
++++ b/hadrian/src/Settings/Builders/Haddock.hs
+@@ -32,6 +32,7 @@ haddockBuilderArgs = mconcat
+             , arg "-o", arg $ takeDirectory output
+             , arg "-t", arg "Haskell Hierarchical Libraries"
+             , arg "-p", arg "libraries/prologue.txt"
++            , arg "--mathjax=file:///usr/share/javascript/mathjax/MathJax.js"
+             , pure [ "--read-interface="
+                      ++ (takeFileName . takeDirectory) haddock
+                      ++ "," ++ haddock | haddock <- inputs ] ]
+@@ -60,6 +61,7 @@ haddockBuilderArgs = mconcat
+             , arg "--hyperlinked-source"
+             , arg "--hoogle"
+             , arg "--quickjump"
++            , arg "--mathjax=file:///usr/share/javascript/mathjax/MathJax.js"
+             , arg $ "--title=" ++ pkgName pkg ++ "-" ++ version
+                     ++ ": " ++ synopsis
+             , arg $ "--prologue=" ++ takeDirectory output -/- "haddock-prologue.txt"


=====================================
p/ghc/debian/patches/hadrian-iserv
=====================================
@@ -0,0 +1,18 @@
+Description: Fix installation patch for iserv/unlit
+Author: Ilias Tsitsimpis <iliastsi at debian.org>
+Bug: https://gitlab.haskell.org/ghc/ghc/-/issues/22557
+Bug: https://gitlab.haskell.org/ghc/ghc/-/issues/22697
+
+Index: b/hadrian/src/Packages.hs
+===================================================================
+--- a/hadrian/src/Packages.hs
++++ b/hadrian/src/Packages.hs
+@@ -192,7 +192,7 @@ programPath context at Context {..} = do
+     -- See: https://github.com/snowleopard/hadrian/issues/570
+     -- Likewise for @iserv@ and @unlit at .
+     name <- programName context
+-    path <- if package `elem` [iserv, touchy, unlit]
++    path <- if package `elem` [touchy, unlit]
+               then stageLibPath stage <&> (-/- "bin")
+               else stageBinPath stage
+     return $ path -/- name <.> exe


=====================================
p/ghc/debian/patches/hadrian-plans
=====================================
@@ -0,0 +1,34 @@
+Description: Add more hadrian bootstrap plans
+ Hadrian only contains bootstrap plans for previous GHC versions. Add plans for
+ the current version as well, since we may want to bootstrap hadrian with a
+ cross-compiled GHC that is of the same version as the GHC we are building here.
+Author: Ilias Tsitsimpis <iliastsi at debian.org>
+
+Index: b/hadrian/bootstrap/plan-9_4_6.json
+===================================================================
+--- /dev/null
++++ b/hadrian/bootstrap/plan-9_4_6.json
+@@ -0,0 +1 @@
++{"cabal-version":"3.4.1.0","cabal-lib-version":"3.4.1.0","compiler-id":"ghc-9.4.6","os":"linux","arch":"x86_64","install-plan":[{"type":"configured","id":"Cabal-3.6.3.0-9b44de2892bc8ee66e4c5f0661a358916f6e8b399ac6ad695ee5c9e58baa9613","pkg-name":"Cabal","pkg-version":"3.6.3.0","flags":{"bundled-binary-generic":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"ff97c442b0c679c1c9876acd15f73ac4f602b973c45bde42b43ec28265ee48f4","pkg-src-sha256":"2fa1fe88d4a8e8ffbeb45baed5526b1267a2130026c846251ac95c656364ab77","depends":["array-0.5.4.0","base-4.17.2.0","binary-0.8.9.1","bytestring-0.11.5.1","containers-0.6.7","deepseq-1.4.8.0","directory-1.3.7.1","filepath-1.4.2.2","mtl-2.2.2","parsec-3.1.16.1","pretty-1.1.3.6","process-1.6.17.0","text-2.0.2","time-1.12.2","transformers-0.5.6.2","unix-2.7.3"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"QuickCheck-2.14.2-d6d060f5b311a98616ede1550a89995a67b481c4bf7a9a19a6b7d840a3e86468","pkg-name":"QuickCheck","pkg-version":"2.14.2","flags":{"old-random":false,"templatehaskell":true},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4ce29211223d5e6620ebceba34a3ca9ccf1c10c0cf387d48aea45599222ee5aa","pkg-src-sha256":"d87b6c85696b601175274361fa62217894401e401e150c3c5d4013ac53cd36f3","depends":["base-4.17.2.0","containers-0.6.7","deepseq-1.4.8.0","random-1.2.1.1-a52954d69fa9f2fd13ab19e06b3b99ff78488848fa8d4988c9b8d38740fb8d29","splitmix-0.1.0.4-fe9eba9a212fda01fa4960e960a860fd1c5c0836d8823d2eb47b151f673e827e","template-haskell-2.19.0.0","transformers-0.5.6.2"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"array-0.5.4.0","pkg-name":"array","pkg-version":"0.5.4.0","depends":["base-4.17.2.0"]},{"type":"pre-existing","id":"base-4.17.2.0","pkg-name":"base","pkg-version":"4.17.2.0","depends":["ghc-bignum-1.3","ghc-prim-0.9.1","rts"]},{"type":"pre-existing","id":"binary-0.8.9.1","pkg-name":"binary","pkg-version":"0.8.9.1","depends":["array-0.5.4.0","base-4.17.2.0","bytestring-0.11.5.1","containers-0.6.7"]},{"type":"pre-existing","id":"bytestring-0.11.5.1","pkg-name":"bytestring","pkg-version":"0.11.5.1","depends":["base-4.17.2.0","deepseq-1.4.8.0","ghc-prim-0.9.1","template-haskell-2.19.0.0"]},{"type":"configured","id":"clock-0.8.3-41f89c65179f44e0a0649ad23e0f7497f4adf34623cfa5fddd360fe74fd564ad","pkg-name":"clock","pkg-version":"0.8.3","flags":{"llvm":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"a692159828c2cd278eaec317b3a7e9fb6d7b787c8a19f086004d15d9fa1fd72c","pkg-src-sha256":"845ce5db4c98cefd517323e005f87effceff886987305e421c4ef616dc0505d1","depends":["base-4.17.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"containers-0.6.7","pkg-name":"containers","pkg-version":"0.6.7","depends":["array-0.5.4.0","base-4.17.2.0","deepseq-1.4.8.0","template-haskell-2.19.0.0"]},{"type":"pre-existing","id":"deepseq-1.4.8.0","pkg-name":"deepseq","pkg-version":"1.4.8.0","depends":["array-0.5.4.0","base-4.17.2.0","ghc-prim-0.9.1"]},{"type":"pre-existing","id":"directory-1.3.7.1","pkg-name":"directory","pkg-version":"1.3.7.1","depends":["base-4.17.2.0","filepath-1.4.2.2","time-1.12.2","unix-2.7.3"]},{"type":"configured","id":"extra-1.7.12-434bced0705a8981779e15a29962e546ac808b163b411b4b97589d29d8209466","pkg-name":"extra","pkg-version":"1.7.12","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"3ac58d7341976173d1052e7b2837d119212d9afcf911735667c7f1ab67aec25f","pkg-src-sha256":"e571a9ec1d8865f0fbb0e0ba1eb575f783b0365c80db19b54a93600bae43b03c","depends":["base-4.17.2.0","clock-0.8.3-41f89c65179f44e0a0649ad23e0f7497f4adf34623cfa5fddd360fe74fd564ad","directory-1.3.7.1","filepath-1.4.2.2","process-1.6.17.0","time-1.12.2","unix-2.7.3"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"filepath-1.4.2.2","pkg-name":"filepath","pkg-version":"1.4.2.2","depends":["base-4.17.2.0"]},{"type":"configured","id":"filepattern-0.1.3-b0b2315f3b9e7024c1aef0c603bc22a352750bc46cb50781e647cb3f865621c6","pkg-name":"filepattern","pkg-version":"0.1.3","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"372c1733d83b90045eb29da9f010fed79bfef8771ce65eb126a1d83ecc54a9a2","pkg-src-sha256":"cc445d439ea2f65cac7604d3578aa2c3a62e5a91dc989f4ce5b3390db9e59636","depends":["base-4.17.2.0","directory-1.3.7.1","extra-1.7.12-434bced0705a8981779e15a29962e546ac808b163b411b4b97589d29d8209466","filepath-1.4.2.2"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"ghc-bignum-1.3","pkg-name":"ghc-bignum","pkg-version":"1.3","depends":["ghc-prim-0.9.1"]},{"type":"pre-existing","id":"ghc-boot-th-9.4.6","pkg-name":"ghc-boot-th","pkg-version":"9.4.6","depends":["base-4.17.2.0"]},{"type":"pre-existing","id":"ghc-prim-0.9.1","pkg-name":"ghc-prim","pkg-version":"0.9.1","depends":["rts"]},{"type":"configured","id":"hadrian-0.1.0.0-inplace-hadrian","pkg-name":"hadrian","pkg-version":"0.1.0.0","flags":{"selftest":true,"threaded":true},"style":"local","pkg-src":{"type":"local","path":"/home/iliastsi/ghc-9.4.6/hadrian/."},"dist-dir":"/home/iliastsi/ghc-9.4.6/hadrian/dist-newstyle/build/x86_64-linux/ghc-9.4.6/hadrian-0.1.0.0/x/hadrian","depends":["Cabal-3.6.3.0-9b44de2892bc8ee66e4c5f0661a358916f6e8b399ac6ad695ee5c9e58baa9613","QuickCheck-2.14.2-d6d060f5b311a98616ede1550a89995a67b481c4bf7a9a19a6b7d840a3e86468","base-4.17.2.0","bytestring-0.11.5.1","containers-0.6.7","directory-1.3.7.1","extra-1.7.12-434bced0705a8981779e15a29962e546ac808b163b411b4b97589d29d8209466","filepath-1.4.2.2","mtl-2.2.2","parsec-3.1.16.1","shake-0.19.7-0a34884117d1c1ae051fb71ab291372738b4fe99639c85970f08dbdf7c0632db","text-2.0.2","transformers-0.5.6.2","unordered-containers-0.2.19.1-f82114f26b96029e9d31fbbac2eff9f87a29ae7b932dd6a6c104ee5985698fa2"],"exe-depends":[],"component-name":"exe:hadrian","bin-file":"/home/iliastsi/ghc-9.4.6/hadrian/dist-newstyle/build/x86_64-linux/ghc-9.4.6/hadrian-0.1.0.0/x/hadrian/build/hadrian/hadrian"},{"type":"configured","id":"hashable-1.4.1.0-a0435926dbbb79c9ca4322861d7386e81a6230fba4e7384807758367ad172ba9","pkg-name":"hashable","pkg-version":"1.4.1.0","flags":{"containers":true,"integer-gmp":true,"random-initial-seed":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"50b2f002c68fe67730ee7a3cd8607486197dd99b084255005ad51ecd6970a41b","pkg-src-sha256":"e1b305c280e66ad827edeaedd6933b9fc4174f626882877eab2a08344e665e87","depends":["base-4.17.2.0","bytestring-0.11.5.1","containers-0.6.7","deepseq-1.4.8.0","ghc-bignum-1.3","ghc-prim-0.9.1","text-2.0.2"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"heaps-0.4-25b9e449dabfa5641f220ccd75254da5b3c5c5e97cead3596c6b069742284d0d","pkg-name":"heaps","pkg-version":"0.4","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"66b19fcd813b0e4db3e0bac541bd46606c3b13d3d081d9f9666f4be0f5ff14b8","pkg-src-sha256":"89329df8b95ae99ef272e41e7a2d0fe2f1bb7eacfcc34bc01664414b33067cfd","depends":["base-4.17.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-dgtable-0.5.2-2e674cc0727cb8f70a42e221d7ac7db71e7f5b10716b0fad22ffbac3128bb2fb","pkg-name":"js-dgtable","pkg-version":"0.5.2","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"f75cb4fa53c88c65794becdd48eb0d3b2b8abd89a3d5c19e87af91f5225c15e4","pkg-src-sha256":"e28dd65bee8083b17210134e22e01c6349dc33c3b7bd17705973cd014e9f20ac","depends":["base-4.17.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-flot-0.8.3-c96bff4f7307d099e369eb05541151317871057b30c3d7805785bdcb6b08b13e","pkg-name":"js-flot","pkg-version":"0.8.3","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4c1c447a9a2fba0adba6d30678302a30c32b9dfde9e7aa9e9156483e1545096d","pkg-src-sha256":"1ba2f2a6b8d85da76c41f526c98903cbb107f8642e506c072c1e7e3c20fe5e7a","depends":["base-4.17.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-jquery-3.3.1-404ee1f1c3234eabb7d34c9352c145a1ebfab26873526372794e56f688d8a956","pkg-name":"js-jquery","pkg-version":"3.3.1","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"59ab6c79159549ef94b584abce8e6d3b336014c2cce1337b59a8f637e2856df5","pkg-src-sha256":"e0e0681f0da1130ede4e03a051630ea439c458cb97216cdb01771ebdbe44069b","depends":["base-4.17.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"mtl-2.2.2","pkg-name":"mtl","pkg-version":"2.2.2","depends":["base-4.17.2.0","transformers-0.5.6.2"]},{"type":"pre-existing","id":"parsec-3.1.16.1","pkg-name":"parsec","pkg-version":"3.1.16.1","depends":["base-4.17.2.0","bytestring-0.11.5.1","mtl-2.2.2","text-2.0.2"]},{"type":"pre-existing","id":"pretty-1.1.3.6","pkg-name":"pretty","pkg-version":"1.1.3.6","depends":["base-4.17.2.0","deepseq-1.4.8.0","ghc-prim-0.9.1"]},{"type":"configured","id":"primitive-0.7.4.0-d672cef39004acba6d939788edfd616926e6632d4f05fe03b611aa6f07c73e1a","pkg-name":"primitive","pkg-version":"0.7.4.0","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"89b88a3e08493b7727fa4089b0692bfbdf7e1e666ef54635f458644eb8358764","pkg-src-sha256":"5b2d6dc2812eb2f6a115f05fcbe3e723d3aeff7894b012c617e075130581add5","depends":["base-4.17.2.0","deepseq-1.4.8.0","template-haskell-2.19.0.0","transformers-0.5.6.2"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"process-1.6.17.0","pkg-name":"process","pkg-version":"1.6.17.0","depends":["base-4.17.2.0","deepseq-1.4.8.0","directory-1.3.7.1","filepath-1.4.2.2","unix-2.7.3"]},{"type":"configured","id":"random-1.2.1.1-a52954d69fa9f2fd13ab19e06b3b99ff78488848fa8d4988c9b8d38740fb8d29","pkg-name":"random","pkg-version":"1.2.1.1","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"dea1f11e5569332dc6c8efaad1cb301016a5587b6754943a49f9de08ae0e56d9","pkg-src-sha256":"3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76","depends":["base-4.17.2.0","bytestring-0.11.5.1","deepseq-1.4.8.0","mtl-2.2.2","splitmix-0.1.0.4-fe9eba9a212fda01fa4960e960a860fd1c5c0836d8823d2eb47b151f673e827e"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"rts","pkg-name":"rts","pkg-version":"1.0.2","depends":[]},{"type":"configured","id":"shake-0.19.7-0a34884117d1c1ae051fb71ab291372738b4fe99639c85970f08dbdf7c0632db","pkg-name":"shake","pkg-version":"0.19.7","flags":{"cloud":false,"embed-files":false,"portable":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4a0bf8b7d3b44448a0c0c506374b7388f65e88b17c10400def1ba06e37b2dc00","pkg-src-sha256":"352a56af12f70b50d564dcb61131555577281957ee196f1702a3723c0a3699d1","depends":["base-4.17.2.0","binary-0.8.9.1","bytestring-0.11.5.1","deepseq-1.4.8.0","directory-1.3.7.1","extra-1.7.12-434bced0705a8981779e15a29962e546ac808b163b411b4b97589d29d8209466","filepath-1.4.2.2","filepattern-0.1.3-b0b2315f3b9e7024c1aef0c603bc22a352750bc46cb50781e647cb3f865621c6","hashable-1.4.1.0-a0435926dbbb79c9ca4322861d7386e81a6230fba4e7384807758367ad172ba9","heaps-0.4-25b9e449dabfa5641f220ccd75254da5b3c5c5e97cead3596c6b069742284d0d","js-dgtable-0.5.2-2e674cc0727cb8f70a42e221d7ac7db71e7f5b10716b0fad22ffbac3128bb2fb","js-flot-0.8.3-c96bff4f7307d099e369eb05541151317871057b30c3d7805785bdcb6b08b13e","js-jquery-3.3.1-404ee1f1c3234eabb7d34c9352c145a1ebfab26873526372794e56f688d8a956","primitive-0.7.4.0-d672cef39004acba6d939788edfd616926e6632d4f05fe03b611aa6f07c73e1a","process-1.6.17.0","random-1.2.1.1-a52954d69fa9f2fd13ab19e06b3b99ff78488848fa8d4988c9b8d38740fb8d29","time-1.12.2","transformers-0.5.6.2","unix-2.7.3","unordered-containers-0.2.19.1-f82114f26b96029e9d31fbbac2eff9f87a29ae7b932dd6a6c104ee5985698fa2","utf8-string-1.0.2-70fa2c4f1361b1537db5ccdb8d6c11537d9c4b58c4f843409f50e45d0094a8ab"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"shake-0.19.7-e-shake-6a4c9d6afdee34a1d0751c17d079474c57c951c27c42bab6aeba79bf9f224277","pkg-name":"shake","pkg-version":"0.19.7","flags":{"cloud":false,"embed-files":false,"portable":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4a0bf8b7d3b44448a0c0c506374b7388f65e88b17c10400def1ba06e37b2dc00","pkg-src-sha256":"352a56af12f70b50d564dcb61131555577281957ee196f1702a3723c0a3699d1","depends":["base-4.17.2.0","binary-0.8.9.1","bytestring-0.11.5.1","deepseq-1.4.8.0","directory-1.3.7.1","extra-1.7.12-434bced0705a8981779e15a29962e546ac808b163b411b4b97589d29d8209466","filepath-1.4.2.2","filepattern-0.1.3-b0b2315f3b9e7024c1aef0c603bc22a352750bc46cb50781e647cb3f865621c6","hashable-1.4.1.0-a0435926dbbb79c9ca4322861d7386e81a6230fba4e7384807758367ad172ba9","heaps-0.4-25b9e449dabfa5641f220ccd75254da5b3c5c5e97cead3596c6b069742284d0d","js-dgtable-0.5.2-2e674cc0727cb8f70a42e221d7ac7db71e7f5b10716b0fad22ffbac3128bb2fb","js-flot-0.8.3-c96bff4f7307d099e369eb05541151317871057b30c3d7805785bdcb6b08b13e","js-jquery-3.3.1-404ee1f1c3234eabb7d34c9352c145a1ebfab26873526372794e56f688d8a956","primitive-0.7.4.0-d672cef39004acba6d939788edfd616926e6632d4f05fe03b611aa6f07c73e1a","process-1.6.17.0","random-1.2.1.1-a52954d69fa9f2fd13ab19e06b3b99ff78488848fa8d4988c9b8d38740fb8d29","time-1.12.2","transformers-0.5.6.2","unix-2.7.3","unordered-containers-0.2.19.1-f82114f26b96029e9d31fbbac2eff9f87a29ae7b932dd6a6c104ee5985698fa2","utf8-string-1.0.2-70fa2c4f1361b1537db5ccdb8d6c11537d9c4b58c4f843409f50e45d0094a8ab"],"exe-depends":[],"component-name":"exe:shake","bin-file":"/home/iliastsi/.cabal/store/ghc-9.4.6/shake-0.19.7-e-shake-6a4c9d6afdee34a1d0751c17d079474c57c951c27c42bab6aeba79bf9f224277/bin/shake"},{"type":"configured","id":"splitmix-0.1.0.4-fe9eba9a212fda01fa4960e960a860fd1c5c0836d8823d2eb47b151f673e827e","pkg-name":"splitmix","pkg-version":"0.1.0.4","flags":{"optimised-mixer":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"804e2574bc7e32d08cbab91e47ee6287b4df7d50851d73f9e778f94a9a7814c7","pkg-src-sha256":"6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa","depends":["base-4.17.2.0","deepseq-1.4.8.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"template-haskell-2.19.0.0","pkg-name":"template-haskell","pkg-version":"2.19.0.0","depends":["base-4.17.2.0","ghc-boot-th-9.4.6","ghc-prim-0.9.1","pretty-1.1.3.6"]},{"type":"pre-existing","id":"text-2.0.2","pkg-name":"text","pkg-version":"2.0.2","depends":["array-0.5.4.0","base-4.17.2.0","binary-0.8.9.1","bytestring-0.11.5.1","deepseq-1.4.8.0","ghc-prim-0.9.1","template-haskell-2.19.0.0"]},{"type":"pre-existing","id":"time-1.12.2","pkg-name":"time","pkg-version":"1.12.2","depends":["base-4.17.2.0","deepseq-1.4.8.0"]},{"type":"pre-existing","id":"transformers-0.5.6.2","pkg-name":"transformers","pkg-version":"0.5.6.2","depends":["base-4.17.2.0"]},{"type":"pre-existing","id":"unix-2.7.3","pkg-name":"unix","pkg-version":"2.7.3","depends":["base-4.17.2.0","bytestring-0.11.5.1","time-1.12.2"]},{"type":"configured","id":"unordered-containers-0.2.19.1-f82114f26b96029e9d31fbbac2eff9f87a29ae7b932dd6a6c104ee5985698fa2","pkg-name":"unordered-containers","pkg-version":"0.2.19.1","flags":{"debug":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"db11042bb0356c0adea277d0794743829125b4c99455af6af2bd5f7bd5e88a39","pkg-src-sha256":"1b27bec5e0d522b27a6029ebf4c4a6d40acbc083c787008e32fb55c4b1d128d2","depends":["base-4.17.2.0","deepseq-1.4.8.0","hashable-1.4.1.0-a0435926dbbb79c9ca4322861d7386e81a6230fba4e7384807758367ad172ba9","template-haskell-2.19.0.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"utf8-string-1.0.2-70fa2c4f1361b1537db5ccdb8d6c11537d9c4b58c4f843409f50e45d0094a8ab","pkg-name":"utf8-string","pkg-version":"1.0.2","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"79416292186feeaf1f60e49ac5a1ffae9bf1b120e040a74bf0e81ca7f1d31d3f","pkg-src-sha256":"ee48deada7600370728c4156cb002441de770d0121ae33a68139a9ed9c19b09a","depends":["base-4.17.2.0","bytestring-0.11.5.1"],"exe-depends":[],"component-name":"lib"}]}
+\ No newline at end of file
+Index: b/hadrian/bootstrap/plan-bootstrap-9_4_6.json
+===================================================================
+--- /dev/null
++++ b/hadrian/bootstrap/plan-bootstrap-9_4_6.json
+@@ -0,0 +1 @@
++{"builtin":[{"package":"rts","version":"1.0.2"},{"package":"ghc-prim","version":"0.9.1"},{"package":"ghc-bignum","version":"1.3"},{"package":"base","version":"4.17.2.0"},{"package":"array","version":"0.5.4.0"},{"package":"deepseq","version":"1.4.8.0"},{"package":"ghc-boot-th","version":"9.4.6"},{"package":"pretty","version":"1.1.3.6"},{"package":"template-haskell","version":"2.19.0.0"},{"package":"bytestring","version":"0.11.5.1"},{"package":"containers","version":"0.6.7"},{"package":"binary","version":"0.8.9.1"},{"package":"filepath","version":"1.4.2.2"},{"package":"time","version":"1.12.2"},{"package":"unix","version":"2.7.3"},{"package":"directory","version":"1.3.7.1"},{"package":"transformers","version":"0.5.6.2"},{"package":"mtl","version":"2.2.2"},{"package":"text","version":"2.0.2"},{"package":"parsec","version":"3.1.16.1"},{"package":"process","version":"1.6.17.0"}],"dependencies":[{"cabal_sha256":"ff97c442b0c679c1c9876acd15f73ac4f602b973c45bde42b43ec28265ee48f4","flags":["-bundled-binary-generic"],"package":"Cabal","revision":0,"source":"hackage","src_sha256":"2fa1fe88d4a8e8ffbeb45baed5526b1267a2130026c846251ac95c656364ab77","version":"3.6.3.0"},{"cabal_sha256":"db25c2e17967aa6b6046ab8b1b96ba3f344ca59a62b60fb6113d51ea305a3d8e","flags":["-optimised-mixer"],"package":"splitmix","revision":2,"source":"hackage","src_sha256":"6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa","version":"0.1.0.4"},{"cabal_sha256":"dea1f11e5569332dc6c8efaad1cb301016a5587b6754943a49f9de08ae0e56d9","flags":[],"package":"random","revision":0,"source":"hackage","src_sha256":"3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76","version":"1.2.1.1"},{"cabal_sha256":"4ce29211223d5e6620ebceba34a3ca9ccf1c10c0cf387d48aea45599222ee5aa","flags":["-old-random","+templatehaskell"],"package":"QuickCheck","revision":0,"source":"hackage","src_sha256":"d87b6c85696b601175274361fa62217894401e401e150c3c5d4013ac53cd36f3","version":"2.14.2"},{"cabal_sha256":"a692159828c2cd278eaec317b3a7e9fb6d7b787c8a19f086004d15d9fa1fd72c","flags":["-llvm"],"package":"clock","revision":0,"source":"hackage","src_sha256":"845ce5db4c98cefd517323e005f87effceff886987305e421c4ef616dc0505d1","version":"0.8.3"},{"cabal_sha256":"3ac58d7341976173d1052e7b2837d119212d9afcf911735667c7f1ab67aec25f","flags":[],"package":"extra","revision":0,"source":"hackage","src_sha256":"e571a9ec1d8865f0fbb0e0ba1eb575f783b0365c80db19b54a93600bae43b03c","version":"1.7.12"},{"cabal_sha256":"372c1733d83b90045eb29da9f010fed79bfef8771ce65eb126a1d83ecc54a9a2","flags":[],"package":"filepattern","revision":0,"source":"hackage","src_sha256":"cc445d439ea2f65cac7604d3578aa2c3a62e5a91dc989f4ce5b3390db9e59636","version":"0.1.3"},{"cabal_sha256":"50b2f002c68fe67730ee7a3cd8607486197dd99b084255005ad51ecd6970a41b","flags":["+containers","+integer-gmp","-random-initial-seed"],"package":"hashable","revision":0,"source":"hackage","src_sha256":"e1b305c280e66ad827edeaedd6933b9fc4174f626882877eab2a08344e665e87","version":"1.4.1.0"},{"cabal_sha256":"66b19fcd813b0e4db3e0bac541bd46606c3b13d3d081d9f9666f4be0f5ff14b8","flags":[],"package":"heaps","revision":0,"source":"hackage","src_sha256":"89329df8b95ae99ef272e41e7a2d0fe2f1bb7eacfcc34bc01664414b33067cfd","version":"0.4"},{"cabal_sha256":"f75cb4fa53c88c65794becdd48eb0d3b2b8abd89a3d5c19e87af91f5225c15e4","flags":[],"package":"js-dgtable","revision":0,"source":"hackage","src_sha256":"e28dd65bee8083b17210134e22e01c6349dc33c3b7bd17705973cd014e9f20ac","version":"0.5.2"},{"cabal_sha256":"4c1c447a9a2fba0adba6d30678302a30c32b9dfde9e7aa9e9156483e1545096d","flags":[],"package":"js-flot","revision":0,"source":"hackage","src_sha256":"1ba2f2a6b8d85da76c41f526c98903cbb107f8642e506c072c1e7e3c20fe5e7a","version":"0.8.3"},{"cabal_sha256":"59ab6c79159549ef94b584abce8e6d3b336014c2cce1337b59a8f637e2856df5","flags":[],"package":"js-jquery","revision":0,"source":"hackage","src_sha256":"e0e0681f0da1130ede4e03a051630ea439c458cb97216cdb01771ebdbe44069b","version":"3.3.1"},{"cabal_sha256":"c2f0ed97b3dce97f2f43b239c3be8b136e4368f1eb7b61322ee9ac98f604622b","flags":[],"package":"primitive","revision":1,"source":"hackage","src_sha256":"5b2d6dc2812eb2f6a115f05fcbe3e723d3aeff7894b012c617e075130581add5","version":"0.7.4.0"},{"cabal_sha256":"9ad8972c2e913c37b1d4f0e1261517fd7a1b8c8a58077e057be69837e3dbaa00","flags":["-debug"],"package":"unordered-containers","revision":2,"source":"hackage","src_sha256":"1b27bec5e0d522b27a6029ebf4c4a6d40acbc083c787008e32fb55c4b1d128d2","version":"0.2.19.1"},{"cabal_sha256":"79416292186feeaf1f60e49ac5a1ffae9bf1b120e040a74bf0e81ca7f1d31d3f","flags":[],"package":"utf8-string","revision":0,"source":"hackage","src_sha256":"ee48deada7600370728c4156cb002441de770d0121ae33a68139a9ed9c19b09a","version":"1.0.2"},{"cabal_sha256":"3cb5814cce210b9756fa9246ff1b2a1e1b86be46fdc4c5e2baacdc5bf83ce5c3","flags":["-cloud","-embed-files","-portable"],"package":"shake","revision":1,"source":"hackage","src_sha256":"352a56af12f70b50d564dcb61131555577281957ee196f1702a3723c0a3699d1","version":"0.19.7"},{"cabal_sha256":null,"flags":["+selftest","+threaded"],"package":"hadrian","revision":null,"source":"local","src_sha256":null,"version":"0.1.0.0"}]}
+\ No newline at end of file
+Index: b/hadrian/bootstrap/plan-9_4_7.json
+===================================================================
+--- /dev/null
++++ b/hadrian/bootstrap/plan-9_4_7.json
+@@ -0,0 +1 @@
++{"cabal-version":"3.4.1.0","cabal-lib-version":"3.4.1.0","compiler-id":"ghc-9.4.7","os":"linux","arch":"x86_64","install-plan":[{"type":"pre-existing","id":"Cabal-3.8.1.0","pkg-name":"Cabal","pkg-version":"3.8.1.0","depends":["Cabal-syntax-3.8.1.0","array-0.5.4.0","base-4.17.2.0","bytestring-0.11.5.2","containers-0.6.7","deepseq-1.4.8.0","directory-1.3.7.1","filepath-1.4.2.2","mtl-2.2.2","parsec-3.1.16.1","pretty-1.1.3.6","process-1.6.17.0","text-2.0.2","time-1.12.2","transformers-0.5.6.2","unix-2.7.3"]},{"type":"pre-existing","id":"Cabal-syntax-3.8.1.0","pkg-name":"Cabal-syntax","pkg-version":"3.8.1.0","depends":["array-0.5.4.0","base-4.17.2.0","binary-0.8.9.1","bytestring-0.11.5.2","containers-0.6.7","deepseq-1.4.8.0","directory-1.3.7.1","filepath-1.4.2.2","mtl-2.2.2","parsec-3.1.16.1","pretty-1.1.3.6","text-2.0.2","time-1.12.2","transformers-0.5.6.2","unix-2.7.3"]},{"type":"configured","id":"QuickCheck-2.14.2-2c61a471e54e8db3e854373ee6ce25d6617b5d3aea54773093a75ea5673a6a3d","pkg-name":"QuickCheck","pkg-version":"2.14.2","flags":{"old-random":false,"templatehaskell":true},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4ce29211223d5e6620ebceba34a3ca9ccf1c10c0cf387d48aea45599222ee5aa","pkg-src-sha256":"d87b6c85696b601175274361fa62217894401e401e150c3c5d4013ac53cd36f3","depends":["base-4.17.2.0","containers-0.6.7","deepseq-1.4.8.0","random-1.2.1.1-133900be89374336b8ef3d0d416d09cc1f8d0db494e6d253066d8b628ffa2c90","splitmix-0.1.0.4-c9bdc990d84f70c85edf41640dfcb7a846636c0902cf0042545d76a4b66ef88d","template-haskell-2.19.0.0","transformers-0.5.6.2"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"array-0.5.4.0","pkg-name":"array","pkg-version":"0.5.4.0","depends":["base-4.17.2.0"]},{"type":"pre-existing","id":"base-4.17.2.0","pkg-name":"base","pkg-version":"4.17.2.0","depends":["ghc-bignum-1.3","ghc-prim-0.9.1","rts-1.0.2"]},{"type":"pre-existing","id":"binary-0.8.9.1","pkg-name":"binary","pkg-version":"0.8.9.1","depends":["array-0.5.4.0","base-4.17.2.0","bytestring-0.11.5.2","containers-0.6.7"]},{"type":"pre-existing","id":"bytestring-0.11.5.2","pkg-name":"bytestring","pkg-version":"0.11.5.2","depends":["base-4.17.2.0","deepseq-1.4.8.0","ghc-prim-0.9.1","template-haskell-2.19.0.0"]},{"type":"configured","id":"clock-0.8.3-60680da922574f4dcc2cb81381cef985fd703365e4dd6815dcdfb1c9ea0a5173","pkg-name":"clock","pkg-version":"0.8.3","flags":{"llvm":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"a692159828c2cd278eaec317b3a7e9fb6d7b787c8a19f086004d15d9fa1fd72c","pkg-src-sha256":"845ce5db4c98cefd517323e005f87effceff886987305e421c4ef616dc0505d1","depends":["base-4.17.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"containers-0.6.7","pkg-name":"containers","pkg-version":"0.6.7","depends":["array-0.5.4.0","base-4.17.2.0","deepseq-1.4.8.0","template-haskell-2.19.0.0"]},{"type":"pre-existing","id":"deepseq-1.4.8.0","pkg-name":"deepseq","pkg-version":"1.4.8.0","depends":["array-0.5.4.0","base-4.17.2.0","ghc-prim-0.9.1"]},{"type":"pre-existing","id":"directory-1.3.7.1","pkg-name":"directory","pkg-version":"1.3.7.1","depends":["base-4.17.2.0","filepath-1.4.2.2","time-1.12.2","unix-2.7.3"]},{"type":"configured","id":"extra-1.7.12-29a3609566f3846fb68ff3c4e447f6e5305dbdffb532dcd11a61ce8302bdb76d","pkg-name":"extra","pkg-version":"1.7.12","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"3ac58d7341976173d1052e7b2837d119212d9afcf911735667c7f1ab67aec25f","pkg-src-sha256":"e571a9ec1d8865f0fbb0e0ba1eb575f783b0365c80db19b54a93600bae43b03c","depends":["base-4.17.2.0","clock-0.8.3-60680da922574f4dcc2cb81381cef985fd703365e4dd6815dcdfb1c9ea0a5173","directory-1.3.7.1","filepath-1.4.2.2","process-1.6.17.0","time-1.12.2","unix-2.7.3"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"filepath-1.4.2.2","pkg-name":"filepath","pkg-version":"1.4.2.2","depends":["base-4.17.2.0"]},{"type":"configured","id":"filepattern-0.1.3-ec2af416cdbcc708bf283cc354256aa16116517da64efbc13da67e5cf8934991","pkg-name":"filepattern","pkg-version":"0.1.3","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"372c1733d83b90045eb29da9f010fed79bfef8771ce65eb126a1d83ecc54a9a2","pkg-src-sha256":"cc445d439ea2f65cac7604d3578aa2c3a62e5a91dc989f4ce5b3390db9e59636","depends":["base-4.17.2.0","directory-1.3.7.1","extra-1.7.12-29a3609566f3846fb68ff3c4e447f6e5305dbdffb532dcd11a61ce8302bdb76d","filepath-1.4.2.2"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"ghc-bignum-1.3","pkg-name":"ghc-bignum","pkg-version":"1.3","depends":["ghc-prim-0.9.1"]},{"type":"pre-existing","id":"ghc-boot-th-9.4.7","pkg-name":"ghc-boot-th","pkg-version":"9.4.7","depends":["base-4.17.2.0"]},{"type":"pre-existing","id":"ghc-prim-0.9.1","pkg-name":"ghc-prim","pkg-version":"0.9.1","depends":["rts-1.0.2"]},{"type":"configured","id":"hadrian-0.1.0.0-inplace-hadrian","pkg-name":"hadrian","pkg-version":"0.1.0.0","flags":{"selftest":true,"threaded":true},"style":"local","pkg-src":{"type":"local","path":"/build/ghc-9.4.7/hadrian/."},"dist-dir":"/build/ghc-9.4.7/hadrian/dist-newstyle/build/x86_64-linux/ghc-9.4.7/hadrian-0.1.0.0/x/hadrian","depends":["Cabal-3.8.1.0","QuickCheck-2.14.2-2c61a471e54e8db3e854373ee6ce25d6617b5d3aea54773093a75ea5673a6a3d","base-4.17.2.0","bytestring-0.11.5.2","containers-0.6.7","directory-1.3.7.1","extra-1.7.12-29a3609566f3846fb68ff3c4e447f6e5305dbdffb532dcd11a61ce8302bdb76d","filepath-1.4.2.2","mtl-2.2.2","parsec-3.1.16.1","shake-0.19.7-606795c3537efa6a043c6eab8fc06ef2a0f357406a3d612ae27318bf2ad51f3b","text-2.0.2","transformers-0.5.6.2","unordered-containers-0.2.19.1-6cd6b29e7b2b508810255877ba7ad5157aa89b8c4afaa42c0d48f65dcc6c622c"],"exe-depends":[],"component-name":"exe:hadrian","bin-file":"/build/ghc-9.4.7/hadrian/dist-newstyle/build/x86_64-linux/ghc-9.4.7/hadrian-0.1.0.0/x/hadrian/build/hadrian/hadrian"},{"type":"configured","id":"hashable-1.4.1.0-e1a0a62b24990d9b67068e289933c09acf3bab75fa165ef2a2e7fd1c68b53368","pkg-name":"hashable","pkg-version":"1.4.1.0","flags":{"containers":true,"integer-gmp":true,"random-initial-seed":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"50b2f002c68fe67730ee7a3cd8607486197dd99b084255005ad51ecd6970a41b","pkg-src-sha256":"e1b305c280e66ad827edeaedd6933b9fc4174f626882877eab2a08344e665e87","depends":["base-4.17.2.0","bytestring-0.11.5.2","containers-0.6.7","deepseq-1.4.8.0","ghc-bignum-1.3","ghc-prim-0.9.1","text-2.0.2"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"heaps-0.4-9a77df4e3db3d50a3637137af4f3f2c10095c04ac23988b3e9c72116053f5c6b","pkg-name":"heaps","pkg-version":"0.4","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"66b19fcd813b0e4db3e0bac541bd46606c3b13d3d081d9f9666f4be0f5ff14b8","pkg-src-sha256":"89329df8b95ae99ef272e41e7a2d0fe2f1bb7eacfcc34bc01664414b33067cfd","depends":["base-4.17.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-dgtable-0.5.2-094ee8872eb10913dc0a4350523def131afcebe1cf1a50cc5c29f687abc622c9","pkg-name":"js-dgtable","pkg-version":"0.5.2","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"f75cb4fa53c88c65794becdd48eb0d3b2b8abd89a3d5c19e87af91f5225c15e4","pkg-src-sha256":"e28dd65bee8083b17210134e22e01c6349dc33c3b7bd17705973cd014e9f20ac","depends":["base-4.17.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-flot-0.8.3-fbfb60e628ed902edbd1d03606b546b320963590fbaf653dbe7b3df0086c4c2c","pkg-name":"js-flot","pkg-version":"0.8.3","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4c1c447a9a2fba0adba6d30678302a30c32b9dfde9e7aa9e9156483e1545096d","pkg-src-sha256":"1ba2f2a6b8d85da76c41f526c98903cbb107f8642e506c072c1e7e3c20fe5e7a","depends":["base-4.17.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"js-jquery-3.3.1-0dd26cbd63adfa57d02a6ab830dac2a6776b4c32af37950f31f0810ef850e5ab","pkg-name":"js-jquery","pkg-version":"3.3.1","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"59ab6c79159549ef94b584abce8e6d3b336014c2cce1337b59a8f637e2856df5","pkg-src-sha256":"e0e0681f0da1130ede4e03a051630ea439c458cb97216cdb01771ebdbe44069b","depends":["base-4.17.2.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"mtl-2.2.2","pkg-name":"mtl","pkg-version":"2.2.2","depends":["base-4.17.2.0","transformers-0.5.6.2"]},{"type":"pre-existing","id":"parsec-3.1.16.1","pkg-name":"parsec","pkg-version":"3.1.16.1","depends":["base-4.17.2.0","bytestring-0.11.5.2","mtl-2.2.2","text-2.0.2"]},{"type":"pre-existing","id":"pretty-1.1.3.6","pkg-name":"pretty","pkg-version":"1.1.3.6","depends":["base-4.17.2.0","deepseq-1.4.8.0","ghc-prim-0.9.1"]},{"type":"configured","id":"primitive-0.7.4.0-1bfcae07bbe7a4c30cf0212d7cff521f3f15d455031c5e55a5f87a2712756619","pkg-name":"primitive","pkg-version":"0.7.4.0","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"89b88a3e08493b7727fa4089b0692bfbdf7e1e666ef54635f458644eb8358764","pkg-src-sha256":"5b2d6dc2812eb2f6a115f05fcbe3e723d3aeff7894b012c617e075130581add5","depends":["base-4.17.2.0","deepseq-1.4.8.0","template-haskell-2.19.0.0","transformers-0.5.6.2"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"process-1.6.17.0","pkg-name":"process","pkg-version":"1.6.17.0","depends":["base-4.17.2.0","deepseq-1.4.8.0","directory-1.3.7.1","filepath-1.4.2.2","unix-2.7.3"]},{"type":"configured","id":"random-1.2.1.1-133900be89374336b8ef3d0d416d09cc1f8d0db494e6d253066d8b628ffa2c90","pkg-name":"random","pkg-version":"1.2.1.1","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"dea1f11e5569332dc6c8efaad1cb301016a5587b6754943a49f9de08ae0e56d9","pkg-src-sha256":"3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76","depends":["base-4.17.2.0","bytestring-0.11.5.2","deepseq-1.4.8.0","mtl-2.2.2","splitmix-0.1.0.4-c9bdc990d84f70c85edf41640dfcb7a846636c0902cf0042545d76a4b66ef88d"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"rts-1.0.2","pkg-name":"rts","pkg-version":"1.0.2","depends":[]},{"type":"configured","id":"shake-0.19.7-606795c3537efa6a043c6eab8fc06ef2a0f357406a3d612ae27318bf2ad51f3b","pkg-name":"shake","pkg-version":"0.19.7","flags":{"cloud":false,"embed-files":false,"portable":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4a0bf8b7d3b44448a0c0c506374b7388f65e88b17c10400def1ba06e37b2dc00","pkg-src-sha256":"352a56af12f70b50d564dcb61131555577281957ee196f1702a3723c0a3699d1","depends":["base-4.17.2.0","binary-0.8.9.1","bytestring-0.11.5.2","deepseq-1.4.8.0","directory-1.3.7.1","extra-1.7.12-29a3609566f3846fb68ff3c4e447f6e5305dbdffb532dcd11a61ce8302bdb76d","filepath-1.4.2.2","filepattern-0.1.3-ec2af416cdbcc708bf283cc354256aa16116517da64efbc13da67e5cf8934991","hashable-1.4.1.0-e1a0a62b24990d9b67068e289933c09acf3bab75fa165ef2a2e7fd1c68b53368","heaps-0.4-9a77df4e3db3d50a3637137af4f3f2c10095c04ac23988b3e9c72116053f5c6b","js-dgtable-0.5.2-094ee8872eb10913dc0a4350523def131afcebe1cf1a50cc5c29f687abc622c9","js-flot-0.8.3-fbfb60e628ed902edbd1d03606b546b320963590fbaf653dbe7b3df0086c4c2c","js-jquery-3.3.1-0dd26cbd63adfa57d02a6ab830dac2a6776b4c32af37950f31f0810ef850e5ab","primitive-0.7.4.0-1bfcae07bbe7a4c30cf0212d7cff521f3f15d455031c5e55a5f87a2712756619","process-1.6.17.0","random-1.2.1.1-133900be89374336b8ef3d0d416d09cc1f8d0db494e6d253066d8b628ffa2c90","time-1.12.2","transformers-0.5.6.2","unix-2.7.3","unordered-containers-0.2.19.1-6cd6b29e7b2b508810255877ba7ad5157aa89b8c4afaa42c0d48f65dcc6c622c","utf8-string-1.0.2-345983e5c7a6c6cf03fc29fd6e582ef4fae34f87a1835d6facaefcb954a9cb22"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"shake-0.19.7-e-shake-37919e6f6dea6a5cad2e8153414902e084fc9388aa18562ca1c7dc395c35fbff","pkg-name":"shake","pkg-version":"0.19.7","flags":{"cloud":false,"embed-files":false,"portable":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"4a0bf8b7d3b44448a0c0c506374b7388f65e88b17c10400def1ba06e37b2dc00","pkg-src-sha256":"352a56af12f70b50d564dcb61131555577281957ee196f1702a3723c0a3699d1","depends":["base-4.17.2.0","binary-0.8.9.1","bytestring-0.11.5.2","deepseq-1.4.8.0","directory-1.3.7.1","extra-1.7.12-29a3609566f3846fb68ff3c4e447f6e5305dbdffb532dcd11a61ce8302bdb76d","filepath-1.4.2.2","filepattern-0.1.3-ec2af416cdbcc708bf283cc354256aa16116517da64efbc13da67e5cf8934991","hashable-1.4.1.0-e1a0a62b24990d9b67068e289933c09acf3bab75fa165ef2a2e7fd1c68b53368","heaps-0.4-9a77df4e3db3d50a3637137af4f3f2c10095c04ac23988b3e9c72116053f5c6b","js-dgtable-0.5.2-094ee8872eb10913dc0a4350523def131afcebe1cf1a50cc5c29f687abc622c9","js-flot-0.8.3-fbfb60e628ed902edbd1d03606b546b320963590fbaf653dbe7b3df0086c4c2c","js-jquery-3.3.1-0dd26cbd63adfa57d02a6ab830dac2a6776b4c32af37950f31f0810ef850e5ab","primitive-0.7.4.0-1bfcae07bbe7a4c30cf0212d7cff521f3f15d455031c5e55a5f87a2712756619","process-1.6.17.0","random-1.2.1.1-133900be89374336b8ef3d0d416d09cc1f8d0db494e6d253066d8b628ffa2c90","time-1.12.2","transformers-0.5.6.2","unix-2.7.3","unordered-containers-0.2.19.1-6cd6b29e7b2b508810255877ba7ad5157aa89b8c4afaa42c0d48f65dcc6c622c","utf8-string-1.0.2-345983e5c7a6c6cf03fc29fd6e582ef4fae34f87a1835d6facaefcb954a9cb22"],"exe-depends":[],"component-name":"exe:shake","bin-file":"/home/iliastsi/.cabal/store/ghc-9.4.7/shake-0.19.7-e-shake-37919e6f6dea6a5cad2e8153414902e084fc9388aa18562ca1c7dc395c35fbff/bin/shake"},{"type":"configured","id":"splitmix-0.1.0.4-c9bdc990d84f70c85edf41640dfcb7a846636c0902cf0042545d76a4b66ef88d","pkg-name":"splitmix","pkg-version":"0.1.0.4","flags":{"optimised-mixer":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"804e2574bc7e32d08cbab91e47ee6287b4df7d50851d73f9e778f94a9a7814c7","pkg-src-sha256":"6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa","depends":["base-4.17.2.0","deepseq-1.4.8.0"],"exe-depends":[],"component-name":"lib"},{"type":"pre-existing","id":"template-haskell-2.19.0.0","pkg-name":"template-haskell","pkg-version":"2.19.0.0","depends":["base-4.17.2.0","ghc-boot-th-9.4.7","ghc-prim-0.9.1","pretty-1.1.3.6"]},{"type":"pre-existing","id":"text-2.0.2","pkg-name":"text","pkg-version":"2.0.2","depends":["array-0.5.4.0","base-4.17.2.0","binary-0.8.9.1","bytestring-0.11.5.2","deepseq-1.4.8.0","ghc-prim-0.9.1","template-haskell-2.19.0.0"]},{"type":"pre-existing","id":"time-1.12.2","pkg-name":"time","pkg-version":"1.12.2","depends":["base-4.17.2.0","deepseq-1.4.8.0"]},{"type":"pre-existing","id":"transformers-0.5.6.2","pkg-name":"transformers","pkg-version":"0.5.6.2","depends":["base-4.17.2.0"]},{"type":"pre-existing","id":"unix-2.7.3","pkg-name":"unix","pkg-version":"2.7.3","depends":["base-4.17.2.0","bytestring-0.11.5.2","time-1.12.2"]},{"type":"configured","id":"unordered-containers-0.2.19.1-6cd6b29e7b2b508810255877ba7ad5157aa89b8c4afaa42c0d48f65dcc6c622c","pkg-name":"unordered-containers","pkg-version":"0.2.19.1","flags":{"debug":false},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"db11042bb0356c0adea277d0794743829125b4c99455af6af2bd5f7bd5e88a39","pkg-src-sha256":"1b27bec5e0d522b27a6029ebf4c4a6d40acbc083c787008e32fb55c4b1d128d2","depends":["base-4.17.2.0","deepseq-1.4.8.0","hashable-1.4.1.0-e1a0a62b24990d9b67068e289933c09acf3bab75fa165ef2a2e7fd1c68b53368","template-haskell-2.19.0.0"],"exe-depends":[],"component-name":"lib"},{"type":"configured","id":"utf8-string-1.0.2-345983e5c7a6c6cf03fc29fd6e582ef4fae34f87a1835d6facaefcb954a9cb22","pkg-name":"utf8-string","pkg-version":"1.0.2","flags":{},"style":"global","pkg-src":{"type":"repo-tar","repo":{"type":"secure-repo","uri":"http://hackage.haskell.org/"}},"pkg-cabal-sha256":"79416292186feeaf1f60e49ac5a1ffae9bf1b120e040a74bf0e81ca7f1d31d3f","pkg-src-sha256":"ee48deada7600370728c4156cb002441de770d0121ae33a68139a9ed9c19b09a","depends":["base-4.17.2.0","bytestring-0.11.5.2"],"exe-depends":[],"component-name":"lib"}]}
+\ No newline at end of file
+Index: b/hadrian/bootstrap/plan-bootstrap-9_4_7.json
+===================================================================
+--- /dev/null
++++ b/hadrian/bootstrap/plan-bootstrap-9_4_7.json
+@@ -0,0 +1 @@
++{"builtin":[{"package":"rts","version":"1.0.2"},{"package":"ghc-prim","version":"0.9.1"},{"package":"ghc-bignum","version":"1.3"},{"package":"base","version":"4.17.2.0"},{"package":"array","version":"0.5.4.0"},{"package":"deepseq","version":"1.4.8.0"},{"package":"ghc-boot-th","version":"9.4.7"},{"package":"pretty","version":"1.1.3.6"},{"package":"template-haskell","version":"2.19.0.0"},{"package":"bytestring","version":"0.11.5.2"},{"package":"containers","version":"0.6.7"},{"package":"binary","version":"0.8.9.1"},{"package":"filepath","version":"1.4.2.2"},{"package":"time","version":"1.12.2"},{"package":"unix","version":"2.7.3"},{"package":"directory","version":"1.3.7.1"},{"package":"transformers","version":"0.5.6.2"},{"package":"mtl","version":"2.2.2"},{"package":"text","version":"2.0.2"},{"package":"parsec","version":"3.1.16.1"},{"package":"Cabal-syntax","version":"3.8.1.0"},{"package":"process","version":"1.6.17.0"},{"package":"Cabal","version":"3.8.1.0"}],"dependencies":[{"cabal_sha256":"db25c2e17967aa6b6046ab8b1b96ba3f344ca59a62b60fb6113d51ea305a3d8e","flags":["-optimised-mixer"],"package":"splitmix","revision":2,"source":"hackage","src_sha256":"6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa","version":"0.1.0.4"},{"cabal_sha256":"dea1f11e5569332dc6c8efaad1cb301016a5587b6754943a49f9de08ae0e56d9","flags":[],"package":"random","revision":0,"source":"hackage","src_sha256":"3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76","version":"1.2.1.1"},{"cabal_sha256":"4ce29211223d5e6620ebceba34a3ca9ccf1c10c0cf387d48aea45599222ee5aa","flags":["-old-random","+templatehaskell"],"package":"QuickCheck","revision":0,"source":"hackage","src_sha256":"d87b6c85696b601175274361fa62217894401e401e150c3c5d4013ac53cd36f3","version":"2.14.2"},{"cabal_sha256":"a692159828c2cd278eaec317b3a7e9fb6d7b787c8a19f086004d15d9fa1fd72c","flags":["-llvm"],"package":"clock","revision":0,"source":"hackage","src_sha256":"845ce5db4c98cefd517323e005f87effceff886987305e421c4ef616dc0505d1","version":"0.8.3"},{"cabal_sha256":"3ac58d7341976173d1052e7b2837d119212d9afcf911735667c7f1ab67aec25f","flags":[],"package":"extra","revision":0,"source":"hackage","src_sha256":"e571a9ec1d8865f0fbb0e0ba1eb575f783b0365c80db19b54a93600bae43b03c","version":"1.7.12"},{"cabal_sha256":"372c1733d83b90045eb29da9f010fed79bfef8771ce65eb126a1d83ecc54a9a2","flags":[],"package":"filepattern","revision":0,"source":"hackage","src_sha256":"cc445d439ea2f65cac7604d3578aa2c3a62e5a91dc989f4ce5b3390db9e59636","version":"0.1.3"},{"cabal_sha256":"50b2f002c68fe67730ee7a3cd8607486197dd99b084255005ad51ecd6970a41b","flags":["+containers","+integer-gmp","-random-initial-seed"],"package":"hashable","revision":0,"source":"hackage","src_sha256":"e1b305c280e66ad827edeaedd6933b9fc4174f626882877eab2a08344e665e87","version":"1.4.1.0"},{"cabal_sha256":"66b19fcd813b0e4db3e0bac541bd46606c3b13d3d081d9f9666f4be0f5ff14b8","flags":[],"package":"heaps","revision":0,"source":"hackage","src_sha256":"89329df8b95ae99ef272e41e7a2d0fe2f1bb7eacfcc34bc01664414b33067cfd","version":"0.4"},{"cabal_sha256":"f75cb4fa53c88c65794becdd48eb0d3b2b8abd89a3d5c19e87af91f5225c15e4","flags":[],"package":"js-dgtable","revision":0,"source":"hackage","src_sha256":"e28dd65bee8083b17210134e22e01c6349dc33c3b7bd17705973cd014e9f20ac","version":"0.5.2"},{"cabal_sha256":"4c1c447a9a2fba0adba6d30678302a30c32b9dfde9e7aa9e9156483e1545096d","flags":[],"package":"js-flot","revision":0,"source":"hackage","src_sha256":"1ba2f2a6b8d85da76c41f526c98903cbb107f8642e506c072c1e7e3c20fe5e7a","version":"0.8.3"},{"cabal_sha256":"59ab6c79159549ef94b584abce8e6d3b336014c2cce1337b59a8f637e2856df5","flags":[],"package":"js-jquery","revision":0,"source":"hackage","src_sha256":"e0e0681f0da1130ede4e03a051630ea439c458cb97216cdb01771ebdbe44069b","version":"3.3.1"},{"cabal_sha256":"c2f0ed97b3dce97f2f43b239c3be8b136e4368f1eb7b61322ee9ac98f604622b","flags":[],"package":"primitive","revision":1,"source":"hackage","src_sha256":"5b2d6dc2812eb2f6a115f05fcbe3e723d3aeff7894b012c617e075130581add5","version":"0.7.4.0"},{"cabal_sha256":"9ad8972c2e913c37b1d4f0e1261517fd7a1b8c8a58077e057be69837e3dbaa00","flags":["-debug"],"package":"unordered-containers","revision":2,"source":"hackage","src_sha256":"1b27bec5e0d522b27a6029ebf4c4a6d40acbc083c787008e32fb55c4b1d128d2","version":"0.2.19.1"},{"cabal_sha256":"79416292186feeaf1f60e49ac5a1ffae9bf1b120e040a74bf0e81ca7f1d31d3f","flags":[],"package":"utf8-string","revision":0,"source":"hackage","src_sha256":"ee48deada7600370728c4156cb002441de770d0121ae33a68139a9ed9c19b09a","version":"1.0.2"},{"cabal_sha256":"3cb5814cce210b9756fa9246ff1b2a1e1b86be46fdc4c5e2baacdc5bf83ce5c3","flags":["-cloud","-embed-files","-portable"],"package":"shake","revision":1,"source":"hackage","src_sha256":"352a56af12f70b50d564dcb61131555577281957ee196f1702a3723c0a3699d1","version":"0.19.7"},{"cabal_sha256":null,"flags":["+selftest","+threaded"],"package":"hadrian","revision":null,"source":"local","src_sha256":null,"version":"0.1.0.0"}]}
+\ No newline at end of file


=====================================
p/ghc/debian/patches/hadrian-relpath
=====================================
@@ -0,0 +1,22 @@
+Description: Use realpath instead of custom script
+ Use realpath instead of the custom script, which is broken. As an example,
+ .
+   $ ./mk/relpath.sh /usr/lib/ghc/lib /usr/lib/ghc-doc
+   ..-doc
+   $ realpath --relative-to=/usr/lib/ghc/lib /usr/lib/ghc-doc
+   ../../ghc-doc
+Author: Ilias Tsitsimpis <iliastsi at debian.org>
+
+Index: b/hadrian/bindist/Makefile
+===================================================================
+--- a/hadrian/bindist/Makefile
++++ b/hadrian/bindist/Makefile
+@@ -229,7 +229,7 @@ update_package_db: install_bin install_l
+ 	$(INSTALL_DATA) mk/system-cxx-std-lib-1.0.conf "$(DESTDIR)$(ActualLibsDir)/package.conf.d"
+ 	@echo "Updating the package DB"
+ 	$(foreach p, $(PKG_CONFS),\
+-		$(call patchpackageconf,$(shell echo $(notdir $p) | sed 's/-\([0-9]*[0-9]\.\)*conf//g'),$(shell echo "$p" | sed 's:\0xxx\0:   :g'),$(docdir),$(shell mk/relpath.sh "$(ActualLibsDir)" "$(docdir)"),$(shell echo $(notdir $p) | sed 's/.conf//g')))
++		$(call patchpackageconf,$(shell echo $(notdir $p) | sed 's/-\([0-9]*[0-9]\.\)*conf//g'),$(shell echo "$p" | sed 's:\0xxx\0:   :g'),$(docdir),$(shell realpath -z --relative-to="$(ActualLibsDir)" "$(docdir)"),$(shell echo $(notdir $p) | sed 's/.conf//g')))
+ 	'$(DESTDIR)$(ActualBinsDir)/$(CrossCompilePrefix)ghc-pkg' --global-package-db "$(DESTDIR)$(ActualLibsDir)/package.conf.d" recache
+ 
+ install_mingw:


=====================================
p/ghc/debian/patches/separate-docs deleted
=====================================
@@ -1,61 +0,0 @@
-Index: b/ghc.mk
-===================================================================
---- a/ghc.mk
-+++ b/ghc.mk
-@@ -869,7 +869,7 @@ endif
- ifeq "$(HADDOCK_DOCS)" "YES"
- libraries/dist-haddock/index.html: $(haddock_INPLACE) $(ALL_HADDOCK_FILES)
- ifeq "$(phase)" "final"
--$(eval $(call all-target,library_doc_index,libraries/dist-haddock/index.html))
-+docs: libraries/dist-haddock/index.html
- endif
- INSTALL_LIBRARY_DOCS += libraries/dist-haddock/*
- endif
-@@ -919,9 +919,9 @@ libraries/ghc-prim/dist-install/build/au
- 
- install: install_libs install_packages install_libexecs \
-          install_bins install_libexec_scripts
--ifeq "$(HADDOCK_DOCS)" "YES"
--install: install_docs
--endif
-+# ifeq "$(HADDOCK_DOCS)" "YES"
-+# install: install_docs
-+# endif
- 
- define installLibsTo
- # $1 = libraries to install
-Index: b/rules/haddock.mk
-===================================================================
---- a/rules/haddock.mk
-+++ b/rules/haddock.mk
-@@ -34,7 +34,7 @@ endif
- haddock: html_$1
- 
- ifeq "$$(HADDOCK_DOCS)" "YES"
--$(call all-target,$1_$2_haddock,html_$1)
-+docs: html_$1
- endif
- 
- .PHONY: html_$1
-Index: b/rules/sphinx.mk
-===================================================================
---- a/rules/sphinx.mk
-+++ b/rules/sphinx.mk
-@@ -30,7 +30,7 @@ $(call all-target,$1,)
- .PHONY: html_$1
- ifeq "$$(phase)" "final"
- ifeq "$$(BUILD_SPHINX_HTML)" "YES"
--$(call all-target,$1,html_$1)
-+docs: html_$1
- INSTALL_HTML_DOC_DIRS += $1/build-html/$2
- endif
- endif
-@@ -47,7 +47,7 @@ endif
- .PHONY: pdf_$1
- ifeq "$$(phase)" "final"
- ifeq "$$(BUILD_SPHINX_PDF)" "YES"
--$(call all-target,$1,pdf_$1)
-+docs: pdf_$1
- INSTALL_DOCS += $1/$2.pdf
- endif
- endif


=====================================
p/ghc/debian/patches/series
=====================================
@@ -1,16 +1,20 @@
-use-debian-gen_contents_index
 ARM-VFPv3D16
 no-missing-haddock-file-warning
 buildpath-abi-stability.patch
 x32-use-native-x86_64-insn.patch
-use-stage1-binaries-for-install.patch
 kfreebsd-aclocal.m4
 local-mathjax
 haddock-remove-googleapis-fonts
-separate-docs
-build-fix-hs-constants.patch
-fix-index-html-removal
 fix-llvm-armel
 use-unbundled-sphinx-rtd-theme
-fix-bytestring-9.4.6
 newer-llvm
+hadrian-plans
+hadrian-haddock-opts
+hadrian-relpath
+hadrian-iserv
+allow-setting-llvm-program
+fix-cross-compilation
+sparc-support
+hadrian-disable-threaded
+fix-hs_cmpxchg64
+fix-32-bit-unreg


=====================================
p/ghc/debian/patches/sparc-support
=====================================
@@ -0,0 +1,30 @@
+Index: b/m4/ghc_convert_cpu.m4
+===================================================================
+--- a/m4/ghc_convert_cpu.m4
++++ b/m4/ghc_convert_cpu.m4
+@@ -68,6 +68,12 @@ case "$1" in
+   sh4)
+     $2="sh4"
+     ;;
++  sparc64*)
++    $2="sparc64"
++    ;;
++  sparc*)
++    $2="sparc"
++    ;;
+   vax)
+     $2="vax"
+     ;;
+Index: b/m4/fptools_set_haskell_platform_vars.m4
+===================================================================
+--- a/m4/fptools_set_haskell_platform_vars.m4
++++ b/m4/fptools_set_haskell_platform_vars.m4
+@@ -42,7 +42,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
+         riscv64)
+             test -z "[$]2" || eval "[$]2=ArchRISCV64"
+             ;;
+-        hppa|hppa1_1|ia64|m68k|nios2|riscv32|rs6000|s390|sh4|vax)
++        hppa|hppa1_1|ia64|m68k|nios2|riscv32|rs6000|s390|sh4|sparc|sparc64|vax)
+             test -z "[$]2" || eval "[$]2=ArchUnknown"
+             ;;
+         *)


=====================================
p/ghc/debian/patches/use-debian-gen_contents_index deleted
=====================================
@@ -1,34 +0,0 @@
-Index: b/ghc.mk
-===================================================================
---- a/ghc.mk
-+++ b/ghc.mk
-@@ -868,7 +868,6 @@ endif
- # Build the Haddock contents and index
- ifeq "$(HADDOCK_DOCS)" "YES"
- libraries/dist-haddock/index.html: $(haddock_INPLACE) $(ALL_HADDOCK_FILES)
--	cd libraries && sh gen_contents_index --intree
- ifeq "$(phase)" "final"
- $(eval $(call all-target,library_doc_index,libraries/dist-haddock/index.html))
- endif
-@@ -1008,12 +1007,8 @@ endif
- 	$(INSTALL_DIR) "$(DESTDIR)$(docdir)/html"
- 	$(INSTALL_DOC) $(INSTALL_OPTS) docs/index.html "$(DESTDIR)$(docdir)/html"
- ifneq "$(INSTALL_LIBRARY_DOCS)" ""
--	$(INSTALL_DIR) "$(DESTDIR)$(docdir)/html/libraries"
--	for i in $(INSTALL_LIBRARY_DOCS); do \
--		$(INSTALL_DOC) $(INSTALL_OPTS) $$i "$(DESTDIR)$(docdir)/html/libraries/"; \
--	done
-+	mkdir -p $(DESTDIR)$(docdir)/html/libraries/
- 	$(INSTALL_DATA) $(INSTALL_OPTS) libraries/prologue.txt "$(DESTDIR)$(docdir)/html/libraries/"
--	$(INSTALL_SCRIPT) $(INSTALL_OPTS) libraries/gen_contents_index "$(DESTDIR)$(docdir)/html/libraries/"
- endif
- ifneq "$(INSTALL_HTML_DOC_DIRS)" ""
- 	for i in $(INSTALL_HTML_DOC_DIRS); do \
-@@ -1138,7 +1133,6 @@ $(eval $(call bindist-list,.,\
-     mk/project.mk \
-     mk/install.mk.in \
-     bindist.mk \
--    libraries/gen_contents_index \
-     libraries/prologue.txt \
-  ))
- endif


=====================================
p/ghc/debian/patches/use-stage1-binaries-for-install.patch deleted
=====================================
@@ -1,28 +0,0 @@
-Description: Use the stage1 binaries for install
- In order to be able to perform a cross-build, we need to use
- the stage1 binaries during installation. Both ghc and ghc-pkg
- are run during the install target and therefore must be able
- to run on the build machine.
- .
-Author: John Paul Adrian Glaubitz <glaubitz at physik.fu-berlin.de>
-Last-Update: 2017-01-29
-
-Index: b/ghc.mk
-===================================================================
---- a/ghc.mk
-+++ b/ghc.mk
-@@ -1032,8 +1032,12 @@ else # CrossCompiling
- # Install packages in the right order, so that ghc-pkg doesn't complain.
- # Also, install ghc-pkg first.
- ifeq "$(Windows_Host)" "NO"
--INSTALLED_GHC_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc
--INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc-pkg
-+# Use the inplace/stage1 versions for installation,
-+# since the installed versions are built for the target
-+#INSTALLED_GHC_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc
-+#INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc-pkg
-+INSTALLED_GHC_REAL=$(CURDIR)/inplace/bin/ghc-stage1
-+INSTALLED_GHC_PKG_REAL=$(CURDIR)/utils/ghc-pkg/dist/build/tmp/ghc-pkg
- else
- INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe
- INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe


=====================================
p/ghc/debian/provided_substvars
=====================================
@@ -1,8 +1,8 @@
 #! /usr/bin/perl
 
--x 'inplace/bin/ghc-pkg' or die "inplace ghc-pkg not executable or present";
+-x '_build/stage1/bin/ghc-pkg' or die "ghc-pkg not executable or present";
 
-open PKG, 'inplace/bin/ghc-pkg list --simple-output |'
+open PKG, '_build/stage1/bin/ghc-pkg list --simple-output |'
     or die "ghc-pkg list failed: $!";
 
 my @ignored = ('ghc', 'rts');


=====================================
p/ghc/debian/rules
=====================================
@@ -8,12 +8,6 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-# # Set default flags with dpkg-buildflags
-# # This might also close #712228
-# export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-# DPKG_EXPORT_BUILDFLAGS = 1
-# include /usr/share/dpkg/buildflags.mk
-
 # Set a dummy HOME variable upon build. Some build daemons do not set HOME, but
 # ghc-cabal expects it to be available.
 export HOME = /homedoesnotexistatbuildtime
@@ -24,26 +18,45 @@ export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 export DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 export DEB_TARGET_ARCH_ENDIAN	?= $(shell dpkg-architecture -qDEB_TARGET_ARCH_ENDIAN)
 
+# Bootstrap GHC
+export GHC := $(firstword $(shell bash -c "type -p ghc"))
+
+# The version of the GHC we are building
+ProjectVersion := $(shell cat VERSION)
+
+# Move this somewhere else?
+DEB_HOOGLE_TXT_DIR := /usr/lib/ghc-doc/hoogle/
+
+
+# --------------------------------------------------------------------
+# Build configuration
+# For configuration options, see
+# https://www.haskell.org/ghc/blog/20220805-make-to-hadrian.html
+# https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/doc/user-settings.md
+
+# Explicitly pass 'host', 'build' and 'target', because the configuration
+# script fails to properly detect them (e.g., it detects 'x86_64-unknown-linux'
+# instead of 'x86_64-linux-gnu'.
+EXTRA_CONFIGURE_FLAGS += --host $(DEB_BUILD_GNU_TYPE) --build $(DEB_BUILD_GNU_TYPE) --target $(DEB_HOST_GNU_TYPE)
+EXTRA_INSTALL_CONFIGURE_FLAGS += --host $(DEB_BUILD_GNU_TYPE) --build $(DEB_BUILD_GNU_TYPE) --target $(DEB_HOST_GNU_TYPE)
+
 # We're cross-building if DEB_BUILD_GNU_TYPE != DEB_HOST_GNU_TYPE
 ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-  EXTRA_CONFIGURE_FLAGS += --host $(DEB_BUILD_GNU_TYPE) --build $(DEB_BUILD_GNU_TYPE) --target $(DEB_HOST_GNU_TYPE) --enable-unregisterised
-  BUILD_CROSS=YES
+  # EXTRA_CONFIGURE_FLAGS += --enable-unregisterised
+  # EXTRA_HADRIAN_FLAGS += --integer-simple
+  EXTRA_HADRIAN_FLAGS += --flavour=quickest
+  # Do not build docs *at all* (avoid dependency on Sphinx)
+  EXTRA_HADRIAN_FLAGS += --docs=none
+  BUILD_CROSS = YES
 else
-  EXTRA_CONFIGURE_FLAGS += --target $(DEB_HOST_GNU_TYPE)
-  BUILD_CROSS=NO
+  BUILD_CROSS = NO
 endif
 
-ProjectVersion=$(shell cat VERSION)
-
-export GHC=$(firstword $(shell bash -c "type -p ghc"))
-
-DEB_HOOGLE_TXT_DIR = /usr/lib/ghc-doc/hoogle/
-
-ifneq (,$(filter i386 powerpcspe x32 s390x riscv64, $(DEB_HOST_ARCH)))
-  # From GHC 8.10 and later, native code generator support for legacy x87
-  # floating point coprocessor has been removed. GHC now only support floating
-  # point via SSE2. This causes a baseline violation on Debian for i386 where
-  # there is no SSE support. Fallback to unregisterised builds on i386.
+# From GHC 8.10 and later, native code generator support for legacy x87
+# floating point coprocessor has been removed. GHC now only support floating
+# point via SSE2. This causes a baseline violation on Debian for i386 where
+# there is no SSE support. Fallback to unregisterised builds on i386.
+ifneq (,$(filter i386 powerpcspe x32, $(DEB_HOST_ARCH)))
   EXTRA_CONFIGURE_FLAGS += --enable-unregisterised
 endif
 
@@ -54,283 +67,303 @@ endif
 # once #901947 has been fixed.
 # Do the same for powerpcspe, due to https://bugs.debian.org/904915
 # Do the same for sparc64, due to https://bugs.debian.org/908998
-ifneq (,$(filter mips mipsel powerpc powerpcspe sparc64, $(DEB_HOST_ARCH)))
-  EXTRA_CONFIGURE_FLAGS += --disable-ld-override
-endif
-
-%:
-	dh $@
-
-override_dh_autoreconf:
-	dh_autoreconf ./boot.source
+# ifneq (,$(filter mips mipsel powerpc powerpcspe sparc64, $(DEB_HOST_ARCH)))
+#   EXTRA_CONFIGURE_FLAGS += --disable-ld-override
+# endif
 
-override_dh_auto_configure:
-	echo "SRC_HC_OPTS += -lffi -optl-pthread" >> mk/build.mk
-ifeq (NO,$(BUILD_CROSS))
-	echo "CrossCompiling := NO" >> mk/build.mk
-	echo "Stage1Only := NO" >> mk/build.mk
-	echo "HADDOCK_DOCS := YES" >> mk/build.mk
-	echo "EXTRA_HADDOCK_OPTS += --mathjax=file:///usr/share/javascript/mathjax/MathJax.js" >> mk/build.mk
-	echo "XSLTPROC_OPTS += --nonet" >> mk/build.mk
-else
-	echo "CrossCompiling := YES" >> mk/build.mk
-	echo "Stage1Only := NO" >> mk/build.mk
-	echo "SRC_HC_OPTS += -O0 -H64m" >> mk/build.mk
-	echo "GhcStage1HcOpts = -O" >> mk/build.mk
-	echo "GhcStage2HcOpts = -O0" >> mk/build.mk
-	echo "GhcLibHcOpts = -O" >> mk/build.mk
-	echo "SplitObjs = NO" >> mk/build.mk
-	echo "HADDOCK_DOCS := NO" >> mk/build.mk
-	echo "BUILD_SPHINX_HTML := NO" >> mk/build.mk
-	echo "BUILD_SPHINX_PDF := NO" >> mk/build.mk
-endif
-ifeq (armhf,$(DEB_HOST_ARCH))
-	echo "SRC_HC_OPTS += -D__ARM_PCS_VFP" >> mk/build.mk
+ifneq (,$(filter armhf, $(DEB_HOST_ARCH)))
+	EXTRA_HADRIAN_FLAGS += "*.*.ghc.hs.opts += -D__ARM_PCS_VFP"
 endif
-ifneq (,$(filter powerpcspe x32 s390x, $(DEB_HOST_ARCH)))
-	# From Fedora
-	patch -p1 < debian/patches/ghc-warnings.mk-CC-Wall.patch
-endif
-ifneq (,$(filter i386 mips mipsel s390x, $(DEB_HOST_ARCH)))
-	echo "SRC_HC_OPTS     += -optc--param -optcggc-min-expand=10" >> mk/build.mk
+
+ifneq (,$(filter i386 mips mipsel hppa, $(DEB_HOST_ARCH)))
+	EXTRA_HADRIAN_FLAGS += "*.*.ghc.hs.opts += -optc--param -optcggc-min-expand=10"
 endif
+
 ifneq (,$(filter mips64el, $(DEB_HOST_ARCH)))
 	# Pass -mxgot to fix relocation linker errors
-	echo "compiler/GHC/Hs/Instances_HC_OPTS += -optc-mxgot" >> mk/build.mk
-endif
-ifeq (x32,$(DEB_HOST_ARCH))
-	echo "INTEGER_LIBRARY = integer-simple" >> mk/build.mk
+	EXTRA_HADRIAN_FLAGS += "*.GHC.ghc.hs.opts += -optc-mxgot"
 endif
-ifneq (,$(filter nostrip, $(DEB_BUILD_OPTIONS)))
-#	echo "GhcStage1HcOpts += -DDEBUG" >> mk/build.mk
-#	echo "GhcStage2HcOpts += -DDEBUG" >> mk/build.mk
-	echo "SRC_HC_OPTS   += -H32m -O0" >> mk/build.mk
-	echo "GhcHcOpts     += -Rghc-timing -DDEBUG" >> mk/build.mk
-#	echo "GhcLibHcOpts  += -O -dcore-lint -keep-hc-files " >> mk/build.mk
-	echo "SplitObjs     = NO" >> mk/build.mk
-	echo "STRIP         = :" >> mk/build.mk
+
+ifneq (,$(filter x32, $(DEB_HOST_ARCH)))
+	EXTRA_HADRIAN_FLAGS += --integer-simple
 endif
+
 ifneq (,$(filter noopt, $(DEB_BUILD_OPTIONS)))
-	echo "SRC_HC_OPTS   += -H32m -O0" >> mk/build.mk
-	echo "GhcHcOpts     += -O0" >> mk/build.mk
-	# This breaks the build - to be investigated:
-	# echo "GhcLibHcOpts  += -O0" >> mk/build.mk
-	echo "GhcRtsCcOpts  += -O0" >> mk/build.mk
+	EXTRA_HADRIAN_FLAGS += "*.*.ghc.*.opts += -H64m -O0"
+	EXTRA_HADRIAN_FLAGS += "*.*.rts.*.opts += -O0"
 endif
-ifneq (,$(filter alpha i386 m68k mipsel hppa sh4 x32, $(DEB_HOST_ARCH)))
-	# Virtual memory exhausted when trying to build unregisterised compiler on
-	# 32-bit targets. Disable optimizations for compiler/GHC/Hs/Instances.hs.
-	# See https://bugs.debian.org/933968
-	# See https://gitlab.haskell.org/ghc/ghc/issues/17048
-	echo "compiler/GHC/Hs/Instances_HC_OPTS += -O0" >> mk/build.mk
-endif
-	# We also want to build the threaded profiling-enabled debug runtime,
-	# because it does no harm
-	echo 'GhcRTSWays += $$(if $$(filter p, $$(GhcLibWays)),thr_debug_p,)' >> mk/build.mk
-
-	# The make build system is completely broken at this point, since it
-	# doesn't pass the '-build-tool-depends' flag (as Handrian does) and require
-	# alex/happy to build from a release tarball.
-	echo 'utils/genprimopcode_CONFIGURE_OPTS += "-f-build-tool-depends"' >> mk/build.mk
-	echo 'compiler_CONFIGURE_OPTS += "-f-build-tool-depends"' >> mk/build.mk
-	echo 'utils/hpc_CONFIGURE_OPTS += "-f-build-tool-depends"' >> mk/build.mk
-
-	# We can't do this with a configure flag in 6.8.1 as libdir is not
-	# defined at the point at which we := it
-	echo 'ghclibdir := $${libdir}/ghc' >> mk/build.mk
-	echo 'bindir  := /usr/bin' >> mk/build.mk
-	# docdir doesn't have a configure flag, and unfortunately
-	# we also need to explicitly define all of its dependents as they
-	# are set with :=
-	echo 'docdir  := $$(datarootdir)/doc/ghc-doc' >> mk/build.mk
-	echo 'htmldir := $$(docdir)'                   >> mk/build.mk
-	echo 'dvidir  := $$(docdir)'                   >> mk/build.mk
-	echo 'pdfdir  := $$(docdir)'                   >> mk/build.mk
-	echo 'psdir   := $$(docdir)'                   >> mk/build.mk
-	echo 'STRIP_CMD = $(DEB_HOST_GNU_TYPE)-strip'  >> mk/build.mk
-	echo 'RANLIB_CMD = $(DEB_HOST_GNU_TYPE)-ranlib'>> mk/build.mk
-	# We want verbose builds
-	echo 'V=1'                                     >> mk/build.mk
-	dh_auto_configure -- \
-		$(EXTRA_CONFIGURE_FLAGS) \
-		--with-system-libffi --libdir=/usr/lib
-
-override_dh_auto_build-indep:
-	# Building docs needs a full build
-	dh_auto_build -i -- all docs
 
-override_dh_auto_test:
-ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
-	# Do some very simple tests that the compiler actually works
-	rm -rf debian/testghc
-	mkdir debian/testghc
-	echo 'main = putStrLn "Foo"' > debian/testghc/foo.hs
-	inplace/bin/ghc-stage2 debian/testghc/foo.hs -o debian/testghc/foo
-	[ "$$(debian/testghc/foo)" = "Foo" ]
-	rm debian/testghc/*
-	echo 'main = putStrLn "Foo"' > debian/testghc/foo.hs
-	inplace/bin/ghc-stage2 debian/testghc/foo.hs -o debian/testghc/foo -O2
-	[ "$$(debian/testghc/foo)" = "Foo" ]
-	rm debian/testghc/*
-	@printf "====BEGIN GHC INFO OUTPUT====\n"
-	@inplace/bin/ghc-stage2 --info
-	@printf "====END GHC INFO OUTPUT====\n"
+# Use system libffi
+EXTRA_CONFIGURE_FLAGS += --with-system-libffi
+
+# Set LLVM version
+# If we don't set these, then the default value (llc / opt) will not work
+# on architectures where the default llc/opt version is different than
+# one of the supported versions.
+EXTRA_CONFIGURE_FLAGS += LLC=llc-15 OPT=opt-15
+EXTRA_INSTALL_CONFIGURE_FLAGS += LLC=llc-15 OPT=opt-15
+
+
+%:
+	dh $@
+
+# --------------------------------------------------------------------
+# Configure hadrian
+
+hadrian/hadrian:
+# Case A (default, with hadrian package available): the builder did not select
+# the "pkg.ghc.nohadrian" build profile. In this case, we use the distro's
+# hadrian.
+ifeq (,$(findstring pkg.ghc.nohadrian,$(DEB_BUILD_PROFILES)))
+	test -f "$$(which hadrian)"
+	ln -s "$$(which hadrian)" hadrian/hadrian
+# Case B (without hadrian): the builder selected the "pkg.ghc.nohadrian" build
+# profile. In this case, we use the ./hadrian/bootstrap/bootstrap.py script in
+# order to download the build-dependencies for hadrian, and build it ourselves
+# with our bootstrap ghc.
+else
+	cd hadrian && \
+		./bootstrap/bootstrap.py && \
+		test -f _build/bin/hadrian && \
+		ln -s _build/bin/hadrian hadrian
 endif
 
-FILES = \( -type f -o -type l \)
-PROF_FILE = \( -name "*.p_*" -o -name "lib*_p.a" \)
+.PHONY: clean-hadrian
+clean-hadrian:
+	rm -f hadrian/hadrian
+	rm -rf hadrian/_build
 
-override_dh_auto_install-arch:
-	# See https://bugs.debian.org/944493 for why we use --no-parallel.
-	dh_auto_install --no-parallel
+# --------------------------------------------------------------------
+# Configure/Build rules
 
-	# Remove the haddock.t files, they really should not be in the released
-	# package (upstream #10410)
-	find debian/tmp -name \*.haddock.t -delete
+override_dh_autoreconf:
+	dh_autoreconf ./boot.source
 
-	# Generate lintian overrides
-	mkdir -p debian/tmp/usr/share/lintian/overrides
-	echo "ghc binary: extra-license-file `cd debian/tmp && echo usr/lib/ghc/Cabal-*/Distribution/License.hi`" >> debian/tmp/usr/share/lintian/overrides/ghc
-	echo "ghc: extra-license-file `cd debian/tmp && echo usr/lib/ghc/Cabal-*/Distribution/License.dyn_hi`" >> debian/tmp/usr/share/lintian/overrides/ghc
-	echo "ghc-prof binary: extra-license-file `cd debian/tmp && echo usr/lib/ghc/Cabal-*/Distribution/License.p_hi`" >> debian/tmp/usr/share/lintian/overrides/ghc-prof
-
-	# Sort out the package.conf files
-	if ! test -d debian/tmp/var/lib/ghc/package.conf.d ; then \
-		mkdir -p debian/tmp/var/lib/ghc ;\
-		mv debian/tmp/usr/lib/ghc/package.conf.d debian/tmp/var/lib/ghc/ ;\
-		rm debian/tmp/var/lib/ghc/package.conf.d/package.cache ;\
-	fi
-	rm -rf debian/tmp/usr/lib/ghc/package.conf.d
-
-	# Modify the ghc-doc path in package conf files
-	sed -ri 's,/usr/share/doc/ghc-doc/html/libraries/(.*)\.haddock,/usr/lib/ghc-doc/haddock/ghc/\1.haddock,' debian/tmp/var/lib/ghc/package.conf.d/*.conf
-
-	# Sort out the binaries
-ifeq (NO,$(BUILD_CROSS))
-	if inplace/bin/ghc-stage2 --info | grep '"Have interpreter","NO"'; then \
-	    cd debian/tmp/usr/bin ;rm -f ghci* runghc* runhaskell*; \
-	fi
+override_dh_auto_configure:
+	dh_auto_configure -- $(EXTRA_CONFIGURE_FLAGS)
+
+override_dh_auto_build-arch: export LC_ALL=C.UTF-8
+override_dh_auto_build-arch: hadrian/hadrian
+ifeq (YES,$(BUILD_CROSS))
+	# See https://gitlab.haskell.org/ghc/ghc/-/issues/23975
+	# and https://gitlab.haskell.org/ghc/ghc/-/issues/22006
+	$(error cross-compilation is not supported)
+endif
+	hadrian/hadrian \
+		-V -j \
+		--docs=no-haddocks --docs=no-sphinx-html --docs=no-sphinx-pdfs \
+		binary-dist-dir \
+		$(EXTRA_HADRIAN_FLAGS)
+	# I have noticed that on some rare cases the package cache
+	# generated for stage2 is stale. This is probably an upstream bug,
+	# and it wouldn't affect us (the package cache for binary-dist-dir is
+	# correct), but we use ghc-pkg from stage2 when we generate our control file.
+	# Maybe we should consider using ghc-pkg from binary-dist-dir instead.
+	# As a work-around for now, regenerate the stage2 package cache.
+	_build/stage1/bin/ghc-pkg recache
+
+# This rule is a superset of 'override_dh_auto_build-arch'. It builds everything
+# that the '-arch' rule builds, and then docs on top.
+# The reason we split those two rules, is to avoid building docs on arch
+# builders, because building docs requires running Haddock, which fails with
+# OOM errors on some weak builders.
+override_dh_auto_build-indep: export LC_ALL=C.UTF-8
+override_dh_auto_build-indep: hadrian/hadrian
+ifeq (YES,$(BUILD_CROSS))
+	$(error override_dh_auto_build-indep is not supported when cross compiling)
 endif
+	hadrian/hadrian \
+		-V -j \
+		--docs=no-sphinx-pdfs \
+		binary-dist-dir \
+		$(EXTRA_HADRIAN_FLAGS)
+	# I have noticed that on some rare cases the package cache
+	# generated for stage2 is stale. This is probably an upstream bug,
+	# and it wouldn't affect us (the package cache for binary-dist-dir is
+	# correct), but we use ghc-pkg from stage2 when we generate our control file.
+	# Maybe we should consider using ghc-pkg from binary-dist-dir instead.
+	# As a work-around for now, regenerate the stage2 package cache.
+	_build/stage1/bin/ghc-pkg recache
+
+
+# --------------------------------------------------------------------
+# Installation rules
+# Configure and install the binary distribution generated by
+# 'hadrian binary-dist-dir'
+
+BINDIST = _build/bindist/ghc-$(ProjectVersion)-$(DEB_HOST_GNU_TYPE)
+
+$(BINDIST)/mk/install.mk:
+	cd $(BINDIST) && \
+		./configure \
+			--prefix=/usr \
+			--docdir=/usr/share/doc/ghc-doc \
+			$(EXTRA_INSTALL_CONFIGURE_FLAGS)
+	# We cannot modify 'ghclibdir' through configure, mk/install.mk sets it
+	# to '$(libdir)/$(CrossCompilePrefix)ghc-$(ProjectVersion)'.
+	# Modify 'mk/install.mk' and set 'ghclibdir' to '/usr/lib/ghc'.
+	echo 'ghclibdir := $$(libdir)/ghc' >> $@
+
+# The reason this is a PHONY target is because we need to re-run this in case
+# we first built and installed '-arch' packages, and now we want to build and
+# install '-indep' packages.
+.PHONY: debian/tmp
+debian/tmp: $(BINDIST)/mk/install.mk
+	rm -rf debian/tmp
+	DESTDIR=$$(pwd)/debian/tmp/ make -C $(BINDIST) install
+
+	# Remove the conf.copy files, they really should not be in the installed
+	# package.
+	find debian/tmp -name \*.conf.copy -delete
+
+	# Move the package.conf files
+	# GHC installs package configuration files under '/usr/lib/ghc/lib/package.conf.d'
+	# but in Debian we move these files under 'var/lib/ghc/package.conf.d'.
+	# See also the debian/ghc.links file.
+	mkdir -p debian/tmp/var/lib/ghc
+	mv debian/tmp/usr/lib/ghc/lib/package.conf.d debian/tmp/var/lib/ghc/
+	rm -f debian/tmp/var/lib/ghc/package.conf.d/package.cache*
+	rm -f debian/tmp/var/lib/ghc/package.conf.d/.stamp
+
+	# Modify the ghc-doc path in package.conf files
+	sed -ri 's,share/doc/ghc-doc/html/libraries/(.*)\.haddock,lib/ghc-doc/haddock/ghc/\1.haddock,' debian/tmp/var/lib/ghc/package.conf.d/*.conf
+
+	# Replace ${pkgroot} in the package.conf files.
+	# The "pkgroot" is the directory containing the package database,
+	# which for us should be '/usr/lib/ghc/lib/'.
+	# The reason we change it here is because we are moving the package.conf
+	# files under '/var/lib/ghc/package.conf.d'.
+	sed -ri 's,\$$\{pkgroot\},/usr/lib/ghc/lib,' debian/tmp/var/lib/ghc/package.conf.d/*.conf
 
 	# manpages
+ifeq (NO,$(BUILD_CROSS))
 	echo ".so man1/ghc.1" > debian/tmp/usr/share/man/man1/ghc-$(ProjectVersion).1
 	if test -e debian/tmp/usr/bin/ghci-$(ProjectVersion); then \
-	    echo ".so man1/ghc.1" > debian/tmp/usr/share/man/man1/ghci.1 ;\
-	    echo ".so man1/ghc.1" > debian/tmp/usr/share/man/man1/ghci-$(ProjectVersion).1 ;\
-	    cp debian/runghc.man debian/tmp/usr/share/man/man1/runghc.1 ; fi
+		echo ".so man1/ghc.1" > debian/tmp/usr/share/man/man1/ghci.1 ;\
+		echo ".so man1/ghc.1" > debian/tmp/usr/share/man/man1/ghci-$(ProjectVersion).1 ;\
+		cp debian/runghc.man debian/tmp/usr/share/man/man1/runghc.1 ; fi
 	cp utils/hp2ps/hp2ps.1 debian/tmp/usr/share/man/man1/hp2ps.1
 	cp debian/ghc-pkg.man debian/tmp/usr/share/man/man1/ghc-pkg.1
 	echo ".so man1/ghc-pkg.1" > debian/tmp/usr/share/man/man1/ghc-pkg-$(ProjectVersion).1
-
 	cp debian/haddock.man debian/tmp/usr/share/man/man1/haddock.1
-	find debian/tmp/usr/share/man $(FILES)           >> debian/ghc.install
-	# ####################
-	# Now all the files are sorted, create the package filelists
-
-	# ghc
-	find debian/tmp/usr/bin $(FILES)                 >> debian/ghc.install
-#	find debian/tmp/usr/share/ghc* $(FILES)          >> debian/ghc.install
-	find debian/tmp/usr/lib/ghc $(FILES) ! $(PROF_FILE) >> debian/ghc.install
-	find debian/tmp/var				 >> debian/ghc.install
-	echo debian/tmp/usr/share/lintian/overrides/ghc >> debian/ghc.install
-	rm -f debian/ghc.links
-	# Old directories for symlink-workaround. Remove once all libraries use new path
-	echo "/var/lib/ghc/package.conf.d /usr/lib/ghc/package.conf.d" >> debian/ghc.links
-	# ghc-prof
-	find debian/tmp/usr/lib $(FILES) $(PROF_FILE) > debian/ghc-prof.install
-	echo debian/tmp/usr/share/lintian/overrides/ghc-prof >> debian/ghc-prof.install
-
-	sed -i s,^debian/tmp,, debian/*.install debian/*.links
-
-override_dh_auto_install-indep:
-	# We need to run the 'install' target as well here,
-	# so we install package.conf files and generate 'Provides' from them.
-	dh_auto_install --no-parallel -- install install_docs
+endif
 
 	# Delete all the library LICENSE files
 	rm -f debian/tmp/usr/share/doc/ghc-doc/html/libraries/*/LICENSE
 
-	# Sort out the package.conf files
-	# We need this in order to run dh_haskell_provides afterwards
-	if ! test -d debian/tmp/var/lib/ghc/package.conf.d ; then \
-		mkdir -p debian/tmp/var/lib/ghc ;\
-		mv debian/tmp/usr/lib/ghc/package.conf.d debian/tmp/var/lib/ghc/ ;\
-		rm debian/tmp/var/lib/ghc/package.conf.d/package.cache ;\
-	fi
-	rm -rf debian/tmp/usr/lib/ghc/package.conf.d
-
-	# Install haddock files
+	# Move gen_contents_index binary
+	# We use our own binary because upstream expects to be run from
+	# a different directory.
 	mkdir -p debian/tmp/usr/lib/ghc-doc
+	rm -f debian/tmp/usr/share/doc/ghc-doc/html/libraries/gen_contents_index
 	cp debian/gen_contents_index debian/tmp/usr/lib/ghc-doc/
 	chmod +x debian/tmp/usr/lib/ghc-doc/gen_contents_index
-	mkdir debian/tmp/usr/lib/ghc-doc/haddock
-	mkdir debian/tmp/usr/lib/ghc-doc/haddock/ghc/
+
+	# Move haddock files to the correct folder
+	# (Create folders if they don't exist, i.e., if we are building '-arch')
+	mkdir -p debian/tmp/usr/lib/ghc-doc/haddock/ghc/
+	mkdir -p debian/tmp/usr/share/doc/ghc-doc/html/libraries/
 	for f in `find debian/tmp/usr/share/doc/ghc-doc/html/libraries/ -maxdepth 1 -mindepth 1 -type d`; do \
-	    mkdir debian/tmp/usr/lib/ghc-doc/haddock/ghc/`basename $$f` ; \
-	    mv $$f/*.haddock debian/tmp/usr/lib/ghc-doc/haddock/ghc/`basename $$f` ; done
+		mkdir debian/tmp/usr/lib/ghc-doc/haddock/ghc/`basename $$f` ; \
+		mv $$f/*.haddock debian/tmp/usr/lib/ghc-doc/haddock/ghc/`basename $$f` ; done
 	cd debian/tmp/usr/share/doc/ghc-doc/html/libraries/; ln -s ghc-$(ProjectVersion) ghc
+
 	install -Dm 644 debian/index.html debian/tmp/usr/share/doc/ghc-doc/index.html
 
-	# ghc-doc
+	# Create Hoogle directory
 	mkdir -p debian/tmp/$(DEB_HOOGLE_TXT_DIR)
+
+	# Generate lintian overrides
+	mkdir -p debian/tmp/usr/share/lintian/overrides
+	echo "ghc binary: extra-license-file `cd debian/tmp && echo usr/lib/ghc/lib/*/Cabal-*/Distribution/License.hi`" >> debian/tmp/usr/share/lintian/overrides/ghc
+	echo "ghc binary: extra-license-file `cd debian/tmp && echo usr/lib/ghc/lib/*/Cabal-*/Distribution/SPDX/License.hi`" >> debian/tmp/usr/share/lintian/overrides/ghc
+	echo "ghc: extra-license-file `cd debian/tmp && echo usr/lib/ghc/lib/*/Cabal-*/Distribution/License.dyn_hi`" >> debian/tmp/usr/share/lintian/overrides/ghc
+	echo "ghc: extra-license-file `cd debian/tmp && echo usr/lib/ghc/lib/*/Cabal-*/Distribution/SPDX/License.dyn_hi`" >> debian/tmp/usr/share/lintian/overrides/ghc
+	echo "ghc-prof binary: extra-license-file `cd debian/tmp && echo usr/lib/ghc/lib/*/Cabal-*/Distribution/License.p_hi`" >> debian/tmp/usr/share/lintian/overrides/ghc-prof
+	echo "ghc-prof binary: extra-license-file `cd debian/tmp && echo usr/lib/ghc/lib/*/Cabal-*/Distribution/SPDX/License.p_hi`" >> debian/tmp/usr/share/lintian/overrides/ghc-prof
+
+FILES = \( -type f -o -type l \)
+PROF_FILE = \( -name "*.p_*" -o -name "lib*_p.a" \)
+
+override_dh_auto_install-arch: debian/tmp
+	# Manpages
+ifeq (NO,$(BUILD_CROSS))
+	find debian/tmp/usr/share/man $(FILES)           >> debian/ghc.install
+endif
+	# ghc
+	find debian/tmp/usr/bin $(FILES)                 >> debian/ghc.install
+#	find debian/tmp/usr/share/ghc* $(FILES)          >> debian/ghc.install
+	find debian/tmp/usr/lib/ghc $(FILES) ! $(PROF_FILE) >> debian/ghc.install
+	find debian/tmp/var				 >> debian/ghc.install
+	echo debian/tmp/usr/share/lintian/overrides/ghc >> debian/ghc.install
+	# ghc-prof
+	find debian/tmp/usr/lib/ghc $(FILES) $(PROF_FILE) > debian/ghc-prof.install
+	echo debian/tmp/usr/share/lintian/overrides/ghc-prof >> debian/ghc-prof.install
+	# Normalize paths
+	sed -i s,^debian/tmp,, debian/*.install debian/*.links
+
+override_dh_auto_install-indep: debian/tmp
+	# ghc-doc
 	find debian/tmp/usr/share/doc/ghc-doc/html/libraries/*/ -name "*.txt" \
 		-printf "%p $(DEB_HOOGLE_TXT_DIR)/%f\n" >> debian/ghc-doc.links
-	find debian/tmp/usr/share/doc/ghc-doc $(FILES) > debian/ghc-doc.install
+	find debian/tmp/usr/share/doc/ghc-doc/html $(FILES) > debian/ghc-doc.install
 	find debian/tmp/usr/lib/ghc-doc $(FILES)      >> debian/ghc-doc.install
-
+	echo debian/tmp/usr/share/doc/ghc-doc/index.html >> debian/ghc-doc.install
+	# Normalize paths
 	sed -i s,^debian/tmp,, debian/*.install debian/*.links
 
-override_dh_auto_clean:
-	dh_auto_clean
-	rm -f mk/build.mk
 
+# --------------------------------------------------------------------
+# Cleanup and other rules
+
+override_dh_auto_clean: clean-hadrian
+	# Build artifacts
+	rm -rf _build/
+
+	# Temp files in debian/ dir
+	rm -rf debian/tmp
 	rm -f debian/*.install
-	rm -f debian/*.1
-	rm -f debian/ghc.manpages
-	rm -f debian/ghc.links
 	rm -f debian/ghc-doc.links
-	rm -f mk/build.mk
 	rm -rf debian/testghc
-	rm -f ch01.html ch02.html index.html
 	rm -rf debian/tmp-db
 
-	# Hacks:
-	rm -f config.log
-	rm -f libraries/ghc-prim/GHC/PrimopWrappers.hs
-	rm -f libraries/ghc-prim/GHC/Prim.hs
-	rm -f libraries/ghc-prim/GHC/Generics.hc
-	rm -f libraries/ghc-prim/GHC/Generics.dyn_hc
-	rm -f libraries/ghc-prim/GHC/IntWord32.hc
-	rm -f libraries/integer-gmp/GHC/Integer/Type.hc
-	rm -f libraries/base/GHC/ConsoleHandler.hc
-	rm -f libraries/base/GHC/IO/Encoding/CodePage.hc
-	rm -f libraries/base/Unsafe/Coerce.hc
-	rm -f rts/libs.depend mk/install.mk
-	rm -f rts/package.conf.install.raw
-	rm -f rts/package.conf.inplace.raw
-	rm -f utils/ghc-pwd/dist-boot/Main.hi
-	rm -f utils/ghc-pwd/dist-boot/Main.o
-	rm -f utils/ghc-pwd/dist-boot/ghc-pwd
-
-	rm -f libraries/haskeline/a.out
-	rm -rf utils/ghctags/dist-install
+override_dh_auto_test:
+ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
+	# Do some very simple tests that the compiler actually works
+	rm -rf debian/testghc
+	mkdir debian/testghc
+	echo 'main = putStrLn "Foo"' > debian/testghc/foo.hs
+	_build/stage1/bin/ghc debian/testghc/foo.hs -o debian/testghc/foo
+	[ "$$(debian/testghc/foo)" = "Foo" ]
+	rm debian/testghc/*
+	echo 'main = putStrLn "Foo"' > debian/testghc/foo.hs
+	_build/stage1/bin/ghc debian/testghc/foo.hs -o debian/testghc/foo -O2
+	[ "$$(debian/testghc/foo)" = "Foo" ]
+	rm debian/testghc/*
+	@printf "====BEGIN GHC INFO OUTPUT====\n"
+	@_build/stage1/bin/ghc --info
+	@printf "====END GHC INFO OUTPUT====\n"
+	@printf "====BEGIN GHC-PKG OUTPUT====\n"
+	@_build/stage1/bin/ghc-pkg list
+	@printf "====END GHC-PKG OUTPUT====\n"
+endif
 
 override_dh_compress:
 	dh_compress -X.haddock -X.txt
 
 override_dh_gencontrol:
+ifeq (NO,$(BUILD_CROSS))
 	# Generate substvars
 	chmod +x debian/provided_substvars
 	debian/provided_substvars
 	# Check if we have a ghci binary
 	if test -e debian/tmp/usr/bin/ghci-$(ProjectVersion); then \
-	    echo 'ghci=ghc-ghci' >> debian/ghc.substvars ; fi
+		echo 'ghci=ghc-ghci' >> debian/ghc.substvars ; fi
 	# Add haddock substvars
-ifeq (NO,$(BUILD_CROSS))
 	echo "haddock:Provides=haddock-interface-$$(debian/tmp/usr/lib/ghc/bin/haddock --interface-version)" >> debian/ghc.substvars
 	echo "haddock:Depends=haddock-interface-$$(debian/tmp/usr/lib/ghc/bin/haddock --interface-version)" >> debian/ghc-doc.substvars
-endif
 	dh_haskell_provides
+endif
 	dh_gencontrol
 
 override_dh_shlibdeps:
@@ -339,7 +372,6 @@ override_dh_shlibdeps:
 # we do not want shlibs files there, neither postrm scripts
 override_dh_makeshlibs:
 
-#GHC has no meaningful debugging symbols, so we don't ship a -dbgsym
-#package.
+# GHC has no meaningful debugging symbols, so we don't ship a -dbgsym package.
 override_dh_strip:
 	dh_strip --no-automatic-dbgsym


=====================================
p/ghc/debian/watch
=====================================
@@ -1,4 +1,4 @@
 version=3
-opts="pgpsigurlmangle=s/$/.sig/,dirversionmangle=s/-rc/~rc/,repacksuffix=+dfsg1,dversionmangle=s/\+dfsg\d*$//" \
+opts="pgpsigurlmangle=s/$/.sig/,dirversionmangle=s/-rc/~rc/" \
 https://downloads.haskell.org/~ghc/(\d[\d.rc-]*)/ghc-(\d[\d.]*)-src.tar.(?:bz2|xz|gz)
 



View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/compare/479046ada7df680594febff047e1c6108ca182cf...f26884ae9fcb37799ed815605e07318739f8028c

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/compare/479046ada7df680594febff047e1c6108ca182cf...f26884ae9fcb37799ed815605e07318739f8028c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20231010/a56adbc0/attachment-0001.htm>


More information about the Pkg-haskell-commits mailing list