[Git][ghc/ghc][ghc-9.10] 12 commits: Bump text submodule to current `master`

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Fri Mar 14 22:07:15 UTC 2025



Ben Gamari pushed to branch ghc-9.10 at Glasgow Haskell Compiler / GHC


Commits:
877895d2 by Ben Gamari at 2025-03-03T14:31:03-05:00
Bump text submodule to current `master`

This will be a revision of 2.1.2.

- - - - -
457055f8 by Ben Gamari at 2025-03-04T17:02:00-05:00
Partially revert "testsuite: expand size testing infrastructure"

This reverts the size testing infrastructure from commit
a15b3383c95864eb1ca9df4f7065ef6f6fe84393 as it has broken the testsuite.

- - - - -
400cfabe by Ben Gamari at 2025-03-05T10:05:55-05:00
Revert "hadrian: Bump directory bound to >=1.3.9"

This reverts commit 15ca7b2c06f9727b7a8c5ca663c3b6779489daa6 as it
breaks bootstrapping with 9.8 and 9.6, where `directory-1.3.9` is not
shipped.

- - - - -
3057ebc4 by Ben Gamari at 2025-03-05T10:53:57-05:00
gitlab-ci: Drop CentOS 7 binary distributions

CentOS 7 is EoL and moreover we cannot even build images for it.

See #25061.

- - - - -
09d005eb by Ben Gamari at 2025-03-06T17:49:23-05:00
ghcup-metadata: Update for loss of CentOS 7

- - - - -
b88f239e by Ben Gamari at 2025-03-07T10:31:13-05:00
mk-ghcup-metadata: Fix incorrect use of alpine()

- - - - -
ade5ae4f by Ben Gamari at 2025-03-10T12:08:07-04:00
mk-ghcup-metadata: Fix misnamed identifiers

- - - - -
291860da by Matthew Pickering at 2025-03-11T09:35:06-04:00
Expand LLVM version matching regex for compability with bsd systems

sed on BSD systems (such as darwin) does not support the + operation.

Therefore we take the simple minded approach of manually expanding
group+ to groupgroup*.

Fixes #24999

(cherry picked from commit 77ce65a5e9b14c29f8f47bfbe452b1d6296c45e8)

- - - - -
cac7c45d by Ben Gamari at 2025-03-11T09:35:06-04:00
ghc-internal: Update CHANGELOG to reflect current version

(cherry picked from commit 580fef7b1be1ea7247e9c7bc7ce0e3150b03fc36)

- - - - -
04cf8504 by Ben Gamari at 2025-03-11T09:35:06-04:00
ghc-internal: Update prologue.txt to reflect package description

(cherry picked from commit 391ecff5ced86e52089c5a5c46158a22755312a9)

- - - - -
7348dfc2 by Matthew Pickering at 2025-03-11T09:35:06-04:00
Remove accidentally committed test.hs

(cherry picked from commit e8724327d995a67d3eb066dfe4f9ee03e64dd6b5)

- - - - -
f2e63a12 by Matthew Pickering at 2025-03-11T09:35:06-04:00
libraries: Update os-string to 2.0.4

This updates the os-string submodule to 2.0.4 which removes the usage of
`TemplateHaskell` pragma.

(cherry picked from commit 37139b17f44cc489cc42cdac4e1b5b04b502d1b4)

- - - - -


18 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/flake.lock
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- hadrian/cabal.project
- hadrian/hadrian.cabal
- hadrian/stack.yaml
- libraries/ghc-internal/CHANGELOG.md
- libraries/ghc-internal/prologue.txt
- libraries/os-string
- libraries/text
- m4/find_llvm_prog.m4
- − test.hs
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/tests/perf/size/all.T


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -1143,8 +1143,6 @@ ghcup-metadata-nightly:
   needs:
     - job: nightly-x86_64-linux-fedora33-release
       artifacts: false
-    - job: nightly-x86_64-linux-centos7-validate
-      artifacts: false
     - job: nightly-x86_64-linux-ubuntu20_04-validate
       artifacts: false
     - job: nightly-x86_64-linux-ubuntu18_04-validate


