[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: testsuite: Delay querying ghc-pkg to find .so dirs until test is run

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Jul 19 09:54:10 UTC 2024



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
501feff8 by Matthew Pickering at 2024-07-19T05:53:54-04:00
testsuite: Delay querying ghc-pkg to find .so dirs until test is run

The tests which relied on find_so would fail when `test` was run
before the tree was built. This was because `find_so` was evaluated too
eagerly.

We can fix this by waiting to query the location of the libraries until
after the compiler has built them.

- - - - -
98886cf8 by Torsten Schmits at 2024-07-19T05:53:54-04:00
Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface`

!12347 and !12582 introduced breaking changes to these two constructors
and mitigated that with pattern synonyms.

- - - - -
223e66bb by Matthew Pickering at 2024-07-19T05:53:54-04:00
ci: Fix ghcup-metadata generation (again)

I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604

* Syntax error
* The aarch-deb11 bindist doesn't exist

I tested against the latest nightly pipeline locally:

```
nix run .gitlab/generate-ci#generate-job-metadata
nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta
```

- - - - -


4 changed files:

- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC/Unit/Module/Location.hs
- compiler/GHC/Unit/Module/ModIface.hs
- testsuite/driver/testlib.py


Changes:

=====================================
.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
=====================================
@@ -205,7 +205,6 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map):
     deb11 = mk(debian(11, "x86_64"))
     deb12 = mk(debian(12, "x86_64"))
     deb10_arm64 = mk(debian(10, "aarch64"))
-    deb11_arm64 = mk(debian(11, "aarch64"))
     deb12_arm64 = mk(debian(12, "aarch64"))
     deb10_i386 = mk(debian(10, "i386"))
     deb12_i386 = mk(debian(12, "i386"))
@@ -243,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map):
 
     a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386
                             , ">= 12": deb12_i386
-                            , "unknown versioning": deb10_i386 }}
+                            , "unknown versioning": deb10_i386 }
           , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 }
           , "Linux_Mint" : { "unknown_versioning": deb10_i386 }
           , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 }
@@ -251,8 +250,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map):
 
     arm64 = { "Linux_UnknownLinux": { "unknown_versioning": deb10_arm64 }
             , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 }
-            , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64
-                              , "( >= 11 && < 12 )": deb11_arm64
+            , "Linux_Debian": { "( >= 10 && < 12 )": deb10_arm64
                               , "( >= 12 )": deb12_arm64
                               , "unknown_versioning": deb10_arm64
                               }


=====================================
compiler/GHC/Unit/Module/Location.hs
=====================================
@@ -142,6 +142,8 @@ mkFileSrcSpan mod_loc
 -- Helpers for backwards compatibility
 -- ----------------------------------------------------------------------------
 
+{-# COMPLETE ModLocation #-}
+
 pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation
 pattern ModLocation
   { ml_hs_file


=====================================
compiler/GHC/Unit/Module/ModIface.hs
=====================================
@@ -953,6 +953,7 @@ However, with the pragma, the correct core is generated:
 {-# INLINE mi_ext_fields #-}
 {-# INLINE mi_src_hash #-}
 {-# INLINE mi_hi_bytes #-}
+{-# COMPLETE ModIface #-}
 
 pattern ModIface ::
   Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] ->


=====================================
testsuite/driver/testlib.py
=====================================
@@ -621,7 +621,10 @@ def _extra_files(name, opts, files):
 
 # Record the size of a specific file
 def collect_size ( deviation, path ):
-    return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path)) )
+    return collect_size_func(deviation, lambda: path)
+
+def collect_size_func ( deviation, path_func ):
+    return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path_func())) )
 
 def get_dir_size(path):
     total = 0
@@ -637,13 +640,11 @@ def get_dir_size(path):
         print("Exception: Could not find: " + path)
 
 def collect_size_dir ( deviation, path ):
+    return collect_size_dir_func ( deviation, lambda: 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) )
+# Like collect_size_dir but the path is passed as a function which can be evaluated later.
+def collect_size_dir_func( deviation, path_func ):
+    return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path_func()) )
 
 # Read a number from a specific file
 def stat_from_file ( metric, deviation, path ):
@@ -663,14 +664,14 @@ def collect_generic_stats ( metric_info ):
 # 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"))
+    return collect_size_dir_func(deviation, lambda: 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))
+        return collect_size_func(deviation, lambda: find_non_inplace_so(library))
     else:
-        return collect_size(deviation, find_so(library))
+        return collect_size_func(deviation, lambda: 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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/743296c4f63b52322ea1be87f199db9be66a75ab...223e66bbf157639b7c4d1a3f73f6034dd0b2ea73

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/743296c4f63b52322ea1be87f199db9be66a75ab...223e66bbf157639b7c4d1a3f73f6034dd0b2ea73
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/20240719/67377d90/attachment-0001.html>


More information about the ghc-commits mailing list