Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: [9.2.8, 9.4.7]
ghc: [9.2.8, 9.4.7, 9.6.7]
compiler: [gcc]
index-state: [2025-04-14T00:00:00Z]
runs-on: 32-core-ubuntu
Expand Down
5 changes: 1 addition & 4 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ tests: True
-- necessary to use a haskeline <0.8 with GHCs that ship with base >= 4.14
allow-newer: haskeline:base

-- https://github.com/TomMD/entropy/issues/75
constraints: entropy < 0.4.1.9

-- develop with -Werror on, for consistency with internal Meta CI.
program-options
ghc-options: -Werror -Wwarn=dodgy-imports
ghc-options: -Werror

package fb-util
flags: +folly
Expand Down
10 changes: 5 additions & 5 deletions glean.cabal.in
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ common deps
random,
regex-base,
regex-pcre,
base >=4.11.1 && <4.18,
base >=4.11.1 && <4.19,
array ^>=0.5.2.0,
async ^>=2.2.1,
attoparsec >=0.13.2.3 && <0.15,
Expand All @@ -168,22 +168,22 @@ common deps
text >=1.2.3.0 && < 2.2,
bytestring >=0.10.8.2 && <0.12,
vector >=0.12.0.1 && <0.14,
transformers ^>=0.5.6.2,
transformers >= 0.5.6 && < 0.7,
network-uri ^>=2.6.1.0,
stm ^>=2.5.0.0,
directory ^>=1.3.1.5,
filepath ^>=1.4.2,
exceptions ^>=0.10.0,
mtl ^>=2.2.2,
unix ^>=2.7.2.2,
mtl >= 2.2.2 && < 2.4,
unix >= 2.7.2.2 && < 2.9,
process ^>=1.6.3.0,
prettyprinter >=1.2.1 && <1.8,
time >=1.8.0.2 && <1.13,
binary ^>=0.8.5.1,
deepseq ^>=1.4.3.0,
hashable >=1.2.7.0 && <1.6,
tar ^>=0.5.1.0,
ghc-prim >=0.5.2.0 && <0.10,
ghc-prim >=0.5.2.0 && <0.11,
parsec ^>=3.1.13.0,
haxl >= 2.1.2.0 && < 2.6,
hinotify ^>= 0.4.1
Expand Down
3 changes: 3 additions & 0 deletions glean/db/Glean/Database/Env.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
LICENSE file in the root directory of this source tree.
-}

{-# LANGUAGE CPP #-}
module Glean.Database.Env ( withDatabases ) where

#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Concurrent
import Control.Concurrent.Async (async, waitEither, withAsync)
import Control.Exception.Safe
Expand Down
1 change: 1 addition & 0 deletions glean/db/Glean/Query/Codegen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module Glean.Query.Codegen
) where

import Control.Exception
import Control.Monad
import Control.Monad.Extra (whenJust)
import Control.Monad.State
import Data.Bifunctor (bimap)
Expand Down
1 change: 1 addition & 0 deletions glean/db/Glean/Query/Flatten.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Glean.Query.Flatten
( flatten
) where

import Control.Monad
import Control.Monad.Except
import Control.Monad.State
import Data.List hiding (intersect)
Expand Down
1 change: 1 addition & 0 deletions glean/db/Glean/Query/Opt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Glean.Query.Opt
( optimise
) where

import Control.Monad
import Control.Monad.Except
import Control.Monad.State.Strict
import qualified Data.ByteString as B
Expand Down
1 change: 1 addition & 0 deletions glean/db/Glean/Query/Reorder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module Glean.Query.Reorder
) where

import Control.Applicative ((<|>))
import Control.Monad
import Control.Monad.Except
import Control.Monad.State.Strict
import Data.Foldable (find, toList)
Expand Down
5 changes: 5 additions & 0 deletions glean/db/Glean/Query/Transform.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ module Glean.Query.Transform
, defaultValue
) where

import Control.Monad
#if MIN_VERSION_mtl(2,3,1)
import Control.Monad.Cont hiding (label)
#else
import Control.Monad.Cont
#endif
import Data.Bifoldable
import Data.Bifunctor (bimap)
import qualified Data.ByteString as ByteString
Expand Down
1 change: 1 addition & 0 deletions glean/db/Glean/Query/Typecheck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module Glean.Query.Typecheck
, UseOfNegation(..)
) where