=====================================
.gitlab/ci.sh
=====================================
@@ -7,8 +7,7 @@
 set -Eeuo pipefail
 
 # Configuration:
-# N.B. You may want to also update the index-state in hadrian/cabal.project.
-HACKAGE_INDEX_STATE="2025-02-03T15:14:19Z"
+HACKAGE_INDEX_STATE="2024-05-13T15:04:38Z"
 MIN_HAPPY_VERSION="1.20"
 MAX_HAPPY_VERSION="1.21" # Exclusive upper bound
 MIN_ALEX_VERSION="3.2.6"


=====================================
.gitlab/generate-ci/flake.lock
=====================================
@@ -5,11 +5,11 @@
         "systems": "systems"
       },
       "locked": {
-        "lastModified": 1687709756,
-        "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
+        "lastModified": 1731533236,
+        "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
         "owner": "numtide",
         "repo": "flake-utils",
-        "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
+        "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
         "type": "github"
       },
       "original": {
@@ -20,12 +20,10 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1687886075,
-        "narHash": "sha256-PeayJDDDy+uw1Ats4moZnRdL1OFuZm1Tj+KiHlD67+o=",
-        "owner": "NixOS",
-        "repo": "nixpkgs",
-        "rev": "a565059a348422af5af9026b5174dc5c0dcefdae",
-        "type": "github"
+        "lastModified": 0,
+        "narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=",
+        "path": "/nix/store/lv9bmgm6v1wc3fiz00v29gi4rk13ja6l-source",
+        "type": "path"
       },
       "original": {
         "id": "nixpkgs",


=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -113,7 +113,6 @@ data LinuxDistro
   | Fedora38
   | Ubuntu2004
   | Ubuntu1804
-  | Centos7
   | Alpine312
   | Alpine318
   | AlpineWasm
@@ -293,7 +292,6 @@ distroName Fedora33  = "fedora33"
 distroName Fedora38  = "fedora38"
 distroName Ubuntu1804 = "ubuntu18_04"
 distroName Ubuntu2004 = "ubuntu20_04"
-distroName Centos7    = "centos7"
 distroName Alpine312  = "alpine3_12"
 distroName Alpine318  = "alpine3_18"
 distroName AlpineWasm = "alpine3_18-wasm"
@@ -445,10 +443,6 @@ alpineVariables = mconcat
 distroVariables :: LinuxDistro -> Variables
 distroVariables Alpine312 = alpineVariables
 distroVariables Alpine318 = alpineVariables
-distroVariables Centos7 = mconcat [
-    "HADRIAN_ARGS" =: "--docs=no-sphinx"
-  , "BROKEN_TESTS" =: "T22012" -- due to #23979
-  ]
 distroVariables Fedora33 = mconcat
   -- LLC/OPT do not work for some reason in our fedora images
   -- These tests fail with this error: T11649 T5681 T7571 T8131b
@@ -984,7 +978,6 @@ job_groups =
      , disableValidate (standardBuilds Amd64 (Linux Ubuntu1804))
      , disableValidate (standardBuilds Amd64 (Linux Ubuntu2004))
      , disableValidate (standardBuilds Amd64 (Linux Rocky8))
-     , disableValidate (standardBuildsWithConfig Amd64 (Linux Centos7) (splitSectionsBroken vanilla))
      -- Fedora33 job is always built with perf so there's one job in the normal
      -- validate pipeline which is built with perf.
      , fastCI (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig)


=====================================
.gitlab/jobs.yaml
=====================================
@@ -1207,70 +1207,6 @@
       "XZ_OPT": "-9"
     }
   },
