[Git][ghc/ghc][wip/ghc-9.6.7-backports] 2 commits: hadrian: don't pass -this-package-name to GHC 9.2

Luite Stegeman (@luite) gitlab at gitlab.haskell.org
Sun Jan 26 05:21:52 UTC 2025



Luite Stegeman pushed to branch wip/ghc-9.6.7-backports at Glasgow Haskell Compiler / GHC


Commits:
aa3a51d3 by Luite Stegeman at 2025-01-26T05:27:54+01:00
hadrian: don't pass -this-package-name to GHC 9.2

it's not supported

- - - - -
7f131c58 by Matthew Pickering at 2025-01-26T05:27:54+01:00
ghcup-metadata: Add --date flag to specify the release date

The ghcup-metadata now has a viReleaseDay field which needs to be
populated with the day of the release.

(cherry picked from commit 1121bdd858b165cca41f11c57b6c821b90b7f936)

- - - - -


4 changed files:

- .gitlab-ci.yml
- .gitlab/rel_eng/mk-ghcup-metadata/README.mkd
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- hadrian/src/Settings/Builders/Ghc.hs


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -1043,7 +1043,7 @@ ghcup-metadata-nightly:
       artifacts: false
     - job: project-version
   script:
-    - nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml"
+    - nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="$(date -d $CI_PIPELINE_CREATED_AT +%Y-%M-%d)" --pipeline-id="$CI_PIPELINE_ID" --version="$ProjectVersion" > "metadata_test.yaml"
   rules:
     - if: $NIGHTLY
 


=====================================
.gitlab/rel_eng/mk-ghcup-metadata/README.mkd
=====================================
@@ -18,6 +18,7 @@ options:
   --release-mode        Generate metadata which points to downloads folder
   --fragment            Output the generated fragment rather than whole modified file
   --version VERSION     Version of the GHC compiler
+  --date DATE           Date of the compiler release
 ```
 
 The script also requires the `.gitlab/jobs-metadata.yaml` file which can be generated


=====================================
.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
=====================================
@@ -193,7 +193,7 @@ def mk_from_platform(pipeline_type, platform):
 
 
 # Generate the new metadata for a specific GHC mode etc
-def mk_new_yaml(release_mode, version, pipeline_type, job_map):
+def mk_new_yaml(release_mode, version, date, pipeline_type, job_map):
     def mk(platform):
         eprint("\n=== " + platform.name + " " + ('=' * (75 - len(platform.name))))
         return mk_one_metadata(release_mode, version, job_map, mk_from_platform(pipeline_type, platform))
@@ -268,7 +268,13 @@ def mk_new_yaml(release_mode, version, pipeline_type, job_map):
     else:
         change_log =  "https://gitlab.haskell.org"
 
-    return { "viTags": ["Latest", "TODO_base_version"]
+    if release_mode:
+        tags =  ["Latest", "TODO_base_version"]
+    else:
+        tags = ["LatestNightly"]
+
+    return { "viTags": tags
+        , "viReleaseDay": date
         # Check that this link exists
         , "viChangeLog": change_log
         , "viSourceDL": source
@@ -305,6 +311,7 @@ def main() -> None:
     parser.add_argument('--fragment', action='store_true', help='Output the generated fragment rather than whole modified file')
     # TODO: We could work out the --version from the project-version CI job.
     parser.add_argument('--version', required=True, type=str, help='Version of the GHC compiler')
+    parser.add_argument('--date', required=True, type=str, help='Date of the compiler release')
     args = parser.parse_args()
 
     project = gl.projects.get(1, lazy=True)
@@ -325,7 +332,7 @@ def main() -> None:
     eprint(f"Pipeline Type: {pipeline_type}")
 
 
-    new_yaml = mk_new_yaml(args.release_mode, args.version, pipeline_type, job_map)
+    new_yaml = mk_new_yaml(args.release_mode, args.version, args.date, pipeline_type, job_map)
     if args.fragment:
         print(yaml.dump({ args.version : new_yaml }, Dumper=mk_dumper(args.version)))
 


=====================================
hadrian/src/Settings/Builders/Ghc.hs
=====================================
@@ -247,10 +247,10 @@ packageGhcArgs = do
             , packageDatabaseArgs
             -- We want to pass -this-unit-id for executables as well for multi-repl to
             -- work with executable packages but this is buggy on GHC-9.0.2
-            , (isLibrary package || (ghc_ver >= makeVersion [9,2,1])) ? mconcat
-                [ arg ("-this-unit-id " ++ pkgId)
-                , arg ("-this-package-name " ++ pkgName)
-                ]
+            , (isLibrary package || (ghc_ver >= makeVersion [9,2,1])) ?
+                arg ("-this-unit-id " ++ pkgId)
+            , (ghc_ver >= makeVersion [9,4,1]) ?
+                arg ("-this-package-name " ++ pkgName)
             , map ("-package-id " ++) <$> getContextData depIds ]
 
 includeGhcArgs :: Args



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4ccbf2ce5c1a6a9c44873f5e3067571261f40278...7f131c5873556d906c6cf46cf2d1eca31efb24d2

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4ccbf2ce5c1a6a9c44873f5e3067571261f40278...7f131c5873556d906c6cf46cf2d1eca31efb24d2
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/20250126/0d7d1e9a/attachment-0001.html>


More information about the ghc-commits mailing list