import Control.Monad
import Control.Applicative ((<|>))
import Control.Monad.Except
import Control.Monad.State
Expand Down
1 change: 1 addition & 0 deletions glean/db/Glean/Query/Typecheck/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module Glean.Query.Typecheck.Monad (
addErrSpan,
) where

import Control.Monad
import Control.Monad.Except
import Control.Monad.State
import qualified Data.HashMap.Strict as HashMap
Expand Down
1 change: 1 addition & 0 deletions glean/db/Glean/Write/JSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module Glean.Write.JSON
) where

import Control.Exception hiding (catch, throw)
import Control.Monad
import Control.Monad.Reader
import Control.Monad.Catch
import Data.ByteString (ByteString)
Expand Down
48 changes: 42 additions & 6 deletions glean/glass/Glean/Glass/Pretty/Haskell.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,33 @@ import qualified GHC
import qualified GHC.Utils.Outputable as GHC (
renderWithContext, defaultSDocContext, defaultUserStyle, SDocContext(..))
import qualified GHC.Iface.Type as GHC (
pprIfaceType, IfaceType(..), AnonArgFlag(..), IfaceType(..), IfaceTyLit(..),
pprIfaceType, IfaceType(..), IfaceType(..), IfaceTyLit(..),
IfaceTyCon(..), IfaceTyConInfo(..), IfExtName, IfaceTyConSort(..),
IfaceAppArgs(..), many_ty, IfaceBndr(..))
import qualified GHC.Types.Basic as GHC (
PromotionFlag(..), TupleSort(..))
#if !MIN_VERSION_ghc(9,6,0)
import qualified GHC.Iface.Type as GHC (AnonArgFlag(..))
#endif
import qualified GHC.Types.Basic as GHC (TupleSort(..))
#if !MIN_VERSION_ghc(9,6,0)
import qualified GHC.Types.Basic as GHC (PromotionFlag(..))
#endif
import qualified GHC.Types.Unique as GHC (getUnique)
import qualified GHC.Types.Name as GHC (mkExternalName)
import qualified GHC.Types.Name.Cache as GHC
import qualified GHC.Types.Name.Occurrence as GHC (
mkOccNameFS, varName, dataName, tvName, tcName)
#if MIN_VERSION_ghc(9,6,0)
import qualified GHC.Types.Var as GHC (
Specificity(..), ForAllTyFlag(..), FunTyFlag(..), VarBndr(..),
visArgTypeLike, invisArgTypeLike)
#else
import qualified GHC.Types.Var as GHC (
Specificity(..), ArgFlag(..), VarBndr(..))
#endif
import qualified GHC.Unit.Module.Env as GHC (emptyModuleEnv)
#if !MIN_VERSION_ghc(9,6,0)
import qualified GHC.Unit.Module.Name as GHC (mkModuleNameFS)
#endif
import qualified GHC.Unit.Types as GHC (fsToUnit)
import qualified GHC.Data.FastString as GHC (FastString, mkFastStringByteString)
import qualified GHC.Builtin.Utils as GHC (knownKeyNames)
Expand Down Expand Up @@ -101,19 +114,36 @@ toIfaceType ty = Glean.keyOf ty >>= \case
GHC.IfaceForAllTy (GHC.Bndr (GHC.IfaceTvBndr (textToFS name, k)) af)
<$> toIfaceType inner
Hs.Type_key_fun (Hs.Type_fun_ mult arg res) -> do
GHC.IfaceFunTy GHC.VisArg
GHC.IfaceFunTy visArg
<$> toIfaceType mult
<*> toIfaceType arg
<*> toIfaceType res
Hs.Type_key_qual (Hs.Type_qual_ pred res) ->
GHC.IfaceFunTy GHC.InvisArg
GHC.IfaceFunTy invisArg
<$> pure GHC.many_ty
<*> toIfaceType pred
<*> toIfaceType res
Hs.Type_key_lit lit -> GHC.IfaceLitTy <$> toIfaceLitType lit
Hs.Type_key_cast ty -> toIfaceType ty
Hs.Type_key_coercion{} -> return $ GHC.IfaceTyVar "<coercion type>"
_ -> return $ GHC.IfaceTyVar "<unknown type>"
where

