[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: chore: Correct typo in the gitlab MR template

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Nov 22 00:04:54 UTC 2023



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


Commits:
e9d5ae41 by Owen Shepherd at 2023-11-21T18:32:23-05:00
chore: Correct typo in the gitlab MR template

[skip ci]

- - - - -
f158a8d0 by Rodrigo Mesquita at 2023-11-21T18:32:59-05:00
Improve error message when reading invalid `.target` files

A `.target` file generated by ghc-toolchain or by configure can become
invalid if the target representation (`Toolchain.Target`) is changed
while the files are not re-generated by calling `./configure` or
`ghc-toolchain` again. There is also the issue of hadrian caching the
dependencies on `.target` files, which makes parsing fail when reading
reading the cached value if the representation has been updated.

This patch provides a better error message in both situations, moving
away from a terrible `Prelude.read: no parse` error that you would get
otherwise.

Fixes #24199

- - - - -
955520c6 by Ben Gamari at 2023-11-21T18:33:34-05:00
users guide: Note that QuantifiedConstraints implies ExplicitForAll

Fixes #24025.

- - - - -
decfa95b by Owen Shepherd at 2023-11-21T19:04:43-05:00
fix: Change type signatures in NonEmpty export comments to reflect reality

This fixes several typos in the comments of
Data.List.NonEmpty export list items.

- - - - -
4ef82b1c by Samuel Thibault at 2023-11-21T19:04:47-05:00
Fix the platform string for GNU/Hurd

As commited in Cargo
https://github.com/haskell/cabal/pull/9434
there is confusion between "gnu" and "hurd". This got fixed in Cargo, we
need the converse in Hadrian.

Fixes #24180

- - - - -


5 changed files:

- .gitlab/merge_request_templates/Default.md
- docs/users_guide/exts/quantified_constraints.rst
- hadrian/src/Hadrian/Haskell/Cabal.hs
- hadrian/src/Hadrian/Oracles/TextFile.hs
- libraries/base/src/Data/List/NonEmpty.hs


Changes:

=====================================
.gitlab/merge_request_templates/Default.md
=====================================
@@ -30,7 +30,7 @@ label can be applied to perform additional validation checks if your MR affects
 unusual configuration.
 
 Once your change is ready please remove the `WIP:` tag and wait for review. If
-no one has offerred review in a few days then please leave a comment mentioning
+no one has offered a review in a few days then please leave a comment mentioning
 @triagers and apply the ~"Blocked on Review" label.
 
 [notes]: https://gitlab.haskell.org/ghc/ghc/wikis/commentary/coding-style#comments-in-the-source-code


=====================================
docs/users_guide/exts/quantified_constraints.rst
=====================================
@@ -6,6 +6,7 @@ Quantified constraints
 .. extension:: QuantifiedConstraints
     :shortdesc: Allow ``forall`` quantifiers in constraints.
 
+    :implies: :extension:`ExplicitForAll`
     :since: 8.6.1
 
     Allow constraints to quantify over types.


=====================================
hadrian/src/Hadrian/Haskell/Cabal.hs
=====================================
@@ -75,5 +75,6 @@ cabalOsString :: String -> String
 cabalOsString "mingw32"  = "windows"
 cabalOsString "darwin"   = "osx"
 cabalOsString "solaris2" = "solaris"
+cabalOsString "gnu"      = "hurd"
 cabalOsString other      = other
 


=====================================
hadrian/src/Hadrian/Oracles/TextFile.hs
=====================================
@@ -163,14 +163,23 @@ textFileOracle = do
         putVerbose $ "| TargetFile oracle: reading " ++ quote file ++ "..."
         mtarget <- readMaybe <$> readFile' file
         case mtarget of
-          Nothing -> error $ "Failed to read a Toolchain.Target from " ++ quote file
+          Nothing -> error $ unlines ["Error parsing a Toolchain.Target from " ++ quote file,
+                                      "Perhaps the `.target` file is out of date.",
+                                      "Try re-running `./configure`."
+                                     ]
+
           Just target -> return (target :: Toolchain.Target)
     void $ addOracleCache $ \(TargetFile file) -> tf file
 
 -- Orphan instances for (ShakeValue Toolchain.Target)
 instance Binary Toolchain.Target where
-  put = put  . show
-  get = read <$> get
+  put = put . show
+  get = fromMaybe (error $ unlines ["Error parsing a toolchain `.target` file from its binary representation in hadrian.",
+                                    "This is likely caused by a stale hadrian/shake cache",
+                                    "which has saved an old `.target` file that can't be parsed",
+                                    "into a more recent `Toolchain.Target`. It is recommended to reset",
+                                    "by running `./hadrian/build clean`."
+                                   ]) . readMaybe <$> get
 
 instance Hashable Toolchain.Target where
   hashWithSalt s = hashWithSalt s . show


=====================================
libraries/base/src/Data/List/NonEmpty.hs
=====================================
@@ -44,11 +44,11 @@ module Data.List.NonEmpty (
    , (<|), cons  -- :: a -> NonEmpty a -> NonEmpty a
    , uncons      -- :: NonEmpty a -> (a, Maybe (NonEmpty a))
    , unfoldr     -- :: (a -> (b, Maybe a)) -> a -> NonEmpty b
-   , sort        -- :: NonEmpty a -> NonEmpty a
+   , sort        -- :: Ord a => NonEmpty a -> NonEmpty a
    , reverse     -- :: NonEmpty a -> NonEmpty a
-   , inits       -- :: Foldable f => f a -> NonEmpty a
+   , inits       -- :: Foldable f => f a -> NonEmpty [a]
    , inits1      -- :: NonEmpty a -> NonEmpty (NonEmpty a)
-   , tails       -- :: Foldable f => f a -> NonEmpty a
+   , tails       -- :: Foldable f => f a -> NonEmpty [a]
    , tails1      -- :: NonEmpty a -> NonEmpty (NonEmpty a)
    , append      -- :: NonEmpty a -> NonEmpty a -> NonEmpty a
    , appendList  -- :: NonEmpty a -> [a] -> NonEmpty a
@@ -57,31 +57,31 @@ module Data.List.NonEmpty (
    , iterate     -- :: (a -> a) -> a -> NonEmpty a
    , repeat      -- :: a -> NonEmpty a
    , cycle       -- :: NonEmpty a -> NonEmpty a
-   , unfold      -- :: (a -> (b, Maybe a) -> a -> NonEmpty b
+   , unfold      -- :: (a -> (b, Maybe a)) -> a -> NonEmpty b
    , insert      -- :: (Foldable f, Ord a) => a -> f a -> NonEmpty a
    , some1       -- :: Alternative f => f a -> f (NonEmpty a)
    -- * Extracting sublists
    , take        -- :: Int -> NonEmpty a -> [a]
    , drop        -- :: Int -> NonEmpty a -> [a]
    , splitAt     -- :: Int -> NonEmpty a -> ([a], [a])
-   , takeWhile   -- :: Int -> NonEmpty a -> [a]
-   , dropWhile   -- :: Int -> NonEmpty a -> [a]
-   , span        -- :: Int -> NonEmpty a -> ([a],[a])
-   , break       -- :: Int -> NonEmpty a -> ([a],[a])
+   , takeWhile   -- :: (a -> Bool) -> NonEmpty a -> [a]
+   , dropWhile   -- :: (a -> Bool) -> NonEmpty a -> [a]
+   , span        -- :: (a -> Bool) -> NonEmpty a -> ([a], [a])
+   , break       -- :: (a -> Bool) -> NonEmpty a -> ([a], [a])
    , filter      -- :: (a -> Bool) -> NonEmpty a -> [a]
    , partition   -- :: (a -> Bool) -> NonEmpty a -> ([a],[a])
-   , group       -- :: Foldable f => Eq a => f a -> [NonEmpty a]
+   , group       -- :: (Foldable f, Eq a) => f a -> [NonEmpty a]
    , groupBy     -- :: Foldable f => (a -> a -> Bool) -> f a -> [NonEmpty a]
    , groupWith     -- :: (Foldable f, Eq b) => (a -> b) -> f a -> [NonEmpty a]
-   , groupAllWith  -- :: (Foldable f, Ord b) => (a -> b) -> f a -> [NonEmpty a]
+   , groupAllWith  -- :: Ord b => (a -> b) -> [a] -> [NonEmpty a]
    , group1      -- :: Eq a => NonEmpty a -> NonEmpty (NonEmpty a)
    , groupBy1    -- :: (a -> a -> Bool) -> NonEmpty a -> NonEmpty (NonEmpty a)
-   , groupWith1     -- :: (Foldable f, Eq b) => (a -> b) -> f a -> NonEmpty (NonEmpty a)
-   , groupAllWith1  -- :: (Foldable f, Ord b) => (a -> b) -> f a -> NonEmpty (NonEmpty a)
-   , permutations
-   , permutations1
+   , groupWith1     -- :: Eq b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)
+   , groupAllWith1  -- :: Ord b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)
+   , permutations   -- :: [a] -> NonEmpty [a]
+   , permutations1  -- :: NonEmpty a -> NonEmpty (NonEmpty a)
    -- * Sublist predicates
-   , isPrefixOf  -- :: Foldable f => f a -> NonEmpty a -> Bool
+   , isPrefixOf  -- :: Eq a => [a] -> NonEmpty a -> Bool
    -- * \"Set\" operations
    , nub         -- :: Eq a => NonEmpty a -> NonEmpty a
    , nubBy       -- :: (a -> a -> Bool) -> NonEmpty a -> NonEmpty a
@@ -90,12 +90,12 @@ module Data.List.NonEmpty (
    -- * Zipping and unzipping streams
    , zip         -- :: NonEmpty a -> NonEmpty b -> NonEmpty (a,b)
    , zipWith     -- :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c
-   , unzip       -- :: NonEmpty (a, b) -> (NonEmpty a, NonEmpty b)
+   , unzip       -- :: Functor f => f (a,b) -> (f a, f b)
    -- * Converting to and from a list
    , fromList    -- :: [a] -> NonEmpty a
    , toList      -- :: NonEmpty a -> [a]
    , nonEmpty    -- :: [a] -> Maybe (NonEmpty a)
-   , xor         -- :: NonEmpty a -> Bool
+   , xor         -- :: NonEmpty Bool -> Bool
    ) where
 
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/58857f250e9c55f0eb1434850e70b4b456d6348d...4ef82b1c9f5a86d8aa5b5e2bc22e4d19e47fee48

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/58857f250e9c55f0eb1434850e70b4b456d6348d...4ef82b1c9f5a86d8aa5b5e2bc22e4d19e47fee48
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/20231121/88387359/attachment-0001.html>


More information about the ghc-commits mailing list