[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 7 commits: hadrian: add hi_core flavour transformer

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Jan 19 20:09:33 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
bad72f39 by Cheng Shao at 2023-01-19T15:08:44-05:00
hadrian: add hi_core flavour transformer

The hi_core flavour transformer enables -fwrite-if-simplified-core for
stage1 libraries, which emit core into interface files to make it
possible to restart code generation. Building boot libs with it makes
it easier to use GHC API to prototype experimental backends that needs
core/stg at link time.

- - - - -
d692cc57 by Cheng Shao at 2023-01-19T15:08:44-05:00
hadrian: add missing docs for recently added flavour transformers

- - - - -
5663f1af by Ben Gamari at 2023-01-19T15:08:44-05:00
gitlab-ci: Add Rocky8 jobs

Addresses #22268.

- - - - -
e22831c9 by Vladislav Zavialov at 2023-01-19T15:08:45-05:00
Set "since: 9.8" for TypeAbstractions and -Wterm-variable-capture

These flags did not make it into the 9.6 release series,
so the "since" annotations must be corrected.

- - - - -
76308c53 by Ben Gamari at 2023-01-19T15:08:45-05:00
template-haskell: Bump version to 2.20.0.0

Updates `text` and `exceptions` submodules for bounds bumps.

Addresses #22767.

- - - - -
01db846a by Cheng Shao at 2023-01-19T15:08:46-05:00
hadrian: disable alloca for in-tree GMP on wasm32

When building in-tree GMP for wasm32, disable its alloca usage, since
it may potentially cause stack overflow (e.g. #22602).

- - - - -
7ccebb00 by Cheng Shao at 2023-01-19T15:08:47-05:00
Bump process submodule

Includes a critical fix for wasm32, see
https://github.com/haskell/process/pull/272 for details. Also changes
the existing cross test to include process stuff and avoid future
regression here.

- - - - -


20 changed files:

- .gitlab/gen_ci.hs
- .gitlab/hello.hs
- .gitlab/jobs.yaml
- compiler/GHC/Driver/Flags.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.6.1-notes.rst
- + docs/users_guide/9.8.1-notes.rst
- docs/users_guide/exts/type_abstractions.rst
- docs/users_guide/release-notes.rst
- docs/users_guide/using-warnings.rst
- hadrian/doc/flavours.md
- hadrian/src/Flavour.hs
- hadrian/src/Settings/Builders/Configure.hs
- libraries/exceptions
- libraries/ghci/ghci.cabal.in
- libraries/process
- libraries/template-haskell/template-haskell.cabal.in
- libraries/text
- testsuite/tests/ghci/scripts/T21110.stderr
- testsuite/tests/package/T4806a.stderr


Changes:

=====================================
.gitlab/gen_ci.hs
=====================================
@@ -109,7 +109,13 @@ data Opsys
   | Windows deriving (Eq)
 
 data LinuxDistro
-  = Debian11 | Debian10 | Debian9 | Fedora33 | Ubuntu2004 | Centos7 | Alpine deriving (Eq)
+  = Debian11 | Debian10 | Debian9
+  | Fedora33
+  | Ubuntu2004
+  | Centos7
+  | Alpine
+  | Rocky8
+  deriving (Eq)
 
 data Arch = Amd64 | AArch64 | I386
 
@@ -267,6 +273,7 @@ distroName Fedora33  = "fedora33"
 distroName Ubuntu2004 = "ubuntu20_04"
 distroName Centos7    = "centos7"
 distroName Alpine     = "alpine3_12"
+distroName Rocky8     = "rocky8"
 
 opsysName :: Opsys -> String
 opsysName (Linux distro) = "linux-" ++ distroName distro
@@ -413,6 +420,9 @@ distroVariables Alpine = mconcat
 distroVariables Centos7 = mconcat [
   "HADRIAN_ARGS" =: "--docs=no-sphinx"
   ]
+distroVariables Rocky8 = mconcat [
+  "HADRIAN_ARGS" =: "--docs=no-sphinx"
+  ]
 distroVariables Fedora33 = mconcat
   -- LLC/OPT do not work for some reason in our fedora images
   -- These tests fail with this error: T11649 T5681 T7571 T8131b
@@ -851,6 +861,7 @@ job_groups =
      -- not being at EOL until April 2023 and they still need tinfo5.
      , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla))
      , disableValidate (standardBuilds Amd64 (Linux Ubuntu2004))