#if MIN_VERSION_ghc(9,6,0)
visArg :: GHC.FunTyFlag
visArg = GHC.visArgTypeLike
#else
visArg :: GHC.AnonArgFlag
visArg = GHC.VisArg
#endif

#if MIN_VERSION_ghc(9,6,0)
invisArg :: GHC.FunTyFlag
invisArg = GHC.invisArgTypeLike
#else
invisArg :: GHC.AnonArgFlag
invisArg = GHC.InvisArg
#endif

toIfaceTyCon :: Hs.TyCon -> Glean.RepoHaxl u w GHC.IfaceTyCon
toIfaceTyCon tycon = do
Expand Down Expand Up @@ -181,7 +211,7 @@ toIfaceTypeArgs (Hs.TypeArg vis ty : xs) =
<*> pure (if vis then GHC.Required else GHC.Specified)
<*> toIfaceTypeArgs xs

toIfaceArgFlag :: Hs.ArgFlag -> GHC.ArgFlag
toIfaceArgFlag :: Hs.ArgFlag -> ForAllTyFlag
toIfaceArgFlag (Hs.ArgFlag_invisible spec) =
GHC.Invisible $ case spec of
Hs.Specificity_inferred -> GHC.InferredSpec
Expand All @@ -190,6 +220,12 @@ toIfaceArgFlag (Hs.ArgFlag_invisible spec) =
toIfaceArgFlag Hs.ArgFlag_requird{} = GHC.Required
toIfaceArgFlag Hs.ArgFlag_EMPTY{} = GHC.Required

#if MIN_VERSION_ghc(9,6,0)
type ForAllTyFlag = GHC.ForAllTyFlag
#else
type ForAllTyFlag = GHC.ArgFlag
#endif

toIfaceLitType :: Hs.LitType -> Glean.RepoHaxl u w GHC.IfaceTyLit
toIfaceLitType l = Glean.keyOf l >>= \case
Hs.LitType_key_num n ->
Expand Down
2 changes: 1 addition & 1 deletion glean/hs/Glean/Angle/Parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Glean.Angle.Parser
, parseType
) where

import Control.Monad.Except
import Control.Monad
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Char8 as LB
Expand Down
8 changes: 4 additions & 4 deletions glean/hs/Glean/Angle/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ data SourceQuery_ s st p t = SourceQuery
, srcQueryStmts :: [SourceStatement_ s st p t]
, srcQueryOrdered :: Ordered
}
deriving (Eq, Show, Generic)
deriving (Eq, Show, Generic, Functor)

data Ordered = Ordered | Unordered
deriving (Eq, Show, Generic)
Expand All @@ -196,7 +196,7 @@ instance Bifoldable (SourceQuery_ s st ) where

data SourceStatement_ s st p t =
SourceStatement (SourcePat_ s st p t) (SourcePat_ s st p t)
deriving (Eq, Show, Generic)
deriving (Eq, Show, Generic, Functor)

instance (Binary p, Binary t) => Binary (SourceStatement_ () () p t)

Expand Down Expand Up @@ -244,7 +244,7 @@ data SourcePat_ s st p t
-- the Variable and App forms produced by the parser.
| Clause s s p (SourcePat_ s st p t) SeekSection
| Prim s PrimOp [SourcePat_ s st p t]
deriving (Eq, Show, Generic)
deriving (Eq, Show, Generic, Functor)

-- | Should a `seek` call be restricted to a section of the database?
--
Expand Down Expand Up @@ -331,7 +331,7 @@ instance Bifoldable (SourcePat_ s st) where
Prim _ _ pats -> foldMap (bifoldMap f g) pats

data Field s st p t = Field FieldName (SourcePat_ s st p t)
deriving (Eq, Show, Generic)
deriving (Eq, Show, Generic, Functor)

instance (Binary p, Binary t) => Binary (Field () () p t)

Expand Down
4 changes: 0 additions & 4 deletions glean/hs/Glean/RTS/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE UnboxedTuples #-}

