Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
29e8519c by Cheng Shao at 2025-12-12T18:41:29-05:00
ci: use treeless fetch for perf notes
This patch improves the ci logic for fetching perf notes by using
treeless fetch
(https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-s...),
to avoid downloading all blobs of the perf notes repo at once, and
only fetch the actually required blobs on-demand when needed. This
makes the initial `test-metrics.sh pull` operation much faster, and
also more robust, since we are seeing an increasing rate of 504 errors
in CI when fetching all perf notes at once, which is a major source of
CI flakiness at this point.
Co-authored-by: Codex
- - - - -
04cdf8ac by Peter Trommler at 2025-12-12T18:41:30-05:00
Cmm: remove restriction in MachOp folding
- - - - -
85141059 by Andreas Klebinger at 2025-12-12T18:41:31-05:00
Remove explicit Typeable deriviations.
- - - - -
c866c3db by Cheng Shao at 2025-12-12T18:41:32-05:00
ci: set gc.auto=0 during setup stage
This patch sets `gc.auto=0` during `setup` stage of CI, see added
comment for detailed explanation.
- - - - -
13 changed files:
- .gitlab/ci.sh
- .gitlab/test-metrics.sh
- compiler/GHC/Cmm/Opt.hs
- hadrian/src/Hadrian/Haskell/Cabal/Type.hs
- hadrian/src/Hadrian/Haskell/Hash.hs
- hadrian/src/Hadrian/Oracles/ArgsHash.hs
- hadrian/src/Hadrian/Oracles/Cabal/Type.hs
- hadrian/src/Hadrian/Oracles/DirectoryContents.hs
- hadrian/src/Hadrian/Oracles/Path.hs
- hadrian/src/Hadrian/Oracles/TextFile.hs
- hadrian/src/Hadrian/Utilities.hs
- hadrian/src/Oracles/Flavour.hs
- hadrian/src/Oracles/ModuleFiles.hs
Changes:
=====================================
.gitlab/ci.sh
=====================================
@@ -259,6 +259,12 @@ function setup() {
git config user.email "ghc-ci@gitlab-haskell.org"
git config user.name "GHC GitLab CI"
+ # Disable auto gc. Useless in a temporary checkout, and
+ # non-deterministic "Auto packing the repository in background for
+ # optimum performance." message could pop up that confuses the
+ # testsuite driver!
+ git config gc.auto 0
+
info "====================================================="
info "Toolchain versions"
info "====================================================="
=====================================
.gitlab/test-metrics.sh
=====================================
@@ -17,12 +17,14 @@ fail() {
function pull() {
local ref="refs/notes/$REF"
- # 2023-10-04: `git fetch` started failing, first on Darwin in CI and then on
- # Linux locally, both using git version 2.40.1. See #24055. One workaround is
- # to set a larger http.postBuffer, although this is definitely a workaround.
- # The default should work just fine. The error could be in git, GitLab, or
- # perhaps the networking tube (including all proxies etc) between the two.
- run git -c http.postBuffer=2097152 fetch -f "$NOTES_ORIGIN" "$ref:$ref"
+
+ # Fetch performance notes from a dedicated promisor remote using a
+ # treeless filter, so that individual note blobs are fetched lazily
+ # as needed.
+ git remote add perf-notes "$NOTES_ORIGIN" || true
+ git config fetch.recurseSubmodules false
+ git config remote.perf-notes.partialclonefilter tree:0
+ run git fetch --force perf-notes "$ref:$ref"
echo "perf notes ref $ref is $(git rev-parse $ref)"
}
@@ -81,4 +83,3 @@ case $1 in
pull) pull ;;
*) fail "Invalid mode $1" ;;
esac
-
=====================================
compiler/GHC/Cmm/Opt.hs
=====================================
@@ -290,9 +290,7 @@ cmmMachOpFoldM _ (MO_Sub _) [CmmLit lit, CmmLit (CmmInt i rep)]
-- the same comparison at the larger size.
cmmMachOpFoldM platform cmp [CmmMachOp conv [x], CmmLit (CmmInt i _)]
- | -- powerPC NCG has a TODO for I8/I16 comparisons, so don't try
- platformArch platform `elem` [ArchX86, ArchX86_64],
- -- if the operand is widened:
+ | -- if the operand is widened:
Just (rep, signed, narrow_fn) <- maybe_conversion conv,
-- and this is a comparison operation:
Just narrow_cmp <- maybe_comparison cmp rep signed,
=====================================
hadrian/src/Hadrian/Haskell/Cabal/Type.hs
=====================================
@@ -31,7 +31,7 @@ data PackageData = PackageData
, description :: String
, packageDependencies :: [Package]
, genericPackageDescription :: GenericPackageDescription
- } deriving (Eq, Generic, Show, Typeable)
+ } deriving (Eq, Generic, Show)
-- | Haskell package metadata obtained after resolving package configuration
-- flags and associated conditionals according to the current build context.
@@ -75,7 +75,7 @@ data ContextData = ContextData
, contextLibdir :: FilePath
-- The location where dynamic libraries go
, contextDynLibdir :: FilePath
- } deriving (Eq, Generic, Show, Typeable)
+ } deriving (Eq, Generic, Show)
instance Binary PackageData
instance Hashable PackageData where hashWithSalt salt = hashWithSalt salt . show
=====================================
hadrian/src/Hadrian/Haskell/Hash.hs
=====================================
@@ -108,7 +108,7 @@ data PackageHashConfigInputs = PackageHashConfigInputs {
deriving Show
newtype PkgHashKey = PkgHashKey (Stage, Package)
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult PkgHashKey = String
pkgHash :: Stage -> Package -> Action String
=====================================
hadrian/src/Hadrian/Oracles/ArgsHash.hs
=====================================
@@ -38,7 +38,7 @@ trackArgsHash t = do
void (askOracle $ ArgsHash hashedTarget :: Action Int)
newtype ArgsHash c b = ArgsHash (Target c b)
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult (ArgsHash c b) = Int
-- | This oracle stores per-target argument list hashes in the Shake database,
=====================================
hadrian/src/Hadrian/Oracles/Cabal/Type.hs
=====================================
@@ -26,13 +26,13 @@ import Stage
-- | This type of oracle key is used by 'Hadrian.Oracles.Cabal.readPackageData'
-- to cache reading and parsing of 'Hadrian.Haskell.Cabal.Type.PackageData'.
newtype PackageDataKey = PackageDataKey Package
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult PackageDataKey = PackageData
-- | This type of oracle key is used by 'Hadrian.Oracles.Cabal.readContextData'
-- to cache reading and parsing of 'Hadrian.Haskell.Cabal.Type.ContextData'.
newtype ContextDataKey = ContextDataKey Context
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult ContextDataKey = ContextData
-- TODO: Should @PackageConfiguration@ be simply @()@? Presumably the pair
@@ -40,7 +40,7 @@ type instance RuleResult ContextDataKey = ContextData
-- | The result of Cabal package configuration produced by the oracle
-- 'Hadrian.Oracles.Cabal.configurePackageGHC'.
newtype PackageConfiguration = PackageConfiguration (C.Compiler, C.Platform)
- deriving (Binary, Eq, Show, Typeable)
+ deriving (Binary, Eq, Show)
instance NFData PackageConfiguration where
rnf (PackageConfiguration (c, p)) =
@@ -58,5 +58,5 @@ instance Hashable PackageConfiguration where
-- | This type of oracle key is used by 'Hadrian.Oracles.Cabal.configurePackageGHC'
-- to cache configuration of a Cabal package.
newtype PackageConfigurationKey = PackageConfigurationKey (Package, Stage)
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult PackageConfigurationKey = PackageConfiguration
=====================================
hadrian/src/Hadrian/Oracles/DirectoryContents.hs
=====================================
@@ -15,7 +15,7 @@ import Hadrian.Utilities
import qualified System.Directory.Extra as IO
data Match = Test FilePattern | Not Match | And [Match] | Or [Match]
- deriving (Generic, Eq, Show, Typeable)
+ deriving (Generic, Eq, Show)
instance Binary Match
instance Hashable Match
@@ -54,7 +54,7 @@ copyDirectoryContentsUntracked expr source target = do
mapM_ cp =<< directoryContents expr source
newtype DirectoryContents = DirectoryContents (Match, FilePath)
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult DirectoryContents = [FilePath]
-- | This oracle answers 'directoryContents' queries and tracks the results.
=====================================
hadrian/src/Hadrian/Oracles/Path.hs
=====================================
@@ -34,11 +34,11 @@ fixAbsolutePathOnWindows path =
return path
newtype LookupInPath = LookupInPath String
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult LookupInPath = String
newtype WindowsPath = WindowsPath FilePath
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult WindowsPath = String
-- | Oracles for looking up paths. These are slow and require caching.
=====================================
hadrian/src/Hadrian/Oracles/TextFile.hs
=====================================
@@ -118,15 +118,15 @@ queryTargetTarget :: (Toolchain.Target -> a) -> Action a
queryTargetTarget f = f <$> getTargetTarget
newtype KeyValue = KeyValue (FilePath, String)
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult KeyValue = Maybe String
newtype KeyValues = KeyValues (FilePath, String)
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult KeyValues = Maybe [String]
newtype TargetFile = TargetFile FilePath
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult TargetFile = Toolchain.Target
-- | These oracle rules are used to cache and track answers to the following
=====================================
hadrian/src/Hadrian/Utilities.hs
=====================================
@@ -298,7 +298,7 @@ userSettingRules defaultValue = do
extra <- shakeExtra <$> getShakeOptionsRules
return $ lookupExtra defaultValue extra
-newtype BuildRoot = BuildRoot FilePath deriving (Typeable, Eq, Show)
+newtype BuildRoot = BuildRoot FilePath deriving (Eq, Show)
-- | All build results are put into the 'buildRoot' directory.
buildRoot :: Action FilePath
@@ -484,7 +484,6 @@ putColoured code msg = do
else putInfo msg
newtype BuildProgressColour = BuildProgressColour String
- deriving Typeable
-- | By default, Hadrian tries to figure out if the current terminal
-- supports colors using this function. The default can be overridden
@@ -511,7 +510,6 @@ putBuild msg = do
putColoured code msg
newtype SuccessColour = SuccessColour String
- deriving Typeable
-- | Generate an encoded colour for successful output from names
mkSuccessColour :: Colour -> SuccessColour
@@ -528,7 +526,6 @@ putSuccess msg = do
putColoured code msg
newtype FailureColour = FailureColour String
- deriving Typeable
-- | Generate an encoded colour for failure output messages
mkFailureColour :: Colour -> FailureColour
@@ -544,7 +541,7 @@ putFailure msg = do
FailureColour code <- userSetting red
putColoured code msg
-data ProgressInfo = None | Brief | Normal | Unicorn deriving (Eq, Show, Typeable)
+data ProgressInfo = None | Brief | Normal | Unicorn deriving (Eq, Show)
-- | Version of 'putBuild' controlled by @--progress-info@ command line argument.
putProgressInfo :: String -> Action ()
=====================================
hadrian/src/Oracles/Flavour.hs
=====================================
@@ -14,11 +14,11 @@ import Flavour
import Settings (flavour)
newtype DynGhcPrograms =
- DynGhcPrograms () deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
+ DynGhcPrograms () deriving (Show, Eq, Hashable, Binary, NFData)
type instance RuleResult DynGhcPrograms = Bool
newtype GhcProfiled =
- GhcProfiled Stage deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
+ GhcProfiled Stage deriving (Show, Eq, Hashable, Binary, NFData)
type instance RuleResult GhcProfiled = Bool
oracles :: Rules ()
=====================================
hadrian/src/Oracles/ModuleFiles.hs
=====================================
@@ -16,11 +16,11 @@ import Expression
type ModuleName = String
newtype ModuleFiles = ModuleFiles (Stage, Package)
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult ModuleFiles = [Maybe FilePath]
newtype Generator = Generator (Stage, Package, FilePath)
- deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
+ deriving (Binary, Eq, Hashable, NFData, Show)
type instance RuleResult Generator = Maybe FilePath
-- | We scan for the following Haskell source extensions when looking for module
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ed55a3d7950a1f24e8515e9fad0d7e6...
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ed55a3d7950a1f24e8515e9fad0d7e6...
You're receiving this email because of your account on gitlab.haskell.org.