-  "nightly-x86_64-linux-centos7-validate": {
-    "after_script": [
-      ".gitlab/ci.sh save_cache",
-      ".gitlab/ci.sh save_test_output",
-      ".gitlab/ci.sh clean",
-      "cat ci_timings"
-    ],
-    "allow_failure": false,
-    "artifacts": {
-      "expire_in": "8 weeks",
-      "paths": [
-        "ghc-x86_64-linux-centos7-validate.tar.xz",
-        "junit.xml",
-        "unexpected-test-output.tar.gz"
-      ],
-      "reports": {
-        "junit": "junit.xml"
-      },
-      "when": "always"
-    },
-    "cache": {
-      "key": "x86_64-linux-centos7-$CACHE_REV",
-      "paths": [
-        "cabal-cache",
-        "toolchain"
-      ]
-    },
-    "dependencies": [],
-    "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-centos7:$DOCKER_REV",
-    "needs": [
-      {
-        "artifacts": false,
-        "job": "hadrian-ghc-in-ghci"
-      }
-    ],
-    "rules": [
-      {
-        "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)",
-        "when": "on_success"
-      }
-    ],
-    "script": [
-      "sudo chown ghc:ghc -R .",
-      ".gitlab/ci.sh setup",
-      ".gitlab/ci.sh configure",
-      ".gitlab/ci.sh build_hadrian",
-      ".gitlab/ci.sh test_hadrian"
-    ],
-    "stage": "full-build",
-    "tags": [
-      "x86_64-linux"
-    ],
-    "variables": {
-      "BIGNUM_BACKEND": "gmp",
-      "BIN_DIST_NAME": "ghc-x86_64-linux-centos7-validate",
-      "BROKEN_TESTS": "T22012",
-      "BUILD_FLAVOUR": "validate",
-      "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
-      "HADRIAN_ARGS": "--docs=no-sphinx",
-      "RUNTEST_ARGS": "",
-      "TEST_ENV": "x86_64-linux-centos7-validate",
-      "XZ_OPT": "-9"
-    }
-  },
   "nightly-x86_64-linux-deb10-int_native-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
@@ -3433,71 +3369,6 @@
       "XZ_OPT": "-9"
     }
   },
-  "release-x86_64-linux-centos7-release+no_split_sections": {
-    "after_script": [
-      ".gitlab/ci.sh save_cache",
-      ".gitlab/ci.sh save_test_output",
-      ".gitlab/ci.sh clean",
-      "cat ci_timings"
-    ],
-    "allow_failure": false,
-    "artifacts": {
-      "expire_in": "1 year",
-      "paths": [
-        "ghc-x86_64-linux-centos7-release+no_split_sections.tar.xz",
-        "junit.xml",
-        "unexpected-test-output.tar.gz"
-      ],
-      "reports": {
-        "junit": "junit.xml"
-      },
-      "when": "always"
-    },
-    "cache": {
-      "key": "x86_64-linux-centos7-$CACHE_REV",
-      "paths": [
-        "cabal-cache",
-        "toolchain"
-      ]
-    },
-    "dependencies": [],
-    "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-centos7:$DOCKER_REV",
-    "needs": [
-      {
-        "artifacts": false,
-        "job": "hadrian-ghc-in-ghci"
-      }
-    ],
-    "rules": [
-      {
-        "if": "(\"true\" == \"true\") && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null)",
-        "when": "on_success"
-      }
-    ],
-    "script": [
-      "sudo chown ghc:ghc -R .",
-      ".gitlab/ci.sh setup",
-      ".gitlab/ci.sh configure",
-      ".gitlab/ci.sh build_hadrian",
-      ".gitlab/ci.sh test_hadrian"
-    ],
-    "stage": "full-build",
-    "tags": [
-      "x86_64-linux"
-    ],
-    "variables": {
-      "BIGNUM_BACKEND": "gmp",
-      "BIN_DIST_NAME": "ghc-x86_64-linux-centos7-release+no_split_sections",
-      "BROKEN_TESTS": "T22012",
-      "BUILD_FLAVOUR": "release+no_split_sections",
-      "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
-      "HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
-      "IGNORE_PERF_FAILURES": "all",
-      "RUNTEST_ARGS": "",
-      "TEST_ENV": "x86_64-linux-centos7-release+no_split_sections",
-      "XZ_OPT": "-9"
-    }
-  },
   "release-x86_64-linux-deb10-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",


=====================================
.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
=====================================
@@ -96,9 +96,6 @@ def darwin(arch):
 windowsArtifact = PlatformSpec ( 'x86_64-windows'
                                , 'ghc-{version}-x86_64-unknown-mingw32' )
 
-def centos(n, arch='x86_64'):
-    return linux_platform(arch, "x86_64-linux-centos{n}".format(n=n))
-
 def fedora(n, arch='x86_64'):
     return linux_platform(arch, "x86_64-linux-fedora{n}".format(n=n))
 