-- required for deriving 'Prim' below (at least with GHC 8.4),
-- see https://gitlab.haskell.org/ghc/ghc/-/issues/15073
{-# LANGUAGE TypeInType #-}

module Glean.RTS.Types
( -- * fact types
-- ** type
Expand Down
2 changes: 1 addition & 1 deletion glean/hs/Glean/Schema/Evolve.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module Glean.Schema.Evolve
) where

import Control.Applicative
import Control.Monad.Except
import Control.Monad
#if !MIN_VERSION_base(4,16,0)
import Data.Foldable
#endif
Expand Down
1 change: 1 addition & 0 deletions glean/hs/Glean/Schema/Resolve.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module Glean.Schema.Resolve
, resolveSchemaRefs
) where

import Control.Monad
import Control.Monad.Reader
import Control.Monad.Except
import Data.ByteString (ByteString)
Expand Down
3 changes: 2 additions & 1 deletion glean/hs/Glean/Schema/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
-}


{-# LANGUAGE DeriveFunctor #-}
module Glean.Schema.Types (
-- * Schema references
SchemaRef(..), showSchemaRef,
Expand Down Expand Up @@ -74,7 +75,7 @@ instance Hashable SchemaRef

-- | The target of a reference
data RefTarget p t = RefPred p | RefType t
deriving (Eq, Ord, Show, Generic)
deriving (Eq, Ord, Show, Generic, Functor)

instance (Binary p, Binary t) => Binary (RefTarget p t)

Expand Down
2 changes: 1 addition & 1 deletion glean/hs/Glean/Typed/Id.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-}

-- Note: UnboxedTuples needed for deriving Prim
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeInType, UnboxedTuples #-}
{-# LANGUAGE GeneralizedNewtypeDeriving, UnboxedTuples #-}
-- | This does not import Glean modules at all
module Glean.Typed.Id
( -- * Id-like
Expand Down
2 changes: 1 addition & 1 deletion glean/lang/clang/glean-clang.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ common deps
ansi-terminal ^>= 0.11,
array ^>=0.5.2.0,
async ^>=2.2.1,
base >=4.11.1 && <4.18,
base >=4.11.1 && <4.19,
containers,
data-default,
deepseq ^>=1.4.3.0,
Expand Down
15 changes: 14 additions & 1 deletion glean/lang/haskell/HieIndexer/Index.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
LICENSE file in the root directory of this source tree.
-}

{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeApplications #-}
module HieIndexer.Index (indexHieFile) where

Expand All @@ -25,6 +26,9 @@ import qualified Data.List.NonEmpty as NonEmpty
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe
#if MIN_VERSION_ghc(9,6,0)
import Data.Monoid (First(..), getFirst)
#endif
import qualified Data.Set as Set
import Data.Text (Text)
import qualified Data.Text as Text
Expand All @@ -37,16 +41,25 @@ import Control.Monad.Extra (findM, whenJust, mapMaybeM)

import qualified GHC
import qualified GHC.Types.Avail as GHC (availNames)
import qualified GHC.Types.Basic as GHC (TupleSort(..), isPromoted)
import qualified GHC.Types.Basic as GHC (TupleSort(..))
#if !MIN_VERSION_ghc(9,6,0)
import qualified GHC.Types.Basic as GHC (isPromoted)
#endif
import qualified GHC.Iface.Type as GHC (
IfaceTyLit(..), IfaceTyConSort(..), IfaceTyCon(..), IfaceTyConInfo(..))
import GHC.Iface.Ext.Utils (generateReferencesMap, emptyNodeInfo, flattenAst)
import GHC.Iface.Ext.Types
import qualified GHC.Types.Name.Occurrence as GHC
import qualified GHC.Types.Name as GHC (isSystemName, nameOccName)
#if MIN_VERSION_ghc(9,6,0)
import qualified GHC.Types.Var as GHC (ForAllTyFlag(..), Specificity(..))
#else
import qualified GHC.Types.Var as GHC (ArgFlag(..), Specificity(..))
#endif
import GHC.Unit.Types (unitFS)
#if !MIN_VERSION_ghc(9,6,0)
import qualified GHC.Unit.Module.Name as GHC (moduleNameFS)
#endif
import qualified GHC.Data.FastString as GHC (FastString, bytesFS, mkFastString)

import Util.Log
Expand Down
1 change: 1 addition & 0 deletions glean/lang/lsif/Data/LSIF/Angle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module Data.LSIF.Angle (
Env(..), emptyEnv
) where

import Control.Monad
import Control.Monad.Extra ( concatMapM )
import Control.Monad.State.Strict
import Data.Aeson
Expand Down
Loading
Loading