diff --git a/Cabal.cabal b/Cabal.cabal
--- a/Cabal.cabal
+++ b/Cabal.cabal
@@ -1,6 +1,6 @@
 cabal-version: 2.2
 name:          Cabal
-version:       3.10.1.0
+version:       3.10.2.0
 copyright:     2003-2023, Cabal Development Team (see AUTHORS file)
 license:       BSD-3-Clause
 license-file:  LICENSE
@@ -37,9 +37,9 @@
     Cabal-syntax ^>= 3.10,
     array      >= 0.4.0.1  && < 0.6,
     base       >= 4.9      && < 5,
-    bytestring >= 0.10.0.0 && < 0.12,
+    bytestring >= 0.10.0.0 && < 0.13,
     containers >= 0.5.0.0  && < 0.7,
-    deepseq    >= 1.3.0.1  && < 1.5,
+    deepseq    >= 1.3.0.1  && < 1.6,
     directory  >= 1.2      && < 1.4,
     filepath   >= 1.3.0.1  && < 1.5,
     pretty     >= 1.1.1    && < 1.2,
@@ -302,7 +302,7 @@
     -- See also https://github.com/ekmett/transformers-compat/issues/35
     transformers (>= 0.3      && < 0.4) || (>=0.4.1.0 && <0.7),
     mtl           >= 2.1      && < 2.4,
-    text         (>= 1.2.3.0  && < 1.3) || (>= 2.0 && < 2.1),
+    text         (>= 1.2.3.0  && < 1.3) || (>= 2.0 && < 2.2),
     parsec        >= 3.1.13.0 && < 3.2
 
   other-modules:
diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,6 @@
+# 3.10.2.0 [Hécate](mailto:hecate+github@glitchbra.in) August 2023
+* See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.10.2.0.md
+
 # 3.10.1.0 [Mikolaj Konarski](mailto:mikolaj@well-typed.com) March 2023
 * See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.10.1.0.md
 
diff --git a/src/Distribution/PackageDescription/Check.hs b/src/Distribution/PackageDescription/Check.hs
--- a/src/Distribution/PackageDescription/Check.hs
+++ b/src/Distribution/PackageDescription/Check.hs
@@ -70,6 +70,7 @@
 
 import qualified Data.ByteString.Lazy      as BS
 import qualified Data.Map                  as Map
+import qualified Control.Monad             as CM
 import qualified Distribution.Compat.DList as DList
 import qualified Distribution.SPDX         as SPDX
 import qualified System.Directory          as System
@@ -1209,17 +1210,13 @@
       | (compiler, vr) <- testedWith pkg
       , isNoVersion vr ]
 
-    internalLibraries =
-        map (maybe (packageName pkg) unqualComponentNameToPackageName . libraryNameString . libName)
-            (allLibraries pkg)
-
     internalExecutables = map exeName $ executables pkg
 
     internalLibDeps =
       [ dep
       | bi <- allBuildInfo pkg
       , dep@(Dependency name _ _) <- targetBuildDepends bi
-      , name `elem` internalLibraries
+      , name == packageName pkg
       ]
 
     internalExeDeps =
@@ -1385,7 +1382,7 @@
   , checkFlags ["-prof"] $
       PackageBuildWarning (OptProf fieldName)
 
-  , checkFlags ["-o"] $
+  , unlessScript . checkFlags ["-o"] $
       PackageBuildWarning (OptO fieldName)
 
   , checkFlags ["-hide-package"] $
@@ -1478,6 +1475,10 @@
     checkFlags :: [String] -> PackageCheck -> Maybe PackageCheck
     checkFlags flags = check (any (`elem` flags) all_ghc_options)
 
+    unlessScript :: Maybe PackageCheck -> Maybe PackageCheck
+    unlessScript pc | packageId pkg == fakePackageId = Nothing
+                    | otherwise                      = pc
+
     checkTestAndBenchmarkFlags :: [String] -> PackageCheck -> Maybe PackageCheck
     checkTestAndBenchmarkFlags flags = check (any (`elem` flags) test_and_benchmark_ghc_options)
 
@@ -1895,7 +1896,7 @@
     baseErrors
   where
     baseErrors = PackageDistInexcusable BaseNoUpperBounds <$ bases