+     , disableValidate (standardBuilds Amd64 (Linux Rocky8))
      , disableValidate (standardBuildsWithConfig Amd64 (Linux Centos7) (splitSectionsBroken vanilla))
      -- Fedora33 job is always built with perf so there's one job in the normal
      -- validate pipeline which is built with perf.


=====================================
.gitlab/hello.hs
=====================================
@@ -1,4 +1,4 @@
-{-# OPTIONS_GHC -Wno-missing-fields #-}
+{-# OPTIONS_GHC -Wall -Wno-missing-fields #-}
 
 import GHC hiding (parseModule)
 import GHC.Data.StringBuffer
@@ -9,6 +9,7 @@ import GHC.Platform
 import GHC.Plugins
 import GHC.Settings
 import GHC.Settings.Config
+import System.Mem.Weak
 
 fakeSettings :: Settings
 fakeSettings =
@@ -41,5 +42,6 @@ parse dflags src = do
 
 main :: IO ()
 main = do
+  _ <- mkWeak runGhc runGhc Nothing
   m <- parse fakeDynFlags "main = putStrLn \"hello world\""
   putStrLn $ showSDoc fakeDynFlags $ ppr m


=====================================
.gitlab/jobs.yaml
=====================================
@@ -1812,6 +1812,66 @@
       "XZ_OPT": "-9"
     }
   },
+  "nightly-x86_64-linux-rocky8-validate": {
+    "after_script": [
+      ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh clean",
+      "cat ci_timings"
+    ],
+    "allow_failure": false,
+    "artifacts": {
+      "expire_in": "8 weeks",
+      "paths": [
+        "ghc-x86_64-linux-rocky8-validate.tar.xz",
+        "junit.xml"
+      ],
+      "reports": {
+        "junit": "junit.xml"
+      },
+      "when": "always"
+    },
+    "cache": {
+      "key": "x86_64-linux-rocky8-$CACHE_REV",
+      "paths": [
+        "cabal-cache",
+        "toolchain"
+      ]
+    },
+    "dependencies": [],
+    "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-rocky8:$DOCKER_REV",
+    "needs": [
+      {
+        "artifacts": false,
+        "job": "hadrian-ghc-in-ghci"
+      }
+    ],
+    "rules": [
+      {
+        "if": "($CI_MERGE_REQUEST_LABELS !~ /.*fast-ci.*/) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY) && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\")",
+        "when": "on_success"
+      }
+    ],
+    "script": [
+      "sudo chown ghc:ghc -R .",
+      ".gitlab/ci.sh setup",
+      ".gitlab/ci.sh configure",
+      ".gitlab/ci.sh build_hadrian",
+      ".gitlab/ci.sh test_hadrian"
+    ],
+    "stage": "full-build",
+    "tags": [
+      "x86_64-linux"
+    ],
+    "variables": {
+      "BIGNUM_BACKEND": "gmp",
+      "BIN_DIST_NAME": "ghc-x86_64-linux-rocky8-validate",
+      "BUILD_FLAVOUR": "validate",
+      "CONFIGURE_ARGS": "",
+      "HADRIAN_ARGS": "--docs=no-sphinx",
+      "TEST_ENV": "x86_64-linux-rocky8-validate",
+      "XZ_OPT": "-9"
+    }
+  },
   "nightly-x86_64-linux-ubuntu20_04-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
@@ -2917,6 +2977,67 @@
       "XZ_OPT": "-9"
     }
   },
