[Git][ghc/ghc][wip/int-index/type-abs-flag] 3 commits: Remove RTS hack for configuring

Vladislav Zavialov (@int-index) gitlab at gitlab.haskell.org
Tue Jan 10 07:50:37 UTC 2023



Vladislav Zavialov pushed to branch wip/int-index/type-abs-flag at Glasgow Haskell Compiler / GHC


Commits:
5d65773e by John Ericson at 2023-01-09T20:39:27-05:00
Remove RTS hack for configuring

See the brand new Note [Undefined symbols in the RTS] for additional
details.

- - - - -
e3fff751 by Sebastian Graf at 2023-01-09T20:40:02-05:00
Handle shadowing in DmdAnal (#22718)

Previously, when we had a shadowing situation like
```hs
f x = ... -- demand signature <1L><1L>

main = ... \f -> f 1 ...
```
we'd happily use the shadowed demand signature at the call site inside the
lambda. Of course, that's wrong and solution is simply to remove the demand
signature from the `AnalEnv` when we enter the lambda.
This patch does so for all binding constructs Core.

In #22718 the issue was caused by LetUp not shadowing away the existing demand
signature for the let binder in the let body. The resulting absent error is
fickle to reproduce; hence no reproduction test case. #17478 would help.

Fixes #22718.

It appears that TcPlugin_Rewrite regresses by ~40% on Darwin. It is likely that
DmdAnal was exploiting ill-scoped analysis results.

Metric increase ['bytes allocated'] (test_env=x86_64-darwin-validate):
    TcPlugin_Rewrite

- - - - -
449b89e4 by Vladislav Zavialov at 2023-01-10T10:50:09+03:00
Introduce the TypeAbstractions language flag

GHC Proposals #448 "Modern scoped type variables"
and #425 "Invisible binders in type declarations"
introduce a new language extension flag: TypeAbstractions.

Part of the functionality guarded by this flag has already been
implemented, namely type abstractions in constructor patterns, but it
was guarded by a combination of TypeApplications and ScopedTypeVariables
instead of a dedicated language extension flag.

This patch does the following:

* introduces a new language extension flag TypeAbstractions
* requires TypeAbstractions for @a-syntax in constructor patterns
  instead of TypeApplications and ScopedTypeVariables
* creates a User's Guide page for TypeAbstractions and
  moves the "Type Applications in Patterns" section there

To avoid a breaking change, the new flag is implied by
ScopedTypeVariables and is retroactively added to GHC2021.

- - - - -


22 changed files:

- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Rename/Pat.hs
- docs/users_guide/exts/gadt.rst
- + docs/users_guide/exts/type_abstractions.rst
- docs/users_guide/exts/type_applications.rst
- docs/users_guide/exts/types.rst
- hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
- hadrian/src/Rules/Register.hs
- libraries/ghc-boot-th/GHC/LanguageExtensions/Type.hs
- rts/rts.cabal.in
- testsuite/tests/driver/T4437.hs
- testsuite/tests/showIface/DocsInHiFile1.stdout
- testsuite/tests/showIface/DocsInHiFileTH.stdout
- testsuite/tests/showIface/HaddockIssue849.stdout
- testsuite/tests/showIface/HaddockOpts.stdout
- testsuite/tests/showIface/MagicHashInHaddocks.stdout
- testsuite/tests/showIface/NoExportList.stdout
- testsuite/tests/showIface/PragmaDocs.stdout
- testsuite/tests/showIface/ReExports.stdout
- testsuite/tests/typecheck/should_compile/T20443a.hs
- testsuite/tests/typecheck/should_fail/T19109.stderr


Changes:

=====================================
compiler/GHC/Core/Opt/DmdAnal.hs
=====================================
@@ -333,7 +333,8 @@ dmdAnalBindLetUp :: TopLevelFlag
                  -> WithDmdType (DmdResult CoreBind a)
 dmdAnalBindLetUp top_lvl env id rhs anal_body = WithDmdType final_ty (R (NonRec id' rhs') (body'))
   where
-    WithDmdType body_ty body'   = anal_body env
+    WithDmdType body_ty body'   = anal_body (addInScopeAnalEnv env id)
+    -- See Note [Bringing a new variable into scope]
     WithDmdType body_ty' id_dmd = findBndrDmd env body_ty id
     -- See Note [Finalising boxity for demand signatures]
 
@@ -473,7 +474,8 @@ dmdAnal' env dmd (App fun arg)
 dmdAnal' env dmd (Lam var body)
   | isTyVar var
   = let
-        WithDmdType body_ty body' = dmdAnal env dmd body
+        WithDmdType body_ty body' = dmdAnal (addInScopeAnalEnv env var) dmd body
+        -- See Note [Bringing a new variable into scope]
     in
     WithDmdType body_ty (Lam var body')
 
@@ -481,7 +483,8 @@ dmdAnal' env dmd (Lam var body)
   = let (n, body_dmd)    = peelCallDmd dmd
           -- body_dmd: a demand to analyze the body
 
-        WithDmdType body_ty body' = dmdAnal env body_dmd body
+        WithDmdType body_ty body' = dmdAnal (addInScopeAnalEnv env var) body_dmd body
+        -- See Note [Bringing a new variable into scope]
         WithDmdType lam_ty var'   = annotateLamIdBndr env body_ty var
         new_dmd_type = multDmdType n lam_ty
     in
@@ -493,7 +496,9 @@ dmdAnal' env dmd (Case scrut case_bndr ty [Alt alt_con bndrs rhs])
   -- can consider its field demands when analysing the scrutinee.
   | want_precise_field_dmds alt_con
   = let
-        WithDmdType rhs_ty rhs'           = dmdAnal env dmd rhs
+        rhs_env = addInScopeAnalEnvs env (case_bndr:bndrs)
+        -- See Note [Bringing a new variable into scope]
+        WithDmdType rhs_ty rhs'           = dmdAnal rhs_env dmd rhs
         WithDmdType alt_ty1 fld_dmds      = findBndrsDmds env rhs_ty bndrs
         WithDmdType alt_ty2 case_bndr_dmd = findBndrDmd env alt_ty1 case_bndr
         !case_bndr'                       = setIdDemandInfo case_bndr case_bndr_dmd
@@ -629,7 +634,9 @@ dmdAnalSumAlts env dmd case_bndr (alt:alts)
 
 dmdAnalSumAlt :: AnalEnv -> SubDemand -> Id -> CoreAlt -> WithDmdType CoreAlt
 dmdAnalSumAlt env dmd case_bndr (Alt con bndrs rhs)
-  | WithDmdType rhs_ty rhs' <- dmdAnal env dmd rhs
+  | let rhs_env = addInScopeAnalEnvs env (case_bndr:bndrs)
+    -- See Note [Bringing a new variable into scope]
+  , WithDmdType rhs_ty rhs' <- dmdAnal rhs_env dmd rhs
   , WithDmdType alt_ty dmds <- findBndrsDmds env rhs_ty bndrs
   , let (_ :* case_bndr_sd) = findIdDemand alt_ty case_bndr
         -- See Note [Demand on case-alternative binders]
@@ -2399,7 +2406,7 @@ enterDFun bind env
 emptySigEnv :: SigEnv
 emptySigEnv = emptyVarEnv
 
--- | Extend an environment with the strictness IDs attached to the id
+-- | Extend an environment with the strictness sigs attached to the Ids
 extendAnalEnvs :: TopLevelFlag -> AnalEnv -> [Id] -> AnalEnv
 extendAnalEnvs top_lvl env vars
   = env { ae_sigs = extendSigEnvs top_lvl (ae_sigs env) vars }
@@ -2418,6 +2425,12 @@ extendSigEnv top_lvl sigs var sig = extendVarEnv sigs var (sig, top_lvl)
 lookupSigEnv :: AnalEnv -> Id -> Maybe (DmdSig, TopLevelFlag)
 lookupSigEnv env id = lookupVarEnv (ae_sigs env) id
 
+addInScopeAnalEnv :: AnalEnv -> Var -> AnalEnv
+addInScopeAnalEnv env id = env { ae_sigs = delVarEnv (ae_sigs env) id }
+
+addInScopeAnalEnvs :: AnalEnv -> [Var] -> AnalEnv
+addInScopeAnalEnvs env ids = env { ae_sigs = delVarEnvList (ae_sigs env) ids }
+
 nonVirgin :: AnalEnv -> AnalEnv
 nonVirgin env = env { ae_virgin = False }
 
@@ -2456,7 +2469,18 @@ findBndrDmd env dmd_ty id
 
     fam_envs = ae_fam_envs env
 
-{- Note [Making dictionary parameters strict]
+{- Note [Bringing a new variable into scope]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Consider
+   f x = blah
+   g = ...(\f. ...f...)...
+
+In the body of the '\f', any occurrence of `f` refers to the lambda-bound `f`,
+not the top-level `f` (which will be in `ae_sigs`).  So it's very important
+to delete `f` from `ae_sigs` when we pass a lambda/case/let-up binding of `f`.
+Otherwise chaos results (#22718).
+
+Note [Making dictionary parameters strict]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 The Opt_DictsStrict flag makes GHC use call-by-value for dictionaries.  Why?
 


=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -1412,6 +1412,7 @@ languageExtensions (Just GHC2021)
        LangExt.PostfixOperators,
        LangExt.RankNTypes,
        LangExt.ScopedTypeVariables,
+       LangExt.TypeAbstractions,     -- implied by ScopedTypeVariables according to GHC Proposal #448 "Modern Scoped Type Variables"
        LangExt.StandaloneDeriving,
        LangExt.StandaloneKindSignatures,
        LangExt.TupleSections,
@@ -3765,6 +3766,7 @@ xFlagsDeps = [
   flagSpec "TraditionalRecordSyntax"          LangExt.TraditionalRecordSyntax,
   flagSpec "TransformListComp"                LangExt.TransformListComp,
   flagSpec "TupleSections"                    LangExt.TupleSections,
+  flagSpec "TypeAbstractions"                 LangExt.TypeAbstractions,
   flagSpec "TypeApplications"                 LangExt.TypeApplications,
   flagSpec "TypeData"                         LangExt.TypeData,
   depFlagSpec' "TypeInType"                   LangExt.TypeInType
@@ -3901,6 +3903,9 @@ impliedXFlags
     , (LangExt.MultiParamTypeClasses,     turnOn, LangExt.ConstrainedClassMethods)  -- c.f. #7854
     , (LangExt.TypeFamilyDependencies,    turnOn, LangExt.TypeFamilies)
 
+    -- In accordance with GHC Proposal #448 "Modern Scoped Type Variables"
+    , (LangExt.ScopedTypeVariables,       turnOn, LangExt.TypeAbstractions)
+
     , (LangExt.RebindableSyntax, turnOff, LangExt.ImplicitPrelude)      -- NB: turn off!
 
     , (LangExt.DerivingVia, turnOn, LangExt.DerivingStrategies)


=====================================
compiler/GHC/Rename/Pat.hs
=====================================
@@ -640,16 +640,14 @@ rnConPatAndThen mk con (PrefixCon tyargs pats)
   where
     check_lang_exts :: RnM ()
     check_lang_exts = do
-      scoped_tyvars <- xoptM LangExt.ScopedTypeVariables
-      type_app      <- xoptM LangExt.TypeApplications
-      unless (scoped_tyvars && type_app) $
+      type_abs <- xoptM LangExt.TypeAbstractions
+      unless type_abs $
         case listToMaybe tyargs of
           Nothing -> pure ()
           Just tyarg -> addErr $ mkTcRnUnknownMessage $ mkPlainError noHints $
             hang (text "Illegal visible type application in a pattern:"
                     <+> quotes (ppr tyarg))
-               2 (text "Both ScopedTypeVariables and TypeApplications are"
-                    <+> text "required to use this feature")
+               2 (text "Perhaps you intended to use TypeAbstractions")
     rnConPatTyArg (HsConPatTyArg at t) = do
       t' <- liftCpsWithCont $ rnHsPatSigTypeBindingVars HsTypeCtx t
       return (HsConPatTyArg at t')


=====================================
docs/users_guide/exts/gadt.rst
=====================================
@@ -227,7 +227,7 @@ also sets :extension:`GADTSyntax` and :extension:`MonoLocalBinds`.
          case f of
            (_ :: F (Maybe z) (Maybe z)) -> Nothing @z
 
-   Another way is to use :ref:`type-applications-in-patterns` instead of a
+   Another way is to use :ref:`type-abstractions-in-patterns` instead of a
    pattern type signature: ::
 
        g4 :: F a a -> a


=====================================
docs/users_guide/exts/type_abstractions.rst
=====================================
@@ -0,0 +1,95 @@
+Type abstractions
+=================
+
+.. extension:: TypeAbstractions
+    :shortdesc: Enable type abstraction syntax in patterns and type variable binders.
+
+    :since: 9.6.1
+
+    :status: Partially implemented
+
+    Allow the use of type abstraction syntax.
+
+The :extension:`TypeAbstractions` extension provides a way to explicitly bind
+scoped type or kind variables using the ``@a`` syntax. The feature is only
+partially implemented, and this text covers only the implemented parts, whereas
+the full specification can be found in GHC Proposals `#448 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0448-type-variable-scoping.rst>`__
+and `#425 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0425-decl-invis-binders.rst>`__.
+
+
+.. _type-abstractions-in-patterns:
+
+Type Abstractions in Patterns
+-----------------------------
+
+The type abstraction syntax can be used in patterns that match a data
+constructor. The syntax can't be used with record patterns or infix patterns.
+This is useful in particular to bind existential type variables associated with
+a GADT data constructor as in the following example::
+
+    {-# LANGUAGE AllowAmbiguousTypes #-}
+    {-# LANGUAGE GADTs #-}
+    {-# LANGUAGE RankNTypes #-}
+    {-# LANGUAGE TypeApplications #-}
+    import Data.Proxy
+
+    data Foo where
+      Foo :: forall a. (Show a, Num a) => Foo
+
+    test :: Foo -> String
+    test x = case x of
+      Foo @t -> show @t 0
+
+    main :: IO ()
+    main = print $ test (Foo @Float)
+
+In this example, the case in ``test``` is binding an existential variable introduced
+by ``Foo`` that otherwise could not be named and used.
+
+It's possible to bind variables to any part of the type arguments to a constructor;
+there is no need for them to be existential. In addition, it's possible to "match" against
+part of the type argument using type constructors.
+
+For a somewhat-contrived example::
+
+    foo :: (Num a) => Maybe [a] -> String
+    foo (Nothing @[t]) = show (0 :: t)
+    foo (Just @[t] xs) = show (sum xs :: t)
+
+Here, we're binding the type variable t to be the type of the elements of the list type
+which is itself the argument to Maybe.
+
+The order of the type arguments specified by the type applications in a pattern is the same
+as that for an expression: either the order as given by the user in an explicit ``forall`` in the
+definition of the data constructor, or if that is not present, the order in which the type
+variables appear in its type signature from left to right.
+
+For example if we have the following declaration in GADT syntax::
+
+    data Foo :: * -> * where
+      A :: forall s t. [(t,s)] -> Foo (t,s)
+      B :: (t,s) -> Foo (t,s)
+
+Then the type arguments to ``A`` will match first ``s`` and then ``t``, while the type arguments
+to ``B`` will match first ``t`` and then ``s``.
+
+Type arguments appearing in patterns can influence the inferred type of a definition::
+
+    foo (Nothing @Int) = 0
+    foo (Just x) = x
+
+will have inferred type::
+
+    foo :: Maybe Int -> Int
+
+which is more restricted than what it would be without the application::
+
+    foo :: Num a => Maybe a -> a
+
+For more information and detail regarding type applications in patterns, see the paper
+`Type variables in patterns <https://arxiv.org/pdf/1806.03476>`__ by Eisenberg, Breitner
+and Peyton Jones. Relative to that paper, the implementation in GHC for now at least makes one
+additional conservative restriction, that type variables occurring in patterns must not
+already be in scope, and so are always new variables that only bind whatever type is
+matched, rather than ever referring to a variable from an outer scope. Type wildcards
+``_`` may be used in any place where no new variable needs binding.


=====================================
docs/users_guide/exts/type_applications.rst
=====================================
@@ -4,7 +4,7 @@ Visible type application
 ========================
 
 .. extension:: TypeApplications
-    :shortdesc: Enable type application syntax in terms, patterns and types.
+    :shortdesc: Enable type application syntax in terms and types.
 
     :since: 8.0.1
 
@@ -261,81 +261,4 @@ of equality over types. For example, given the following definitions: ::
   app2 g x = g x
 
 GHC will deem all of ``app1 id1``, ``app1 id2``, ``app2 id1``, and ``app2 id2``
-to be well typed.
-
-.. _type-applications-in-patterns:
-
-Type Applications in Patterns
------------------------------
-
-The type application syntax can be used in patterns that match a data
-constructor. The syntax can't be used with record patterns or infix patterns.
-This is useful in particular to bind existential type variables associated with
-a GADT data constructor as in the following example::
-
-    {-# LANGUAGE AllowAmbiguousTypes #-}
-    {-# LANGUAGE GADTs #-}
-    {-# LANGUAGE RankNTypes #-}
-    {-# LANGUAGE TypeApplications #-}
-    import Data.Proxy
-
-    data Foo where
-      Foo :: forall a. (Show a, Num a) => Foo
-
-    test :: Foo -> String
-    test x = case x of
-      Foo @t -> show @t 0
-
-    main :: IO ()
-    main = print $ test (Foo @Float)
-
-In this example, the case in ``test``` is binding an existential variable introduced
-by ``Foo`` that otherwise could not be named and used.
-
-It's possible to bind variables to any part of the type arguments to a constructor;
-there is no need for them to be existential. In addition, it's possible to "match" against
-part of the type argument using type constructors.
-
-For a somewhat-contrived example::
-
-    foo :: (Num a) => Maybe [a] -> String
-    foo (Nothing @[t]) = show (0 :: t)
-    foo (Just @[t] xs) = show (sum xs :: t)
-
-Here, we're binding the type variable t to be the type of the elements of the list type
-which is itself the argument to Maybe.
-
-The order of the type arguments specified by the type applications in a pattern is the same
-as that for an expression: either the order as given by the user in an explicit ``forall`` in the
-definition of the data constructor, or if that is not present, the order in which the type
-variables appear in its type signature from left to right.
-
-For example if we have the following declaration in GADT syntax::
-
-    data Foo :: * -> * where
-      A :: forall s t. [(t,s)] -> Foo (t,s)
-      B :: (t,s) -> Foo (t,s)
-
-Then the type arguments to ``A`` will match first ``s`` and then ``t``, while the type arguments
-to ``B`` will match first ``t`` and then ``s``.
-
-Type arguments appearing in patterns can influence the inferred type of a definition::
-
-    foo (Nothing @Int) = 0
-    foo (Just x) = x
-
-will have inferred type::
-
-    foo :: Maybe Int -> Int
-
-which is more restricted than what it would be without the application::
-
-    foo :: Num a => Maybe a -> a
-
-For more information and detail regarding type applications in patterns, see the paper
-`Type variables in patterns <https://arxiv.org/pdf/1806.03476>`__ by Eisenberg, Breitner
-and Peyton Jones. Relative to that paper, the implementation in GHC for now at least makes one
-additional conservative restriction, that type variables occurring in patterns must not
-already be in scope, and so are always new variables that only bind whatever type is
-matched, rather than ever referring to a variable from an outer scope. Type wildcards
-``_`` may be used in any place where no new variable needs binding.
+to be well typed.
\ No newline at end of file


=====================================
docs/users_guide/exts/types.rst
=====================================
@@ -21,6 +21,7 @@ Types
     representation_polymorphism
     type_literals
     type_applications
+    type_abstractions
     rank_polymorphism
     impredicative_types
     linear_types


=====================================
hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
=====================================
@@ -148,6 +148,8 @@ configurePackage context at Context {..} = do
     -- Figure out what hooks we need.
     hooks <- case C.buildType (C.flattenPackageDescription gpd) of
         C.Configure -> pure C.autoconfUserHooks
+        C.Simple -> pure C.simpleUserHooks
+        C.Make -> fail "build-type: Make is not supported"
         -- The 'time' package has a 'C.Custom' Setup.hs, but it's actually
         -- 'C.Configure' plus a @./Setup test@ hook. However, Cabal is also
         -- 'C.Custom', but doesn't have a configure script.
@@ -155,12 +157,6 @@ configurePackage context at Context {..} = do
             configureExists <- doesFileExist $
                 replaceFileName (pkgCabalFile package) "configure"
             pure $ if configureExists then C.autoconfUserHooks else C.simpleUserHooks
-        -- Not quite right, but good enough for us:
-        _ | package == rts ->
-            -- Don't try to do post configuration validation for 'rts'. This
-            -- will simply not work, due to the @ld-options@ and @Stg.h at .
-            pure $ C.simpleUserHooks { C.postConf = \_ _ _ _ -> return () }
-          | otherwise -> pure C.simpleUserHooks
 
     -- Compute the list of flags, and the Cabal configuration arguments
     flavourArgs <- args <$> flavour


=====================================
hadrian/src/Rules/Register.hs
=====================================
@@ -45,6 +45,14 @@ configurePackageRules = do
           isGmp <- (== "gmp") <$> interpretInContext ctx getBignumBackend
           when isGmp $
             need [buildP -/- "include/ghc-gmp.h"]
+        when (pkg == rts) $ do
+          -- Rts.h is a header listed in the cabal file, and configuring
+          -- therefore wants to ensure that the header "works" post-configure.
+          -- But it (transitively) includes these, so we must ensure they exist
+          -- for that check to work.
+          need [ buildP -/- "include/ghcautoconf.h"
+               , buildP -/- "include/ghcplatform.h"
+               ]
         Cabal.configurePackage ctx
 
     root -/- "**/autogen/cabal_macros.h" %> \out -> do


=====================================
libraries/ghc-boot-th/GHC/LanguageExtensions/Type.hs
=====================================
@@ -151,6 +151,7 @@ data Extension
    | FieldSelectors
    | OverloadedRecordDot
    | OverloadedRecordUpdate
+   | TypeAbstractions
    deriving (Eq, Enum, Show, Generic, Bounded)
 -- 'Ord' and 'Bounded' are provided for GHC API users (see discussions
 -- in https://gitlab.haskell.org/ghc/ghc/merge_requests/2707 and


=====================================
rts/rts.cabal.in
=====================================
@@ -275,6 +275,8 @@ library
                         stg/SMP.h
                         stg/Ticky.h
                         stg/Types.h
+
+      -- See Note [Undefined symbols in the RTS]
       if flag(64bit)
         if flag(leading-underscore)
           ld-options:
@@ -474,6 +476,8 @@ library
         ld-options: "-Wl,-search_paths_first"
                     -- See Note [fd_set_overflow]
                     "-Wl,-U,___darwin_check_fd_set_overflow"
+                    -- See Note [Undefined symbols in the RTS]
+                    "-Wl,-undefined,dynamic_lookup"
         if !arch(x86_64) && !arch(aarch64)
            ld-options: -read_only_relocs warning
 
@@ -714,3 +718,35 @@ library
 --     , https://github.com/sitsofe/fio/commit/b6a1e63a1ff607692a3caf3c2db2c3d575ba2320
 
 -- The issue was originally reported in #19950
+
+
+-- Note [Undefined symbols in the RTS]
+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-- The RTS is built with a number of `-u` flags. This is to handle cyclic
+-- dependencies between the RTS and other libraries which we normally think of as
+-- downstream from the RTS. "Regular" dependencies from usages in those libraries
+-- to definitions in the RTS are handled normally. "Reverse" dependencies from
+-- usages in the RTS to definitions in those libraries get the `-u` flag in the
+-- RTS.
+--
+-- The symbols are specified literally, but follow C ABI conventions (as all 3 of
+-- C, C--, and Haskell do currently). Thus, we have to be careful to include a
+-- leading underscore or not based on those conventions for the given platform in
+-- question.
+--
+-- A tricky part is that different linkers have different policies regarding
+-- undefined symbols (not defined in the current binary, or found in a shared
+-- library that could be loaded at run time). GNU Binutils' linker is fine with
+-- undefined symbols by default, but Apple's "cctools" linker is not. To appease
+-- that linker we either need to do a blanket `-undefined dynamic_lookup` or
+-- whitelist each such symbol with an additional `-U` (see the man page for more
+-- details).
+--
+-- GHC already does `-undefined dynamic_lookup`, so we just do that for now, but
+-- we might try to get more precise with `-U` in the future.
+--
+-- Note that the RTS also `-u`s some atomics symbols that *are* defined --- and
+-- defined within the RTS! It is not immediately clear why this is needed. This
+-- dates back to c06e3f46d24ef69f3a3d794f5f604cb8c2a40cbc which mentions a build
+-- failure that it was suggested that this fix, but the precise reasoning is not
+-- explained.


=====================================
testsuite/tests/driver/T4437.hs
=====================================
@@ -37,7 +37,7 @@ check title expected got
 -- See Note [Adding a language extension] in compiler/GHC/Driver/Session.hs.
 expectedGhcOnlyExtensions :: [String]
 expectedGhcOnlyExtensions =
-    [
+    [ "TypeAbstractions"
     ]
 
 expectedCabalOnlyExtensions :: [String]


=====================================
testsuite/tests/showIface/DocsInHiFile1.stdout
=====================================
@@ -143,5 +143,6 @@ docs:
          ImportQualifiedPost
          StandaloneKindSignatures
          FieldSelectors
+         TypeAbstractions
 extensible fields:
 


=====================================
testsuite/tests/showIface/DocsInHiFileTH.stdout
=====================================
@@ -286,5 +286,6 @@ docs:
          ImportQualifiedPost
          StandaloneKindSignatures
          FieldSelectors
+         TypeAbstractions
 extensible fields:
 


=====================================
testsuite/tests/showIface/HaddockIssue849.stdout
=====================================
@@ -66,5 +66,6 @@ docs:
          ImportQualifiedPost
          StandaloneKindSignatures
          FieldSelectors
+         TypeAbstractions
 extensible fields:
 


=====================================
testsuite/tests/showIface/HaddockOpts.stdout
=====================================
@@ -58,5 +58,6 @@ docs:
          ImportQualifiedPost
          StandaloneKindSignatures
          FieldSelectors
+         TypeAbstractions
 extensible fields:
 


=====================================
testsuite/tests/showIface/MagicHashInHaddocks.stdout
=====================================
@@ -68,5 +68,6 @@ docs:
          ImportQualifiedPost
          StandaloneKindSignatures
          FieldSelectors
+         TypeAbstractions
 extensible fields:
 


=====================================
testsuite/tests/showIface/NoExportList.stdout
=====================================
@@ -94,5 +94,6 @@ docs:
          ImportQualifiedPost
          StandaloneKindSignatures
          FieldSelectors
+         TypeAbstractions
 extensible fields:
 


=====================================
testsuite/tests/showIface/PragmaDocs.stdout
=====================================
@@ -68,5 +68,6 @@ docs:
          ImportQualifiedPost
          StandaloneKindSignatures
          FieldSelectors
+         TypeAbstractions
 extensible fields:
 


=====================================
testsuite/tests/showIface/ReExports.stdout
=====================================
@@ -65,5 +65,6 @@ docs:
          ImportQualifiedPost
          StandaloneKindSignatures
          FieldSelectors
+         TypeAbstractions
 extensible fields:
 


=====================================
testsuite/tests/typecheck/should_compile/T20443a.hs
=====================================
@@ -10,4 +10,4 @@ a :: () -> Proxy Int
 a () = Proxy @Int
 
 b :: Proxy Int -> ()
-b (Proxy @Int) = ()       -- This should compile, but doesn't
+b (Proxy @Int) = ()


=====================================
testsuite/tests/typecheck/should_fail/T19109.stderr
=====================================
@@ -1,4 +1,4 @@
 
 T19109.hs:6:4: error:
     Illegal visible type application in a pattern: ‘@Int’
-      Both ScopedTypeVariables and TypeApplications are required to use this feature
+      Perhaps you intended to use TypeAbstractions



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cda7ebdb2589abc76bc220c1fa22999de680022c...449b89e4529416efc24cefdd5c7f12be4a60d688

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cda7ebdb2589abc76bc220c1fa22999de680022c...449b89e4529416efc24cefdd5c7f12be4a60d688
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/20230110/d667394a/attachment-0001.html>


More information about the ghc-commits mailing list