[Git][ghc/ghc][wip/release-fixes] 5 commits: gitlab/rel_eng: Fix name of Rocky8 artifact

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Mar 11 20:25:22 UTC 2024



Ben Gamari pushed to branch wip/release-fixes at Glasgow Haskell Compiler / GHC


Commits:
da97c238 by Ben Gamari at 2024-03-09T20:08:12-05:00
gitlab/rel_eng: Fix name of Rocky8 artifact

- - - - -
d7fa9dd9 by Ben Gamari at 2024-03-09T20:08:46-05:00
gitlab/rel_eng: Fix path of generate_jobs_metadata

- - - - -
5fb7591d by Ben Gamari at 2024-03-09T20:28:41-05:00
gitlab/upload: Rework recompression

The old `combine` approach was quite fragile due to use of filename
globbing. Moreover, it didn't parallelize well. This refactoring
makes the goal more obvious, parallelizes better, and is more robust.

- - - - -
3e109143 by Ben Gamari at 2024-03-11T16:24:22-04:00
hadrian/bindist: Eliminate extraneous `dirname` invocation

Previously we would call `dirname` twice per installed library file.
We now instead reuse this result. This helps appreciably on Windows, where
processes are quite expensive.

- - - - -
7c32c59b by Ben Gamari at 2024-03-11T16:24:24-04:00
hadrian: Package mingw toolchain in expected location

This fixes #24525, a regression due to 41cbaf44a6ab5eb9fa676d65d32df8377898dc89.
Specifically, GHC expects to find the mingw32 toolchain in the binary distribution
root. However, after this patch it was packaged in the `lib/` directory.

- - - - -


7 changed files:

- .gitlab/rel_eng/default.nix
- .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py
- .gitlab/rel_eng/mk-ghcup-metadata/README.mkd
- + .gitlab/rel_eng/recompress-all
- .gitlab/rel_eng/upload.sh
- hadrian/bindist/Makefile
- hadrian/src/Rules/BinaryDist.hs


Changes:

=====================================
.gitlab/rel_eng/default.nix
=====================================
@@ -27,6 +27,15 @@ let
     buildCommand = ''
       mkdir -p $out/bin
 
+      makeWrapper ${./recompress-all} $out/bin/recompress-all \
+        --prefix PATH : ${gnumake}/bin \
+        --prefix PATH : ${gnutar}/bin \
+        --prefix PATH : ${lzip}/bin \
+        --prefix PATH : ${bzip2}/bin \
+        --prefix PATH : ${gzip}/bin \
+        --prefix PATH : ${xz}/bin \
+        --prefix PATH : ${zip}/bin
+
       makeWrapper ${./upload.sh} $out/bin/upload.sh \
         --prefix PATH : ${moreutils}/bin \
         --prefix PATH : ${lftp}/bin \
@@ -35,8 +44,8 @@ let
         --prefix PATH : ${s3cmd}/bin \
         --prefix PATH : ${gnupg}/bin \
         --prefix PATH : ${pinentry}/bin \
-        --prefix PATH : ${parallel}/bin \
         --prefix PATH : ${python3}/bin \
+        --prefix PATH : $out/bin \
         --set ENTER_FHS_ENV ${bindistPrepEnv}/bin/enter-fhs \
         --set BASH ${bash}/bin/bash
 