+  "release-x86_64-linux-rocky8-release": {
+    "after_script": [
+      ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh clean",
+      "cat ci_timings"
+    ],
+    "allow_failure": false,
+    "artifacts": {
+      "expire_in": "1 year",
+      "paths": [
+        "ghc-x86_64-linux-rocky8-release.tar.xz",
+        "junit.xml"
+      ],
+      "reports": {
+        "junit": "junit.xml"
+      },
+      "when": "always"
+    },
+    "cache": {
+      "key": "x86_64-linux-rocky8-$CACHE_REV",
+      "paths": [
+        "cabal-cache",
+        "toolchain"
+      ]
+    },
+    "dependencies": [],
+    "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-rocky8:$DOCKER_REV",
+    "needs": [
+      {
+        "artifacts": false,
+        "job": "hadrian-ghc-in-ghci"
+      }
+    ],
+    "rules": [
+      {
+        "if": "($CI_MERGE_REQUEST_LABELS !~ /.*fast-ci.*/) && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null) && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\")",
+        "when": "on_success"
+      }
+    ],
+    "script": [
+      "sudo chown ghc:ghc -R .",
+      ".gitlab/ci.sh setup",
+      ".gitlab/ci.sh configure",
+      ".gitlab/ci.sh build_hadrian",
+      ".gitlab/ci.sh test_hadrian"
+    ],
+    "stage": "full-build",
+    "tags": [
+      "x86_64-linux"
+    ],
+    "variables": {
+      "BIGNUM_BACKEND": "gmp",
+      "BIN_DIST_NAME": "ghc-x86_64-linux-rocky8-release",
+      "BUILD_FLAVOUR": "release",
+      "CONFIGURE_ARGS": "",
+      "HADRIAN_ARGS": "--docs=no-sphinx",
+      "IGNORE_PERF_FAILURES": "all",
+      "TEST_ENV": "x86_64-linux-rocky8-release",
+      "XZ_OPT": "-9"
+    }
+  },
   "release-x86_64-linux-ubuntu20_04-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",


=====================================
compiler/GHC/Driver/Flags.hs
=====================================
@@ -631,7 +631,7 @@ data WarningFlag =
    | Opt_WarnGADTMonoLocalBinds                      -- Since 9.4
    | Opt_WarnTypeEqualityOutOfScope                  -- Since 9.4
    | Opt_WarnTypeEqualityRequiresOperators           -- Since 9.4
-   | Opt_WarnTermVariableCapture
+   | Opt_WarnTermVariableCapture                     -- Since 9.8
    deriving (Eq, Ord, Show, Enum)
 
 -- | Return the names of a WarningFlag


=====================================
compiler/ghc.cabal.in
=====================================
@@ -81,7 +81,7 @@ Library
                    containers >= 0.6.2.1 && < 0.7,
                    array      >= 0.1 && < 0.6,
                    filepath   >= 1   && < 1.5,
-                   template-haskell == 2.19.*,
+                   template-haskell == 2.20.*,
                    hpc        == 0.6.*,
                    transformers >= 0.5 && < 0.7,
                    exceptions == 0.10.*,


=====================================
docs/users_guide/9.6.1-notes.rst
=====================================
@@ -98,9 +98,6 @@ Compiler
 
 - The :ghc-flag:`-Wstar-is-type` warning is now enabled by default.
 