@@ -186,7 +183,7 @@ def mk_from_platform(release_mode, pipeline_type, platform):
                    , f"ghc{{version}}-{platform.name}")
 
 # Generate the new metadata for a specific GHC mode etc
-def mk_new_yaml(release_mode, version, date, pipeline_type, job_map):
+def mk_new_yaml(release_mode, version, date, pipeline_type, job_map) -> object:
     def mk(platform):
         eprint("\n=== " + platform.name + " " + ('=' * (75 - len(platform.name))))
         return mk_one_metadata(release_mode, version, job_map, mk_from_platform(release_mode, pipeline_type, platform))
@@ -195,14 +192,13 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map):
     ubuntu1804 = mk(ubuntu("18_04"))
     ubuntu2004 = mk(ubuntu("20_04"))
     rocky8 = mk(rocky("8"))
-    centos7 = mk(centos(7))
     fedora33 = mk(fedora(33))
     darwin_x86 = mk(darwin("x86_64"))
     darwin_arm64 = mk(darwin("aarch64"))
     windows = mk(windowsArtifact)
     alpine3_12 = mk(alpine("3_12"))
     alpine3_18 = mk(alpine("3_18"))
-    alpine3_18_arm64 = mk(alpine("3_18"), arch='aarch64')
+    alpine3_18_arm64 = mk(alpine("3_18", arch='aarch64'))
     deb9 = mk(debian(9, "x86_64"))
     deb10 = mk(debian(10, "x86_64"))
     deb11 = mk(debian(11, "x86_64"))
@@ -228,18 +224,15 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map):
           , "Linux_Mint"   : { "< 20": ubuntu1804
                              , ">= 20": ubuntu2004
                              , "unknown_versioning": ubuntu2004 }
