[Git][ghc/ghc][ghc-9.8] 3 commits: ghcup-metadata: Don't populate dlOutput unless necessary

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Tue Dec 10 20:53:15 UTC 2024



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


Commits:
d5e3a630 by Ben Gamari at 2024-12-02T10:25:22-05:00
ghcup-metadata: Don't populate dlOutput unless necessary

ghcup can apparently infer the output name of an artifact from its URL.
Consequently, we should only include the `dlOutput` field when it would
differ from the filename of `dlUri`.

Fixes #24547.

(cherry picked from commit 6d398066b6084a971248da8ce37bc40c53a83525)
(cherry picked from commit 878e8529a09abc213d11f76e6bdafa769578aa30)

- - - - -
a60b882c by Ben Gamari at 2024-12-02T19:57:56-05:00
mk-ghcup-metadata: Fix directory of testsuite tarball

As reported in #24546, the `dlTest` artifact should be extracted into
the `testsuite` directory.

(cherry picked from commit 9d936c5799daadf96392211b03e38520925aea17)

- - - - -
6071fec3 by Matthew Pickering at 2024-12-10T09:58:11-05:00
compiler: Remove unused `containers.h` include

Fixes #23712

(cherry picked from commit 02e6a6ceac761d62ed30817b9525d952bca599ac)

- - - - -


10 changed files:

- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC/Data/Word64Map.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Lazy.hs
- compiler/GHC/Data/Word64Map/Strict.hs
- compiler/GHC/Data/Word64Map/Strict/Internal.hs
- compiler/GHC/Data/Word64Set.hs
- compiler/GHC/Data/Word64Set/Internal.hs
- compiler/GHC/Utils/Containers/Internal/BitUtil.hs
- compiler/GHC/Utils/Containers/Internal/StrictPair.hs


Changes:

=====================================
.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
=====================================
@@ -36,6 +36,7 @@ import os
 import yaml
 import gitlab
 from urllib.request import urlopen
+from urllib.parse import urlparse
 import hashlib
 import sys
 import json
@@ -80,7 +81,7 @@ source_artifact = Artifact('source-tarball'
 test_artifact = Artifact('source-tarball'
                         , 'ghc-{version}-testsuite.tar.xz'
                         , 'ghc-{version}-testsuite.tar.xz'
-                        , 'ghc-{version}' )
+                        , 'ghc-{version}/testsuite' )
 
 def debian(arch, n):
     return linux_platform(arch, "{arch}-linux-deb{n}".format(arch=arch, n=n))
@@ -156,13 +157,18 @@ def mk_one_metadata(release_mode, version, job_map, artifact):
     eprint(f"Bindist URL: {url}")
     eprint(f"Download URL: {final_url}")
 
-    #Download and hash from the release pipeline, this must not change anyway during upload.
+    # Download and hash from the release pipeline, this must not change anyway during upload.
     h = download_and_hash(url)
 
     res = { "dlUri": final_url
           , "dlSubdir": artifact.subdir.format(version=version)
-          , "dlOutput": artifact.output_name.format(version=version)
           , "dlHash" : h }
+
+    # Only add dlOutput if it is inconsistent with the filename inferred from the URL
+    output = artifact.output_name.format(version=version)
+    if Path(urlparse(final_url).path).name != output:
+        res["dlOutput"] = output
+
     eprint(res)
     return res
 


=====================================
compiler/GHC/Data/Word64Map.hs
=====================================
@@ -8,7 +8,6 @@
 {-# LANGUAGE MonoLocalBinds #-}
 #endif
 
-#include "containers.h"
 
 -----------------------------------------------------------------------------
 -- |


=====================================
compiler/GHC/Data/Word64Map/Internal.hs
=====================================
@@ -14,7 +14,6 @@
 {-# OPTIONS_HADDOCK not-home #-}
 {-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}
 
-#include "containers.h"
 
 -----------------------------------------------------------------------------
 -- |


=====================================
compiler/GHC/Data/Word64Map/Lazy.hs
=====================================
@@ -3,7 +3,6 @@
 {-# LANGUAGE Safe #-}
 #endif
 
-#include "containers.h"
 
 -----------------------------------------------------------------------------
 -- |


=====================================
compiler/GHC/Data/Word64Map/Strict.hs
=====================================
@@ -4,8 +4,6 @@
 {-# LANGUAGE Trustworthy #-}
 #endif
 
-#include "containers.h"
-
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Word64Map.Strict


=====================================
compiler/GHC/Data/Word64Map/Strict/Internal.hs
=====================================
@@ -4,8 +4,6 @@
 
 {-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}
 
-#include "containers.h"
-
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Word64Map.Strict.Internal


=====================================
compiler/GHC/Data/Word64Set.hs
=====================================
@@ -3,8 +3,6 @@
 {-# LANGUAGE Safe #-}
 #endif
 
-#include "containers.h"
-
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Word64Set


=====================================
compiler/GHC/Data/Word64Set/Internal.hs
=====================================
@@ -12,8 +12,6 @@
 
 {-# OPTIONS_HADDOCK not-home #-}
 
-#include "containers.h"
-
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Word64Set.Internal


=====================================
compiler/GHC/Utils/Containers/Internal/BitUtil.hs
=====================================
@@ -6,8 +6,6 @@
 {-# LANGUAGE Safe #-}
 #endif
 
-#include "containers.h"
-
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Utils.Containers.Internal.BitUtil


=====================================
compiler/GHC/Utils/Containers/Internal/StrictPair.hs
=====================================
@@ -3,8 +3,6 @@
 {-# LANGUAGE Safe #-}
 #endif
 
-#include "containers.h"
-
 -- | A strict pair
 
 module GHC.Utils.Containers.Internal.StrictPair (StrictPair(..), toPair) where



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a3401159f2846605abb517e71af463df47398e72...6071fec3ee92cb43cf49d48615b30c3198bbb9e1

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a3401159f2846605abb517e71af463df47398e72...6071fec3ee92cb43cf49d48615b30c3198bbb9e1
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/20241210/21779e62/attachment-0001.html>


More information about the ghc-commits mailing list