-- Added a new warning :ghc-flag:`-Wterm-variable-capture` that helps to make code compatible with 
-  the future extension ``RequiredTypeArguments``.
-
 - The ``-Wno-⟨wflag⟩``, ``-Werror=⟨wflag⟩`` and ``-Wwarn=⟨wflag⟩`` options are
   now defined systematically for all warning groups (for example,
   ``-Wno-default``, ``-Werror=unused-binds`` and ``-Wwarn=all`` are now


=====================================
docs/users_guide/9.8.1-notes.rst
=====================================
@@ -0,0 +1,13 @@
+.. _release-9-8-1:
+
+Version 9.8.1
+=============
+
+Language
+~~~~~~~~
+
+Compiler
+~~~~~~~~
+
+- Added a new warning :ghc-flag:`-Wterm-variable-capture` that helps to make code compatible with
+  the future extension ``RequiredTypeArguments``.
\ No newline at end of file


=====================================
docs/users_guide/exts/type_abstractions.rst
=====================================
@@ -4,7 +4,7 @@ Type abstractions
 .. extension:: TypeAbstractions
     :shortdesc: Enable type abstraction syntax in patterns and type variable binders.
 
-    :since: 9.6.1
+    :since: 9.8.1
 
     :status: Partially implemented
 


=====================================
docs/users_guide/release-notes.rst
=====================================
@@ -4,4 +4,4 @@ Release notes
 .. toctree::
    :maxdepth: 1
 
-   9.6.1-notes
+   9.8.1-notes


=====================================
docs/users_guide/using-warnings.rst
=====================================
@@ -2319,8 +2319,8 @@ of ``-W(no-)*``.
 .. ghc-flag:: -Wterm-variable-capture
     :shortdesc: warn when an implicitly quantified type variable captures a term's name
     :type: dynamic
-    
-    :since: 9.6.1
+
+    :since: 9.8.1
 
     In accordance with `GHC Proposal #281
     <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0281-visible-forall.rst>`__,


=====================================
hadrian/doc/flavours.md
=====================================
@@ -261,6 +261,10 @@ The supported transformers are listed below:
         <td>Just like `no_dynamic_ghc`, this transformer ensures statically-linked libraries
         </td>
     </tr>
+    <tr>
+        <td><code>native_bignum</code></td>
+        <td>Use the native <code>ghc-bignum</code> backend.</td>
+    </tr>
     <tr>
         <td><code>no_profiled_libs</code></td>
         <td>Disables building of libraries in profiled build ways.</td>
@@ -300,6 +304,18 @@ The supported transformers are listed below:
         <td>Enable Core, STG, and C-- linting in all compilation with the stage1
         compiler.</td>
     </tr>
+    <tr>
+        <td><code>haddock</code></td>
+        <td>Emit haddock documentation into the interface files via <code>-haddock</code>.</td>
+    </tr>
+    <tr>
+        <td><code>hi_core</code></td>
+        <td>Emit whole Core bindings into the interface files via <code>-fwrite-if-simplified-core</code>.</td>
+    </tr>
+    <tr>
+        <td><code>late_ccs</code></td>
+        <td>Enable <code>-fprof-late</code> in profiled libraries.</td>
+    </tr>
 </table>
 
 ### Static


=====================================
hadrian/src/Flavour.hs
=====================================
@@ -15,6 +15,7 @@ module Flavour
   , disableProfiledLibs
   , enableLinting
   , enableHaddock
+  , enableHiCore
   , useNativeBignum
   , omitPragmas
 
@@ -62,6 +63,7 @@ flavourTransformers = M.fromList
     , "debug_stage1_ghc" =: debugGhc stage0InTree
     , "lint"             =: enableLinting
     , "haddock"          =: enableHaddock
+    , "hi_core"          =: enableHiCore
     , "late_ccs"         =: enableLateCCS
     ]
   where (=:) = (,)
@@ -180,6 +182,13 @@ enableHaddock =
       [ arg "-haddock"
       ]
 
+-- | Build stage2 dependencies with options to emit Core into
+-- interface files which is sufficient to restart code generation.
+enableHiCore :: Flavour -> Flavour
+enableHiCore = addArgs
+    $ notStage0 ? builder (Ghc CompileHs)
+    ? pure ["-fwrite-if-simplified-core"]
+
 -- | Transform the input 'Flavour' so as to build with
 --   @-split-sections@ whenever appropriate.
 --   Note that this transformer doesn't do anything