-    deps = toDependencyVersionsMap allBuildDepends pkg
+    deps = toDependencyVersionsMap allNonInternalBuildDepends pkg
     -- base gets special treatment (it's more critical)
     (bases, others) = partition (("base" ==) . unPackageName) $
       [ name
@@ -1903,6 +1904,16 @@
       , not (hasUpperBound vr)
       ]
 
+    -- Get the combined build-depends entries of all components.
+    allNonInternalBuildDepends :: PackageDescription -> [Dependency]
+    allNonInternalBuildDepends = targetBuildDepends CM.<=< allNonInternalBuildInfo
+
+    allNonInternalBuildInfo :: PackageDescription -> [BuildInfo]
+    allNonInternalBuildInfo pkg_descr =
+      [bi | lib <- allLibraries pkg_descr, let bi = libBuildInfo lib]
+        ++ [bi | flib <- foreignLibs pkg_descr, let bi = foreignLibBuildInfo flib]
+        ++ [bi | exe <- executables pkg_descr, let bi = buildInfo exe]
+
 checkConditionals :: GenericPackageDescription -> [PackageCheck]
 checkConditionals pkg =
   catMaybes [
@@ -1917,7 +1928,7 @@
       PackageDistInexcusable (UnknownCompiler unknownImpls)
   ]
   where
-    unknownOSs    = [ os   | OS   (OtherOS os)           <- conditions ]
+    unknownOSs    = [ os   | OS   (OtherOS os)           <- conditions, os /= "haiku" ]
     unknownArches = [ arch | Arch (OtherArch arch)       <- conditions ]
     unknownImpls  = [ impl | Impl (OtherCompiler impl) _ <- conditions ]
     conditions = concatMap fvs (maybeToList (condLibrary pkg))
diff --git a/src/Distribution/Simple/GHC.hs b/src/Distribution/Simple/GHC.hs
--- a/src/Distribution/Simple/GHC.hs
+++ b/src/Distribution/Simple/GHC.hs
@@ -140,12 +140,12 @@
       (userMaybeSpecifyPath "ghc" hcPath conf0)
   let implInfo = ghcVersionImplInfo ghcVersion
 
-  -- Cabal currently supports ghc >= 7.0.1 && < 9.8
+  -- Cabal currently supports ghc >= 7.0.1 && < 9.10
   -- ... and the following odd development version
-  unless (ghcVersion < mkVersion [9,8]) $
+  unless (ghcVersion < mkVersion [9,10]) $
     warn verbosity $
          "Unknown/unsupported 'ghc' version detected "
-      ++ "(Cabal " ++ prettyShow cabalVersion ++ " supports 'ghc' version < 9.8): "
+      ++ "(Cabal " ++ prettyShow cabalVersion ++ " supports 'ghc' version < 9.10): "
       ++ programPath ghcProg ++ " is version " ++ prettyShow ghcVersion
 
   -- This is slightly tricky, we have to configure ghc first, then we use the
@@ -185,10 +185,13 @@
 
   ghcInfo <- Internal.getGhcInfo verbosity implInfo ghcProg
   let ghcInfoMap = Map.fromList ghcInfo
-      extensions = -- workaround https://gitlab.haskell.org/ghc/ghc/-/issues/11214
-                   filterExt JavaScriptFFI $
-                   -- see 'filterExtTH' comment below
-                   filterExtTH $ extensions0
+      filterJS = if ghcVersion < mkVersion [9, 8] then filterExt JavaScriptFFI else id
+      extensions =
+        -- workaround https://gitlab.haskell.org/ghc/ghc/-/issues/11214
+        filterJS $
+          -- see 'filterExtTH' comment below
+          filterExtTH $
+            extensions0
 
       -- starting with GHC 8.0, `TemplateHaskell` will be omitted from
       -- `--supported-extensions` when it's not available.
@@ -702,35 +705,45 @@
       | filename <- cxxSources libBi]
 
   -- build any C sources