-          , "Linux_CentOS"  : { "( >= 7 && < 8 )" : centos7
-                              , "unknown_versioning" : centos7  }
-          , "Linux_Fedora"  : { ">= 33": fedora33
-                              , "unknown_versioning": centos7 }
-          , "Linux_RedHat"  : { "< 9": centos7
+          , "Linux_Fedora"  : { ">= 33": fedora33 }
+          , "Linux_RedHat"  : { "< 9": rocky8
                               , ">= 9": fedora33
                               , "unknown_versioning": fedora33 }
           , "Linux_UnknownLinux" : { "unknown_versioning": rocky8 }
           , "Darwin" : { "unknown_versioning" : darwin_x86 }
           , "Windows" : { "unknown_versioning" :  windows }
-          , "Linux_Alpine" : { "( >= 3.12 && < 3.18 )": alpine_3_12
-                             , ">= 3.18": alpine_3_18
+          , "Linux_Alpine" : { "( >= 3.12 && < 3.18 )": alpine3_12
+                             , ">= 3.18": alpine3_18
                              , "unknown_versioning": alpine3_12 }
 
           }


=====================================
hadrian/cabal.project
=====================================
@@ -3,7 +3,7 @@ packages: ./
           ../libraries/ghc-platform/
 
 -- This essentially freezes the build plan for hadrian
--- It would be wise to keep this up to date with the state set in .gitlab/ci.sh.
+-- It would be wise to keep this up to date with the state set in ci.sh
 index-state: 2025-02-03T15:14:19Z
 
 -- unordered-containers-0.2.20-r1 requires template-haskell < 2.22


=====================================
hadrian/hadrian.cabal
=====================================
@@ -156,10 +156,7 @@ executable hadrian
                        , base                 >= 4.11    && < 5
                        , bytestring           >= 0.10    && < 0.13
                        , containers           >= 0.5     && < 0.8
-
-                         -- N.B. directory >=1.3.9 as earlier versions are
-                         -- afflicted by #24382.
-                       , directory            >= 1.3.9.0 && < 1.4
+                       , directory            >= 1.3.1.0 && < 1.4
                        , extra                >= 1.4.7
                        , filepath
                        , time


=====================================
hadrian/stack.yaml
=====================================
@@ -21,10 +21,3 @@ nix:
 extra-deps:
    - Cabal-3.10.1.0
    - Cabal-syntax-3.10.1.0
-
-# needed due to Hadrian's lower bound on directory
-   - directory-1.3.9.0
-   - file-io-0.1.4
-   - filepath-1.4.300.2
-   - process-1.6.25.0
-   - unix-2.8.5.1
\ No newline at end of file


=====================================
libraries/ghc-internal/CHANGELOG.md
=====================================
@@ -1,5 +1,5 @@
 # Revision history for `ghc-internal`
 
-## 0.1.0.0 -- YYYY-mm-dd
+## 9.1001.0 -- 2024-05-01
 
-* First version. Released on an unsuspecting world.
+* Package created containing implementation moved from `base`.


=====================================
libraries/ghc-internal/prologue.txt
=====================================
@@ -1,3 +1,2 @@
-This package contains the @Prelude@ and its support libraries, and a large
-collection of useful libraries ranging from data structures to parsing
-combinators and debugging utilities.
+This package contains the implementation of GHC's standard libraries and is
+not intended for use by end-users.


=====================================
libraries/os-string
=====================================
@@ -1 +1 @@
-Subproject commit e1dd3bcfab56a6616c73ee9220de425d55545bc8
+Subproject commit 6d31aafde2f7b8c3050ffee7dd9f658225cfd1a4


=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit 991b7e34efacc44a8a8b60e28ae737c45bc5942e
+Subproject commit a721bf58a3b9591473ceae938ac916cb9b0de2c0


=====================================
m4/find_llvm_prog.m4
=====================================
@@ -14,7 +14,7 @@ AC_DEFUN([FIND_LLVM_PROG],[
     PROG_VERSION_CANDIDATES=$(for llvmVersion in `seq $(($4-1)) -1 $3`; do echo "$2-$llvmVersion $2-$llvmVersion.0 $2$llvmVersion"; done)
     AC_CHECK_TOOLS([$1], [$PROG_VERSION_CANDIDATES $2], [])
     AS_IF([test x"$$1" != x],[
-        PROG_VERSION=`$$1 --version | sed -n -e 's/.*version \(\([[0-9]]\+\.\)\+[[0-9]]\+\).*/\1/gp'`
+        PROG_VERSION=`$$1 --version | sed -n -e 's/.*version \(\([[0-9]][[0-9]]*\.\)\([[0-9]][[0-9]]*\.\)*[[0-9]][[0-9]]*\).*/\1/gp'`
         AS_IF([test x"$PROG_VERSION" = x],
           [AC_MSG_RESULT(no)
            $1=""


=====================================
test.hs deleted
=====================================
@@ -1,14 +0,0 @@
-import Data.Char
-import Data.Foldable
--- | Just like 'GHC.ResponseFile.escapeArg', but it is not exposed from base.
-escapeArg :: String -> String
-escapeArg = reverse . foldl' escape []
-
-escape :: String -> Char -> String
-escape cs c
-  |    isSpace c
-    || '\\' == c
-    || '\'' == c
-    || '"'  == c = c:'\\':cs -- n.b., our caller must reverse the result
-  | otherwise    = c:cs
-


=====================================
testsuite/driver/testglobals.py
=====================================
@@ -223,10 +223,6 @@ class TestConfig:
         # I have no idea what this does
         self.package_conf_cache_file = None # type: Optional[Path]
 
-        # the libdir for the test compiler. Set by hadrian, see
-        # Setting.Builders.RunTest
-        self.libdir = ''
-
         # The extra hadrian dependencies we need for all configured tests
         self.hadrian_deps = set() # type: Set[str]
 


=====================================
testsuite/driver/testlib.py
=====================================
@@ -628,24 +628,15 @@ def collect_size ( deviation, path ):
 
 def get_dir_size(path):
     total = 0
-    try:
-        with os.scandir(path) as it:
-            for entry in it:
-                if entry.is_file():
-                    total += entry.stat().st_size
-                elif entry.is_dir():
-                    total += get_dir_size(entry.path)
-        return total
-    except FileNotFoundError:
-        print("Exception: Could not find: " + path)
+    with os.scandir(path) as it:
+        for entry in it:
+            if entry.is_file():
+                total += entry.stat().st_size
+            elif entry.is_dir():
+                total += get_dir_size(entry.path)
+    return total
 
 def collect_size_dir ( deviation, path ):
-
-    ## os.path.join joins the path with slashes (not backslashes) on windows
-    ## CI...for some reason, so we manually detect it here
-    sep = r"/"
-    if on_windows():
-        sep = r"\\"
     return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path) )
 
 # Read a number from a specific file
@@ -662,92 +653,7 @@ def collect_generic_stats ( metric_info ):
         return _collect_generic_stat(name, opts, metric_info)
     return f
 
-# wrap the call to collect_size_dir with path_from_ghcPkg in a function. Python
-# is call-by-value so if we placed the call in an all.T file then the python
-# interpreter would evaluate the call to path_from_ghcPkg
-def collect_size_ghc_pkg (deviation, library):
-    return collect_size_dir(deviation, path_from_ghcPkg(library, "library-dirs"))
-
-# same for collect_size and find_so
-def collect_object_size (deviation, library, use_non_inplace=False):
-    if use_non_inplace:
-        return collect_size(deviation, find_non_inplace_so(library))
-    else:
-        return collect_size(deviation, find_so(library))
-
-def path_from_ghcPkg (library, field):
-    """Find the field as a path for a library via a call to ghc-pkg. This is a
-    testsuite wrapper around a call to ghc-pkg field {library} {field}.
-    """
-
-    ### example output from ghc-pkg:
-    ###  $ ./ghc-pkg field Cabal library-dirs
-    ###    library-dirs: /home/doyougnu/programming/haskell/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240424/Cabal-3.11.0.0-inplace
-    ###    so we split the string and drop the 'library-dirs'
-    ghcPkgCmd = fr"{config.ghc_pkg} field {library} {field}"
-
-    try:
-        result = subprocess.run(ghcPkgCmd, capture_output=True, shell=True)
-
-        # check_returncode throws an exception if the return code is not 0.
-        result.check_returncode()
-
-        # if we get here then the call worked and we have the path we split by
-        # whitespace and then return the path which becomes the second element
-        # in the array
-        return re.split(r'\s+', result.stdout.decode("utf-8"))[1]
-    except Exception as e:
-        message = f"""
-        Attempt to find {field} of {library} using ghc-pkg failed.
-        ghc-pkg path: {config.ghc_pkg}
-        error" {e}
-        """
-        print(message)
-
-
-def _find_so(lib, directory, in_place):
-    """Find a shared object file (.so) for lib in directory. We deliberately
-    keep the regex simple, just removing the ghc version and project version.
-    Example:
-
-    _find_so("Cabal-syntax-3.11.0.0", path-from-ghc-pkg, True) ==>
-    /builds/ghc/ghc/_build/install/lib/ghc-9.11.20240410/lib/x86_64-linux-ghc-9.11.20240410/libHSCabal-syntax-3.11.0.0-inplace-ghc9.11.20240410.so
-    """
-
-    # produce the suffix for the CI operating system
-    suffix = "so"
-    if config.os == "mingw32":
-        suffix = "dll"
-    elif config.os == "darwin":
-        suffix = "dylib"
-
-    # Most artfacts are of the form foo-inplace, except for the rts.
-    if in_place:
-        to_match = r'libHS{}-\d+(\.\d+)+-inplace-\S+\.' + suffix
-    else:
-        to_match = r'libHS{}-\d+(\.\d+)+\S+\.' + suffix
-
-    matches = []
-    # wrap this in some exception handling, hadrian test will error out because
-    # these files don't exist yet, so we pass when this occurs
-    try:
-        for f in os.listdir(directory):
-            if f.endswith(suffix):
-                pattern = re.compile(to_match.format(re.escape(lib)))
-                match   = re.match(pattern, f)
-                if match:
-                    matches.append(match.group())
-        return os.path.join(directory, matches[0])
-    except:
-        failBecause('Could not find shared object file: ' + lib)
-
-def find_so(lib):
-    return _find_so(lib,path_from_ghcPkg(lib, "dynamic-library-dirs"),True)
-
-def find_non_inplace_so(lib):
-    return _find_so(lib,path_from_ghcPkg(lib, "dynamic-library-dirs"),False)
-
-# Define a generic stat test, which computes the statistic by calling the function
+# Define the a generic stat test, which computes the statistic by calling the function
 # given as the third argument.
 def collect_generic_stat ( metric, deviation, get_stat ):
     return collect_generic_stats ( { metric: { 'deviation': deviation, 'current': get_stat } } )


=====================================
testsuite/tests/perf/size/all.T
=====================================
@@ -3,80 +3,4 @@ test('size_hello_obj', [collect_size(5, 'size_hello_obj.o')], compile, [''])
 test('size_hello_artifact', [collect_size(5, 'size_hello_artifact' + exe_extension())],
                              compile_artifact, [''])
 
-size_acceptance_threshold = 100
-
-test('array_dir'           ,[collect_size_ghc_pkg(size_acceptance_threshold , 'array')]           , static_stats , [] )
-test('base_dir'            ,[collect_size_ghc_pkg(size_acceptance_threshold , 'base')]            , static_stats , [] )
-test('binary_dir'          ,[collect_size_ghc_pkg(size_acceptance_threshold , 'binary')]          , static_stats , [] )
-test('bytestring_dir'      ,[collect_size_ghc_pkg(size_acceptance_threshold , 'bytestring')]      , static_stats , [] )
-test('cabal_dir'           ,[collect_size_ghc_pkg(size_acceptance_threshold , 'Cabal')]           , static_stats , [] )
-test('cabal_syntax_dir'    ,[collect_size_ghc_pkg(size_acceptance_threshold , 'Cabal-syntax')]    , static_stats , [] )
-test('containers_dir'      ,[collect_size_ghc_pkg(size_acceptance_threshold , 'containers')]      , static_stats , [] )
-test('deepseq_dir'         ,[collect_size_ghc_pkg(size_acceptance_threshold , 'deepseq')]         , static_stats , [] )
-test('directory_dir'       ,[collect_size_ghc_pkg(size_acceptance_threshold , 'directory')]       , static_stats , [] )
-test('exceptions_dir'      ,[collect_size_ghc_pkg(size_acceptance_threshold , 'exceptions')]      , static_stats , [] )
-test('ghc_bignum_dir'      ,[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc-bignum')]      , static_stats , [] )
-test('ghc_boot_dir'        ,[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc-boot')]        , static_stats , [] )
-test('ghc_boot_th_dir'     ,[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc-boot-th')]     , static_stats , [] )
-test('ghc_compact_dir'     ,[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc-compact')]     , static_stats , [] )
-test('ghc_dir'             ,[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc')]             , static_stats , [] )
-test('ghc_experimental_dir',[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc-experimental')], static_stats , [] )
-test('ghc_heap_dir'        ,[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc-heap')]        , static_stats , [] )
-test('ghc_internal_dir'    ,[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc-internal')]    , static_stats , [] )
-test('ghc_platform_dir'    ,[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc-platform')]    , static_stats , [] )
-test('ghc_prim_dir'        ,[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc-prim')]        , static_stats , [] )
-test('ghc_toolchain_dir'   ,[collect_size_ghc_pkg(size_acceptance_threshold , 'ghc-toolchain')]   , static_stats , [] )
-test('haskeline_dir'       ,[collect_size_ghc_pkg(size_acceptance_threshold , 'haskeline')]       , static_stats , [] )
-test('hpc_dir'             ,[collect_size_ghc_pkg(size_acceptance_threshold , 'hpc')]             , static_stats , [] )
-test('integer_gmp_dir'     ,[collect_size_ghc_pkg(size_acceptance_threshold , 'integer-gmp')]     , static_stats , [] )
-test('mtl_dir'             ,[collect_size_ghc_pkg(size_acceptance_threshold , 'mtl')]             , static_stats , [] )
-test('os_string_dir'       ,[collect_size_ghc_pkg(size_acceptance_threshold , 'os-string')]       , static_stats , [] )
-test('parsec_dir'          ,[collect_size_ghc_pkg(size_acceptance_threshold , 'parsec')]          , static_stats , [] )
-test('pretty_dir'          ,[collect_size_ghc_pkg(size_acceptance_threshold , 'pretty')]          , static_stats , [] )
-test('process_dir'         ,[collect_size_ghc_pkg(size_acceptance_threshold , 'process')]         , static_stats , [] )
-test('time_dir'            ,[collect_size_ghc_pkg(size_acceptance_threshold , 'time')]            , static_stats , [] )
-test('xhtml_dir'           ,[collect_size_ghc_pkg(size_acceptance_threshold , 'xhtml')]           , static_stats , [] )
-
-# size of the entire libdir
-test('libdir'              ,[collect_size_dir(10, config.libdir)]                       , static_stats , [] )
-
-# skip these on windows
-test('unix_dir'     ,[windows_skip, collect_size_ghc_pkg(size_acceptance_threshold, 'unix')]    , static_stats, [] )
-test('terminfo_dir' ,[windows_skip, js_skip, collect_size_ghc_pkg(size_acceptance_threshold, 'terminfo')], static_stats, [] )
-
-# skip the shared object file tests on windows
-test('array_so'           ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "array")]            , static_stats, [] )
-test('base_so'            ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "base")]             , static_stats, [] )
-test('binary_so'          ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "binary")]           , static_stats, [] )
-test('bytestring_so'      ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "bytestring")]       , static_stats, [] )
-test('cabal_so'           ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "Cabal")]            , static_stats, [] )
-test('cabal_syntax_so'    ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "Cabal-syntax")]     , static_stats, [] )
-test('containers_so'      ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "containers")]       , static_stats, [] )
-test('deepseq_so'         ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "deepseq")]          , static_stats, [] )
-test('directory_so'       ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "directory")]        , static_stats, [] )
-test('exceptions_so'      ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "exceptions")]       , static_stats, [] )
-test('filepath_so'        ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "filepath")]         , static_stats, [] )
-test('ghc_bignum_so'      ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "ghc-bignum")]       , static_stats, [] )
-test('ghc_boot_so'        ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "ghc-boot")]         , static_stats, [] )
-test('ghc_boot_th_so'     ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "ghc-boot-th")]      , static_stats, [] )
-test('ghc_experimental_so',[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "ghc-experimental")] , static_stats, [] )
-test('ghc_heap_so'        ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "ghc-heap")]         , static_stats, [] )
-test('ghc_platform_so'    ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "ghc-platform")]     , static_stats, [] )
-test('ghc_prim_so'        ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "ghc-prim")]         , static_stats, [] )
-test('ghc_so'             ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "ghc")]              , static_stats, [] )
-test('ghc_toolchain_so'   ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "ghc-toolchain")]    , static_stats, [] )
-test('ghci_so'            ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "ghci")]             , static_stats, [] )
-test('haskeline_so'       ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "haskeline")]        , static_stats, [] )
-test('hpc_so'             ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "hpc")]              , static_stats, [] )
-test('mtl_so'             ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "mtl")]              , static_stats, [] )
-test('os_string_so'       ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "os-string")]        , static_stats, [] )
-test('parsec_so'          ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "parsec")]           , static_stats, [] )
-test('process_so'         ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "process")]          , static_stats, [] )
-# Disabled as extremely unstable
-#test('rts_so'             ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "rts", True)]              , static_stats, [] )
-test('template_haskell_so',[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "template-haskell")] , static_stats, [] )
-test('terminfo_so'        ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "terminfo")]         , static_stats, [] )
-test('text_so'            ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "text")]             , static_stats, [] )
-test('time_so'            ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "time")]             , static_stats, [] )
-test('transformers_so'    ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "transformers")]     , static_stats, [] )
-test('xhtml_so'           ,[req_dynamic_ghc, js_skip, windows_skip, collect_object_size(size_acceptance_threshold, "xhtml")]            , static_stats, [] )
+test('libdir',[collect_size_dir(10, config.libdir)], static_stats, [] )



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9968ac074d4d55f8611e241a089dea5b4ce9303b...f2e63a12313687e3aaeb052aa80ee8d7817052ec

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9968ac074d4d55f8611e241a089dea5b4ce9303b...f2e63a12313687e3aaeb052aa80ee8d7817052ec
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/20250314/f04bf3b4/attachment-0001.html>


More information about the ghc-commits mailing list