[Git][ghc/ghc][master] testsuite: make find_so regex less general

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri May 17 13:01:14 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
04179044 by doyougnu at 2024-05-17T09:00:32-04:00
testsuite: make find_so regex less general

Closes #24759

Background. In MR !12372 we began tracking shared object files and
directories sizes for dependencies. However, this broke  release builds
because release builds alter the filenames swapping "in-place" for a
hash. This was not considered in the MR and thus broke release
pipelines. Furthermore, the rts_so test was found to be wildly varying
and was therefore disabled in !12561.

This commit fixes both of these issues:

- fix the rts_so test by making the regex less general, now the rts_so
test and all other foo.so tests must match
"libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the
rts_so test from accidentally matching different rts variants such as
rts_threaded, which was the cause of the wild swings after !12372.

- add logic to match either a hash or the string in-place. This should
make the find_so function build agnostic.

- - - - -


2 changed files:

- testsuite/driver/testlib.py
- testsuite/tests/perf/size/all.T


Changes:

=====================================
testsuite/driver/testlib.py
=====================================
@@ -713,6 +713,9 @@ def _find_so(lib, directory, in_place):
 
     _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
+
+    For a release build the filename replaces "inplace" for a hash (765d in
+    this case): libHSCabal-3.12.0.0-765d-ghc9.11.20240508.so
     """
 
     # produce the suffix for the CI operating system
@@ -722,11 +725,15 @@ def _find_so(lib, directory, in_place):
     elif config.os == "darwin":
         suffix = "dylib"
 
-    # Most artfacts are of the form foo-inplace, except for the rts.
+    # Most artfacts are of the form foo-inplace, or foo-<hash> for release
+    # builds, except for the rts.
+    # "\d+(\.\d+)+" matches version numbers, such as 3.12.0.0 in the above example
+    # "\w+"         matches the hash on release builds or "inplace", such as 765d in the example
+    # "ghc\S+"      matches the ghc build name: ghc9.11.20240508
     if in_place:
-        to_match = r'libHS{}-\d+(\.\d+)+-inplace-\S+\.' + suffix
+        to_match = r'libHS{}-\d+(\.\d+)+-\w+-ghc\S+\.' + suffix
     else:
-        to_match = r'libHS{}-\d+(\.\d+)+\S+\.' + suffix
+        to_match = r'libHS{}-\d+(\.\d+)+-ghc\S+\.' + suffix
 
     matches = []
     # wrap this in some exception handling, hadrian test will error out because


=====================================
testsuite/tests/perf/size/all.T
=====================================
@@ -72,8 +72,7 @@ test('mtl_so'             ,[req_dynamic_ghc, js_skip, windows_skip, collect_obje
 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('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, [] )



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/04179044be3cf31eddff324aa7570a3ef39ce3d1

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/04179044be3cf31eddff324aa7570a3ef39ce3d1
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/20240517/9486e387/attachment-0001.html>


More information about the ghc-commits mailing list