-  unless (not has_code || null (cSources libBi)) $ do
+  let (cSrcs', others) = partition (\filepath -> ".c"`isSuffixOf` filepath) (cSources libBi)
+  unless (not has_code || null cSrcs') $ do
     info verbosity "Building C Sources..."
-    sequence_
-      [ do let baseCcOpts    = Internal.componentCcGhcOptions verbosity implInfo
-                               lbi libBi clbi relLibTargetDir filename
-               vanillaCcOpts = if isGhcDynamic
-                               -- Dynamic GHC requires C sources to be built
-                               -- with -fPIC for REPL to work. See #2207.
-                               then baseCcOpts { ghcOptFPic = toFlag True }
-                               else baseCcOpts
-               profCcOpts    = vanillaCcOpts `mappend` mempty {
-                                 ghcOptProfilingMode = toFlag True,
-                                 ghcOptObjSuffix     = toFlag "p_o"
-                               }
-               sharedCcOpts  = vanillaCcOpts `mappend` mempty {
-                                 ghcOptFPic        = toFlag True,
-                                 ghcOptDynLinkMode = toFlag GhcDynamicOnly,
-                                 ghcOptObjSuffix   = toFlag "dyn_o"
-                               }
-               odir          = fromFlag (ghcOptObjDir vanillaCcOpts)
-           createDirectoryIfMissingVerbose verbosity True odir
-           let runGhcProgIfNeeded ccOpts = do
-                 needsRecomp <- checkNeedsRecompilation filename ccOpts
-                 when needsRecomp $ runGhcProg ccOpts
-           runGhcProgIfNeeded vanillaCcOpts
-           unless forRepl $
-             whenSharedLib forceSharedLib (runGhcProgIfNeeded sharedCcOpts)
-           unless forRepl $ whenProfLib (runGhcProgIfNeeded profCcOpts)
-      | filename <- cSources libBi]
+    unless (null others) $ do
+      let files = intercalate ", " others
+      let libraryName = case libName lib of
+            LMainLibName -> "the main library"
+            LSubLibName name -> "library " <> prettyShow name
+      warn verbosity $ unlines
+        [ "The following files listed in " <> libraryName <> "'s c-sources will not be used: " <> files <> "."
+        , "Header files should be in the 'include' or 'install-include' stanza."
+        , "See https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-includes"
+        ]
+    forM_ cSrcs' $ \filename -> do
+       let baseCcOpts    = Internal.componentCcGhcOptions verbosity implInfo
+                           lbi libBi clbi relLibTargetDir filename
+           vanillaCcOpts = if isGhcDynamic
+                           -- Dynamic GHC requires C sources to be built
+                           -- with -fPIC for REPL to work. See #2207.
+                           then baseCcOpts { ghcOptFPic = toFlag True }
+                           else baseCcOpts
+           profCcOpts    = vanillaCcOpts `mappend` mempty {
+                             ghcOptProfilingMode = toFlag True,
+                             ghcOptObjSuffix     = toFlag "p_o"
+                           }
+           sharedCcOpts  = vanillaCcOpts `mappend` mempty {
+                             ghcOptFPic        = toFlag True,
+                             ghcOptDynLinkMode = toFlag GhcDynamicOnly,
+                             ghcOptObjSuffix   = toFlag "dyn_o"
+                           }
+           odir          = fromFlag (ghcOptObjDir vanillaCcOpts)
+       createDirectoryIfMissingVerbose verbosity True odir
+       let runGhcProgIfNeeded ccOpts = do
+             needsRecomp <- checkNeedsRecompilation filename ccOpts
+             when needsRecomp $ runGhcProg ccOpts
+       runGhcProgIfNeeded vanillaCcOpts
+       unless forRepl $
+         whenSharedLib forceSharedLib (runGhcProgIfNeeded sharedCcOpts)
+       unless forRepl $ whenProfLib (runGhcProgIfNeeded profCcOpts)
 
   -- build any JS sources
   unless (not has_code || not hasJsSupport || null (jsSources libBi)) $ do
@@ -1524,32 +1537,40 @@
      | filename <- cxxSrcs ]
 
   -- build any C sources
-  unless (null cSrcs) $ do
-   info verbosity "Building C Sources..."
-   sequence_
-     [ do let baseCcOpts    = Internal.componentCcGhcOptions verbosity implInfo
+  let (cSrcs', others) = partition (\filepath -> ".c"`isSuffixOf` filepath) cSrcs
+  unless (null cSrcs') $ do
+    info verbosity "Building C Sources..."
+    unless (null others) $ do
+      let files = intercalate ", " others
+      let currentComponentName = gbuildName bm
+      warn verbosity $ unlines
+        [ "The following files listed in " <> currentComponentName <> "'s c-sources will not be used: " <> files <> "."
+        , "Header files should be in the 'include' or 'install-include' stanza."
+        , "See https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-includes"
+        ]
+    forM_ cSrcs' $ \filename -> do
+      let baseCcOpts    = Internal.componentCcGhcOptions verbosity implInfo
                               lbi bnfo clbi tmpDir filename
-              vanillaCcOpts = if isGhcDynamic
-                              -- Dynamic GHC requires C sources to be built
-                              -- with -fPIC for REPL to work. See #2207.
-                              then baseCcOpts { ghcOptFPic = toFlag True }
-                              else baseCcOpts
-              profCcOpts    = vanillaCcOpts `mappend` mempty {
-                                ghcOptProfilingMode = toFlag True
-                              }
-              sharedCcOpts  = vanillaCcOpts `mappend` mempty {
-                                ghcOptFPic        = toFlag True,
-                                ghcOptDynLinkMode = toFlag GhcDynamicOnly
-                              }
-              opts | needProfiling = profCcOpts
-                   | needDynamic   = sharedCcOpts
-                   | otherwise     = vanillaCcOpts
-              odir = fromFlag (ghcOptObjDir opts)
-          createDirectoryIfMissingVerbose verbosity True odir
-          needsRecomp <- checkNeedsRecompilation filename opts
-          when needsRecomp $
-            runGhcProg opts
-     | filename <- cSrcs ]
+      let vanillaCcOpts = if isGhcDynamic
+                          -- Dynamic GHC requires C sources to be built
+                          -- with -fPIC for REPL to work. See #2207.
+                          then baseCcOpts { ghcOptFPic = toFlag True }
+                          else baseCcOpts
+      let profCcOpts    = vanillaCcOpts `mappend` mempty {
+                            ghcOptProfilingMode = toFlag True
+                          }
+      let sharedCcOpts  = vanillaCcOpts `mappend` mempty {
+                            ghcOptFPic        = toFlag True,
+                            ghcOptDynLinkMode = toFlag GhcDynamicOnly
+                          }
+      let opts | needProfiling = profCcOpts
+               | needDynamic   = sharedCcOpts
+               | otherwise     = vanillaCcOpts
+      let odir = fromFlag (ghcOptObjDir opts)
+      createDirectoryIfMissingVerbose verbosity True odir
+      needsRecomp <- checkNeedsRecompilation filename opts
+      when needsRecomp $
+        runGhcProg opts
 
   -- TODO: problem here is we need the .c files built first, so we can load them
   -- with ghci, but .c files can depend on .h files generated by ghc by ffi
diff --git a/src/Distribution/Simple/Haddock.hs b/src/Distribution/Simple/Haddock.hs
--- a/src/Distribution/Simple/Haddock.hs
+++ b/src/Distribution/Simple/Haddock.hs
@@ -360,7 +360,7 @@
 createHaddockIndex verbosity programDb comp platform flags = do
     let args = fromHaddockProjectFlags flags
     (haddockProg, _version) <-
-      getHaddockProg verbosity programDb comp args (haddockProjectQuickJump flags)
+      getHaddockProg verbosity programDb comp args (Flag True)
     runHaddock verbosity defaultTempFileOptions comp platform haddockProg False args
 
 -- ------------------------------------------------------------------------------
@@ -405,12 +405,12 @@
 fromHaddockProjectFlags flags =
     mempty
       { argOutputDir = Dir (fromFlag $ haddockProjectDir flags)
-      , argQuickJump = haddockProjectQuickJump flags
-      , argGenContents = haddockProjectGenContents flags
-      , argGenIndex = haddockProjectGenIndex flags
+      , argQuickJump = Flag True
+      , argGenContents = Flag True
+      , argGenIndex = Flag True
       , argPrologueFile = haddockProjectPrologue flags
       , argInterfaces = fromFlagOrDefault [] (haddockProjectInterfaces flags)
-      , argLinkedSource = haddockProjectLinkedSource flags
+      , argLinkedSource = Flag True
       , argLib = haddockProjectLib flags
       }
 
@@ -684,7 +684,12 @@
       result = intercalate ", "
              . map (\o -> outputDir </>
                             case o of
-                              Html -> "index.html"
+                              Html
+                                | fromFlagOrDefault False (argGenIndex args) ->
+                                    "index.html"
+                              Html
+                                | otherwise ->
+                                    mempty
                               Hoogle -> pkgstr <.> "txt")
              . fromFlagOrDefault [Html]
              . argOutput
@@ -709,7 +714,7 @@
     , [ "--since-qual=external" | isVersion 2 20 ]
 
     , [ "--quickjump" | isVersion 2 19
-                      , _ <- flagToList . argQuickJump $ args ]
+                      , True <- flagToList . argQuickJump $ args ]
 
     , [ "--hyperlinked-source" | isVersion 2 17
                                , True <- flagToList . argLinkedSource $ args ]
