[Git][ghc/ghc][wip/toolchain-selection] Add Note [ghc-toolchain consistency checking]

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon Jul 17 11:06:32 UTC 2023



Rodrigo Mesquita pushed to branch wip/toolchain-selection at Glasgow Haskell Compiler / GHC


Commits:
78de5dae by Rodrigo Mesquita at 2023-07-17T12:06:25+01:00
Add Note [ghc-toolchain consistency checking]

- - - - -


2 changed files:

- m4/ghc_toolchain.m4
- m4/prep_target_file.m4


Changes:

=====================================
m4/ghc_toolchain.m4
=====================================
@@ -116,6 +116,22 @@ AC_DEFUN([FIND_GHC_TOOLCHAIN],
 ])
 
 
+dnl Note [ghc-toolchain consistency checking]
+dnl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+dnl ghc-toolchain is the brand new way (2023) to configure toolchains for GHC,
+dnl but this novelty musn't break user's installations, so we still
+dnl conservatively use the toolchains configured by configure (see also m4/prep_target_file.m4).
+dnl
+dnl However, we already ship and run ghc-toolchain at configure time to /validate/ ghc-toolchain:
+dnl * PREP_TARGET_FILE substitutes the toolchain into default.target.in and default.host.target.in
+dnl * FIND_GHC_TOOLCHAIN generates a target description file through ghc-toolchain
+dnl * VALIDATE_GHC_TOOLCHAIN compares the output of the two, warning about the differences.
+dnl
+dnl This is crucial to validate ghc-toolchain and preemptively fix bugs before it is the default.
+dnl
+dnl (And the configure flag --enable-ghc-toolchain makes hadrian use the target
+dnl files generated by ghc-toolchain instead).
+
 dnl $1 like "default.target"
 dnl $2 like "default.target.ghc-toolchain"
 AC_DEFUN([VALIDATE_GHC_TOOLCHAIN],[


=====================================
m4/prep_target_file.m4
=====================================
@@ -6,6 +6,9 @@
 # Since we substitute in those files with configured variables, we have to
 # preparate them as Haskell values, for example, turning YES/NO into
 # True,False, or empty variables into Nothing or Just something otherwise.
+#
+# This toolchain will additionally be used to validate the one generated by
+# ghc-toolchain. See Note [ghc-toolchain consistency checking].
 
 # PREP_MAYBE_SIMPLE_PROGRAM
 # =========================



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/78de5dae63c77ef4c317e4b47beab12527908a7a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/78de5dae63c77ef4c317e4b47beab12527908a7a
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230717/87520556/attachment-0001.html>


More information about the ghc-commits mailing list