@@ -165,14 +165,20 @@ jobs:
165165 cd emsdk
166166 source ./emsdk_env.sh
167167 cd ..
168- ${{ env.MAKE }} _build/bindist/ghc.tar.gz _build/bindist/ghc-javascript-unknown-ghcjs.tar.gz _build/bindist/tests.tar.gz
168+ ${{ env.MAKE }} _build/bindist/stage2/ ghc.tar.gz _build/bindist/stage3 /ghc-javascript-unknown-ghcjs.tar.gz _build/bindist/tests.tar.gz
169169 else
170- ${{ env.MAKE }} _build/bindist/ghc.tar.gz _build/bindist/tests.tar.gz
170+ ${{ env.MAKE }} _build/bindist/stage2/ ghc.tar.gz _build/bindist/tests.tar.gz
171171 fi
172172 cd _build/bindist
173- mv ghc.tar.gz ghc-$(bin/ghc --numeric-version)-${ARTIFACT}.tar.gz
173+ (
174+ cd stage2
175+ mv ghc.tar.gz ghc-$(bin/ghc --numeric-version)-${ARTIFACT}.tar.gz
176+ )
174177 if [ -e "ghc-javascript-unknown-ghcjs.tar.gz" ] ; then
175- mv ghc-javascript-unknown-ghcjs.tar.gz ghc-javascript-unknown-ghcjs-$(bin/ghc --numeric-version)-${ARTIFACT}.tar.gz
178+ (
179+ cd stage3
180+ mv ghc-javascript-unknown-ghcjs.tar.gz ghc-javascript-unknown-ghcjs-$(bin/ghc --numeric-version)-${ARTIFACT}.tar.gz
181+ )
176182 fi
177183 mv tests.tar.gz tests-${ARTIFACT}.tar.gz
178184 env :
@@ -185,8 +191,10 @@ jobs:
185191 if-no-files-found : error
186192 retention-days : 2
187193 name : artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }}
188- path : |
194+ path : &upload-paths |
189195 ./_build/bindist/*.tar.gz
196+ ./_build/bindist/stage2/*.tar.gz
197+ ./_build/bindist/stage3/*.tar.gz
190198
191199 build-arm :
192200 name : Build ARM binary
@@ -211,13 +219,13 @@ jobs:
211219 uses : docker://arm64v8/debian:11
212220 name : Run build (aarch64 linux)
213221 with :
214- args : sh -c "apt-get update && apt-get install -y curl bash git ${{ needs.tool-output.outputs.apt_tools_build }} && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/refs/heads/stable-haskell-0.0.1/stable-haskell-0.0.9.yaml && ghcup install ghc --set ${{ env.GHC_VERSION }} && ghcup install cabal --set ${{ env.CABAL_VERSION }} && make USE_SYSTEM_CABAL=1 _build/bindist/ghc.tar.gz _build/bindist/tests.tar.gz && cd _build/bindist && mv ghc.tar.gz ghc-$(bin/ghc --numeric-version)-${{ matrix.platform.ARTIFACT }}.tar.gz && mv tests.tar.gz tests-${{ matrix.platform.ARTIFACT }}.tar.gz"
222+ args : sh -c "apt-get update && apt-get install -y curl bash git ${{ needs.tool-output.outputs.apt_tools_build }} && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/refs/heads/stable-haskell-0.0.1/stable-haskell-0.0.9.yaml && ghcup install ghc --set ${{ env.GHC_VERSION }} && ghcup install cabal --set ${{ env.CABAL_VERSION }} && make USE_SYSTEM_CABAL=1 _build/bindist/stage2/ ghc.tar.gz _build/bindist/tests.tar.gz && cd _build/bindist/stage2 && mv ghc.tar.gz ghc-$(bin/ghc --numeric-version)-${{ matrix.platform.ARTIFACT }}.tar.gz && cd .. && mv tests.tar.gz tests-${{ matrix.platform.ARTIFACT }}.tar.gz"
215223
216224 - if : matrix.platform.ARTIFACT == 'aarch64-linux-unknown'
217225 uses : docker://arm64v8/alpine:3.20
218226 name : Run build (aarch64 linux alpine)
219227 with :
220- args : sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools_build }} && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/refs/heads/stable-haskell-0.0.1/stable-haskell-0.0.9.yaml && ghcup install ghc --set ${{ env.GHC_VERSION }} && ghcup install cabal --set ${{ env.CABAL_VERSION }} && make USE_SYSTEM_CABAL=1 _build/bindist/ghc.tar.gz _build/bindist/tests.tar.gz && cd _build/bindist && mv ghc.tar.gz ghc-$(bin/ghc --numeric-version)-${{ matrix.platform.ARTIFACT }}.tar.gz && mv tests.tar.gz tests-${{ matrix.platform.ARTIFACT }}.tar.gz"
228+ args : sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools_build }} && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/refs/heads/stable-haskell-0.0.1/stable-haskell-0.0.9.yaml && ghcup install ghc --set ${{ env.GHC_VERSION }} && ghcup install cabal --set ${{ env.CABAL_VERSION }} && make USE_SYSTEM_CABAL=1 _build/bindist/stage2/ ghc.tar.gz _build/bindist/tests.tar.gz && cd _build/bindist/stage2 && mv ghc.tar.gz ghc-$(bin/ghc --numeric-version)-${{ matrix.platform.ARTIFACT }}.tar.gz && cd .. && mv tests.tar.gz tests-${{ matrix.platform.ARTIFACT }}.tar.gz"
221229
222230 - if : always()
223231 name : Upload artifact
@@ -226,8 +234,7 @@ jobs:
226234 if-no-files-found : error
227235 retention-days : 2
228236 name : artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }}
229- path : |
230- ./_build/bindist/*.tar.gz
237+ path : *upload-paths
231238
232239 build-mac-x86_64 :
233240 name : Build binary (Mac x86_64)
@@ -273,8 +280,7 @@ jobs:
273280 if-no-files-found : error
274281 retention-days : 2
275282 name : artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
276- path : |
277- ./_build/bindist/*.tar.gz
283+ path : *upload-paths
278284
279285 build-mac-aarch64 :
280286 name : Build binary (Mac aarch64)
@@ -318,8 +324,7 @@ jobs:
318324 if-no-files-found : error
319325 retention-days : 2
320326 name : artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
321- path : |
322- ./_build/bindist/*.tar.gz
327+ path : *upload-paths
323328
324329 build-windows :
325330 name : Build binary (Windows)
@@ -367,8 +372,7 @@ jobs:
367372 if-no-files-found : error
368373 retention-days : 2
369374 name : artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
370- path : |
371- ./_build/bindist/*.tar.gz
375+ path : *upload-paths
372376
373377 build-freebsd-x86_64 :
374378 name : Build FreeBSD x86_64
@@ -430,10 +434,16 @@ jobs:
430434 which ghc
431435 ghc --info
432436 cabal update
433- gmake _build/bindist/ghc.tar.gz _build/bindist/ghc-javascript-unknown-ghcjs.tar.gz _build/bindist/tests.tar.gz
437+ gmake _build/bindist/stage2/ ghc.tar.gz _build/bindist/stage3 /ghc-javascript-unknown-ghcjs.tar.gz _build/bindist/tests.tar.gz
434438 cd _build/bindist
435- mv ghc.tar.gz ghc-$(bin/ghc --numeric-version)-${{ env.ARTIFACT }}.tar.gz
436- mv ghc-javascript-unknown-ghcjs.tar.gz ghc-javascript-unknown-ghcjs-$(bin/ghc --numeric-version)-${{ env.ARTIFACT }}.tar.gz
439+ (
440+ cd stage2
441+ mv ghc.tar.gz ghc-$(bin/ghc --numeric-version)-${{ env.ARTIFACT }}.tar.gz
442+ )
443+ (
444+ cd stage3
445+ mv ghc-javascript-unknown-ghcjs.tar.gz ghc-javascript-unknown-ghcjs-$(bin/ghc --numeric-version)-${{ env.ARTIFACT }}.tar.gz
446+ )
437447 mv tests.tar.gz tests-${{ env.ARTIFACT }}.tar.gz
438448 env :
439449 EXTRA_LIB_DIRS : /usr/local/lib
@@ -447,8 +457,7 @@ jobs:
447457 if-no-files-found : error
448458 retention-days : 2
449459 name : artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }}
450- path : |
451- ./_build/bindist/*.tar.gz
460+ path : *upload-paths
452461
453462 test-linux :
454463 name : Test linux binaries
@@ -577,16 +586,16 @@ jobs:
577586 rm -rf .git
578587 (
579588 cd _build/bindist
580- for file in *.tar.gz; do tar xzf "$file"; done
589+ for file in tests *.tar.gz stage2/ghc*.tar.gz stage3/ghc*.tar.gz ; do tar xzf "$file"; done
581590 )
582591 PATH=$(pwd)/_build/bindist/bin:$PATH ${{ env.MAKE }} -C _build/bindist/testsuite
583592 env :
584593 THREADS : 4
585- TEST_HC : ${{ steps.pwd_output.outputs.pwd }}/_build/bindist/bin/ghc
586- GHC_PKG : ${{ steps.pwd_output.outputs.pwd }}/_build/bindist/bin/ghc-pkg
587- HP2PS_ABS : ${{ steps.pwd_output.outputs.pwd }}/_build/bindist/bin/hp2ps
588- HPC : ${{ steps.pwd_output.outputs.pwd }}/_build/bindist/bin/hpc
589- RUNGHC : ${{ steps.pwd_output.outputs.pwd }}/_build/bindist/bin/runghc
594+ TEST_HC : ${{ steps.pwd_output.outputs.pwd }}/_build/bindist/bin/stage2/ ghc
595+ GHC_PKG : ${{ steps.pwd_output.outputs.pwd }}/_build/bindist/bin/stage2/ ghc-pkg
596+ HP2PS_ABS : ${{ steps.pwd_output.outputs.pwd }}/_build/bindist/bin/stage2/ hp2ps
597+ HPC : ${{ steps.pwd_output.outputs.pwd }}/_build/bindist/bin/stage2/ hpc
598+ RUNGHC : ${{ steps.pwd_output.outputs.pwd }}/_build/bindist/bin/stage2/ runghc
590599
591600 test-arm :
592601 name : Test ARM binary
@@ -616,13 +625,13 @@ jobs:
616625 uses : docker://arm64v8/debian:11
617626 name : Run build (aarch64 linux)
618627 with :
619- args : sh -c "apt-get update && apt-get install -y curl bash git ${{ needs.tool-output.outputs.apt_tools_test }} && git config --system --add safe.directory $GITHUB_WORKSPACE && rm -rf .git && cd _build/bindist && for file in *.tar.gz; do tar xzf $file; done && cd testsuite && PATH=$GITHUB_WORKSPACE/_build/bindist/bin:$PATH make"
628+ args : sh -c "apt-get update && apt-get install -y curl bash git ${{ needs.tool-output.outputs.apt_tools_test }} && git config --system --add safe.directory $GITHUB_WORKSPACE && rm -rf .git && cd _build/bindist && for file in tests *.tar.gz stage2/ghc*.tar.gz stage3/ghc*.tar.gz ; do tar xzf $file; done && cd testsuite && PATH=$GITHUB_WORKSPACE/_build/bindist/bin/ :$PATH make"
620629
621630 - if : matrix.platform.ARTIFACT == 'aarch64-linux-unknown'
622631 uses : docker://arm64v8/alpine:3.20
623632 name : Run build (aarch64 linux alpine)
624633 with :
625- args : sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools_test }} && git config --system --add safe.directory $GITHUB_WORKSPACE && rm -rf .git && cd _build/bindist && for file in *.tar.gz; do tar xzf $file; done && cd testsuite && PATH=$GITHUB_WORKSPACE/_build/bindist/bin:$PATH make"
634+ args : sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools_test }} && git config --system --add safe.directory $GITHUB_WORKSPACE && rm -rf .git && cd _build/bindist && for file in tests *.tar.gz stage2/ghc*.tar.gz stage3/ghc*.tar.gz ; do tar xzf $file; done && cd testsuite && PATH=$GITHUB_WORKSPACE/_build/bindist/bin/ :$PATH make"
626635
627636 test-mac-x86_64 :
628637 name : Test binary (Mac x86_64)
@@ -743,10 +752,10 @@ jobs:
743752 run : |
744753 rm -rf .git
745754 cd _build/bindist
746- for file in *.tar.gz; do tar xzf "$file"; done
755+ for file in tests*.tar.gz stage2/ghc*.tar.gz stage3/ghc *.tar.gz; do tar xzf "$file"; done
747756 cd testsuite
748757 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
749- PATH=$GITHUB_WORKSPACE/_build/bindist/bin:$PATH gmake
758+ PATH=$GITHUB_WORKSPACE/_build/bindist/bin/ :$PATH gmake
750759 env :
751760 MAKE : gmake
752761 THREADS : 8
0 commit comments