=====================================
hadrian/src/Settings/Builders/Configure.hs
=====================================
@@ -10,12 +10,20 @@ configureBuilderArgs = do
     gmpPath    <- expr (gmpBuildPath stage)
     libffiPath <- expr (libffiBuildPath stage)
     mconcat [ builder (Configure gmpPath) ? do
+                targetArch <- getSetting TargetArch
                 targetPlatform <- getSetting TargetPlatform
                 buildPlatform <- getSetting BuildPlatform
-                pure [ "--enable-shared=no"
+                pure $ [ "--enable-shared=no"
                      , "--with-pic=yes"
                      , "--host=" ++ targetPlatform    -- GMP's host is our target
                      , "--build=" ++ buildPlatform ]
+                     -- Disable GMP's alloca usage on wasm32, it may
+                     -- cause stack overflow (#22602) due to the
+                     -- rather small 64KB default stack size. See
+                     -- https://gmplib.org/manual/Build-Options for
+                     -- more detailed explanation of this configure
+                     -- option.
+                     <> [ "--enable-alloca=malloc-reentrant" | targetArch == "wasm32" ]
 
             , builder (Configure libffiPath) ? do
                 top            <- expr topDirectory


=====================================
libraries/exceptions
=====================================
@@ -1 +1 @@
-Subproject commit 0f17c9819fd4216ac591bb0acc4aa71b2ae5a733
+Subproject commit a473e4fa1acdbcfc7cc96f84ae3f2cb38261e08b


=====================================
libraries/ghci/ghci.cabal.in
=====================================
@@ -79,7 +79,7 @@ library
         filepath         == 1.4.*,
         ghc-boot         == @ProjectVersionMunged@,
         ghc-heap         == @ProjectVersionMunged@,
-        template-haskell == 2.19.*,
+        template-haskell == 2.20.*,
         transformers     >= 0.5 && < 0.7
 
     if !os(windows)


=====================================
libraries/process
=====================================
@@ -1 +1 @@
-Subproject commit d295bcceb64e9f17f08999c6333aaabda4d5ee96
+Subproject commit d9a8e6e749d2d60422037f3ef4733d521f18a7fc


=====================================
libraries/template-haskell/template-haskell.cabal.in
=====================================
@@ -3,7 +3,7 @@
 -- template-haskell.cabal.
 
 name:           template-haskell
-version:        2.19.0.0
+version:        2.20.0.0
 -- NOTE: Don't forget to update ./changelog.md
 license:        BSD3
 license-file:   LICENSE


=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit 5558730e76923f2d5d7fbc8783ab1ecc25bfe15d
+Subproject commit 197bbcb18977593a06b048ad58abe71c6119799e


=====================================
testsuite/tests/ghci/scripts/T21110.stderr
=====================================
@@ -2,4 +2,4 @@
 <no location info>: warning: [GHC-42258] [-Wunused-packages]
     The following packages were specified via -package or -package-id flags,
     but were not needed for compilation:
-      - template-haskell-2.19.0.0 (exposed by flag -package template-haskell)
+      - template-haskell-2.20.0.0 (exposed by flag -package template-haskell)


=====================================
testsuite/tests/package/T4806a.stderr
=====================================
@@ -3,5 +3,5 @@ T4806a.hs:1:1: error:
     Could not load module ‘Data.Map’
     It is a member of the package ‘containers-0.6.6’
     which is unusable because the -ignore-package flag was used to ignore at least one of its dependencies:
-      deepseq-1.4.8.0 template-haskell-2.19.0.0
+      deepseq-1.4.8.0 template-haskell-2.20.0.0
     Use -v (or `:set -v` in ghci) to see a list of the files searched for.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0315bbc142b605bbdc7505ad214c9986a7f8a334...7ccebb000f5bba6d66c2c1b6706a0a5b42ae452e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0315bbc142b605bbdc7505ad214c9986a7f8a334...7ccebb000f5bba6d66c2c1b6706a0a5b42ae452e
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/20230119/659f0915/attachment-0001.html>


More information about the ghc-commits mailing list