=====================================
.gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py
=====================================
@@ -18,7 +18,7 @@ def job_triple(job_name):
     bindists = {
         'release-x86_64-windows-release': 'x86_64-unknown-mingw32',
         'release-x86_64-windows-int_native-release': 'x86_64-unknown-mingw32-int_native',
-        'release-x86_64-rocky8-release': 'x86_64-rocky8-linux',
+        'release-x86_64-linux-rocky8-release': 'x86_64-rocky8-linux',
         'release-x86_64-linux-ubuntu20_04-release': 'x86_64-ubuntu20_04-linux',
         'release-x86_64-linux-ubuntu18_04-release': 'x86_64-ubuntu18_04-linux',
         'release-x86_64-linux-fedora33-release+debug_info': 'x86_64-fedora33-linux-dwarf',


=====================================
.gitlab/rel_eng/mk-ghcup-metadata/README.mkd
=====================================
@@ -22,7 +22,7 @@ options:
 ```
 
 The script also requires the `.gitlab/jobs-metadata.yaml` file which can be generated
-by running `.gitlab/generate_jobs_metadata` script if you want to run it locally.
+by running `.gitlab/generate-ci/generate_jobs_metadata` script if you want to run it locally.
 
 
 ## CI Pipelines


=====================================
.gitlab/rel_eng/recompress-all
=====================================
@@ -0,0 +1,29 @@
+#!/usr/bin/env -S make -f
+
+MAKEFLAGS += --no-builtin-rules
+MAKEFLAGS += --no-builtin-variables
+
+usage :
+	echo "recompress [dest files]"
+	exit 1
+
+%.gz : %.xz
+	echo "[xz->gz] $< to $@..."
+	xz -c $< | gzip -c > $@
+
+%.bz2 : %.xz
+	echo "[xz->bz2] $< to $@..."
+	xz -c $< | bzip2 -c > $@
+
+%.lz : %.xz
+	echo "[xz->lz] $< to $@..."
+	xz -c $< | lzip -c > $@
+
+%.zip : %.tar.xz
+	echo "[tarxz->zip] $< to $@..."
+	tmp="$(mktemp tmp.XXX)" && \
+		tar -C "$$tmp" -xf $< && \
+		cd "$$tmp" && \
+		zip -9 -r $@ * && \
+		rm -R "$$tmp"
+


=====================================
.gitlab/rel_eng/upload.sh
=====================================
@@ -193,29 +193,21 @@ function prepare_docs() {
 
 function recompress() {
     set -Eeuo pipefail
-    combine <(basename -s .xz *.xz) not <(basename -s .lz *.lz) | \
-        parallel 'echo "Recompressing {}.xz to {}.lz"; unxz -c {}.xz | lzip - -o {}.lz'
-
-    for darwin_bindist in $(ls ghc-*-darwin.tar.xz); do
-        local dest="$(basename $darwin_bindist .xz).bz2"
-        if [[ ! -f "$dest" ]]; then
-            echo "Recompressing Darwin bindist to bzip2..."
-            unxz -c "$darwin_bindist" | bzip2 > "$dest"
-        fi
+    needed=()
+
+    for i in ghc-*.tar.xz; do
+        needed+=( "$(basename $i .xz).gz" )
     done
 
-    for windows_bindist in $(ls ghc-*-mingw32*.tar.xz); do
-      local tmp="$(mktemp -d tmp.XXX)"
-      local dest="$(realpath $(basename $windows_bindist .tar.xz).zip)"
-      echo $dest
-      if [[ ! -f "$dest" ]]; then
-          echo "Recompressing Windows bindist to zip..."
-          tar -C "$tmp" -xf "$windows_bindist"
-          ls $tmp
-          (cd "$tmp"; zip -9 -r "$dest" *)
-      fi
-      rm -R "$tmp"
+    for i in ghc-*-darwin.tar.xz; do
+        needed+=( "$(basename $i .xz).bz2" )
     done
+
+    for i in ghc-*-mingw32.tar.xz; do
+        needed+=( "$(basename $i .tar.xz).zip" )
+    done
+
+    recompress-all -l ${needed[@]}
 }
 
 function upload_docs() {


=====================================
hadrian/bindist/Makefile
=====================================
@@ -175,18 +175,19 @@ install_lib: lib/settings
 	@dest="$(DESTDIR)$(ActualLibsDir)"; \
 	cd lib; \
 	for i in `$(FIND) . -type f`; do \
-		$(INSTALL_DIR) "$$dest/`dirname $$i`" ; \
+		dir="`dirname $$i`"
+		$(INSTALL_DIR) "$$dest/$$dir" ; \
 		case $$i in \
 		  *.a) \
-		    $(INSTALL_DATA) $$i "$$dest/`dirname $$i`" ; \
+		    $(INSTALL_DATA) $$i "$$dest/$$dir" ; \
 		    $(RANLIB_CMD) "$$dest"/$$i ;; \
 		  *.dll) \
-		    $(INSTALL_PROGRAM) $$i "$$dest/`dirname $$i`" ; \
+		    $(INSTALL_PROGRAM) $$i "$$dest/$$dir" ; \
 		    $(STRIP_CMD) "$$dest"/$$i ;; \
 		  *.so) \
-		    $(INSTALL_SHLIB) $$i "$$dest/`dirname $$i`" ;; \
+		    $(INSTALL_SHLIB) $$i "$$dest/$$dir" ;; \
 		  *.dylib) \
-		    $(INSTALL_SHLIB) $$i "$$dest/`dirname $$i`" ;; \
+		    $(INSTALL_SHLIB) $$i "$$dest/$$dir" ;; \
 		  *.mjs) \
 		    $(INSTALL_SCRIPT) $$i "$$dest/`dirname $$i`" ;; \
 		  *) \


=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -135,7 +135,8 @@ bindistRules = do
         let ghcVersionPretty = "ghc-" ++ version ++ "-" ++ targetPlatform
         let prefix = cwd -/- root -/- "reloc-bindist" -/- ghcVersionPretty
         installTo Relocatable prefix
-
+        copyDirectory (root -/- "mingw") prefix
+        liftIO $ IO.removeDirectoryRecursive (prefix -/- "lib" -/- "mingw")
 
     phony "install" $ do
         need ["binary-dist-dir"]
@@ -145,8 +146,6 @@ bindistRules = do
         installTo NotRelocatable installPrefix
 
     phony "binary-dist-dir" $ do
-
-
         version        <- setting ProjectVersion
         targetPlatform <- setting TargetPlatformFull
         distDir        <- Context.distDir Stage1
@@ -309,7 +308,7 @@ bindistRules = do
 
     let buildBinDist compressor = do
           win_target <- isWinTarget
-          when win_target (error "normal binary-dist does not work for windows target, use `reloc-binary-dist-*` target instead.")
+          when win_target (error "normal binary-dist does not work for Windows targets, use `reloc-binary-dist-*` target instead.")
           buildBinDistX "binary-dist-dir" "bindist" compressor
         buildBinDistReloc = buildBinDistX "reloc-binary-dist-dir" "reloc-bindist"
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/865d73393d91b6f86310c9729a05a7fe871aaa6f...7c32c59b924f59ce0718f5894b7ff0ebdb85fe65

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/865d73393d91b6f86310c9729a05a7fe871aaa6f...7c32c59b924f59ce0718f5894b7ff0ebdb85fe65
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/20240311/2cd73195/attachment-0001.html>


More information about the ghc-commits mailing list