Skip to content

Commit efbd4cf

Browse files
Stable Haskell TeamGHC GitLab CI
authored andcommitted
feat: Implement cabal-based multi-stage build system
This commit introduces a comprehensive cabal-based build infrastructure to support multi-target and cross-compilation scenarios for GHC. The new build system provides a clean separation between different build stages and better modularity for toolchain components. Key changes: - Add Makefile with stage1, stage2, and stage3 build targets - Create separate cabal.project files for each build stage - Update configure.ac for new build system requirements - Adapt hie.yaml to support cabal-based builds - Update GitHub CI workflow for new build process Build stages explained: - Stage 1: Bootstrap compiler built with system GHC - Stage 2: Intermediate compiler built with Stage 1 - Stage 3: Final compiler built with Stage 2 (for validation) This modular approach enables: - Clean cross-compilation support - Better dependency management - Simplified build process for different targets - Improved build reproducibility Contributors: - Andrea Bedini: Build system design and Makefile implementation - Moritz Angermann: Cross-compilation infrastructure The new build system maintains compatibility with existing workflows while providing a more maintainable foundation for future enhancements.
1 parent fbb9c1a commit efbd4cf

File tree

7 files changed

+1492
-196
lines changed

7 files changed

+1492
-196
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,59 @@ on:
99
push:
1010
branches: [master]
1111

12+
workflow_dispatch:
13+
1214
jobs:
1315
cabal:
14-
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
15-
runs-on: ${{ matrix.os }}
16+
name: ${{ matrix.plat }} / ghc ${{ matrix.ghc }}
17+
runs-on: "${{ fromJSON('{\"x86_64-linux\": \"ubuntu-24.04\", \"aarch64-linux\": \"ubuntu-24.04-arm\", \"x86_64-darwin\": \"macos-latest\", \"aarch64-darwin\": \"macos-latest\"}')[matrix.plat] }}"
18+
1619
strategy:
1720
fail-fast: false
1821
matrix:
19-
os: [ubuntu-latest]
20-
ghc: ['9.6.5'] # bootstrapping compiler
22+
plat: [x86_64-linux, aarch64-linux, x86_64-darwin, aarch64-darwin]
23+
ghc: ['98'] # bootstrapping compiler
2124

2225
steps:
2326
- uses: actions/checkout@v4
2427
with:
2528
submodules: "recursive"
2629

27-
- uses: haskell-actions/setup@v2
28-
id: setup
29-
name: Setup Haskell tools
30+
- uses: input-output-hk/actions/devx@latest
3031
with:
31-
ghc-version: ${{ matrix.ghc }}
32-
cabal-version: "latest"
33-
cabal-update: true
32+
platform: ${{ matrix.plat }}
33+
compiler-nix-name: 'ghc98'
34+
minimal: true
35+
ghc: true
3436

35-
- name: Install Alex and Happy
36-
run: |
37-
cabal install alex
38-
cabal install happy
37+
- name: Update hackage
38+
shell: devx {0}
39+
run: cabal update
3940

4041
- name: Configure the build
41-
run: |
42-
./boot
43-
./configure
44-
45-
- name: Build Hadrian
46-
run: |
47-
./hadrian/build --version
42+
shell: devx {0}
43+
run: ./configure
4844

4945
- name: Build the bindist
50-
run: |
51-
./hadrian/build --flavour=release -j binary-dist-dir --docs=none
46+
shell: devx {0}
47+
run: make CABAL=$PWD/_build/stage0/bin/cabal
48+
49+
- name: Upload artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: ${{ matrix.plat }}-bindist
53+
path: _build/bindist
54+
55+
- name: Run the testsuite
56+
shell: devx {0}
57+
run: make test CABAL=$PWD/_build/stage0/bin/cabal
58+
59+
- name: Upload test results
60+
uses: actions/upload-artifact@v4
61+
if: ${{ !cancelled() }} # upload test results even if the testsuite failed to pass
62+
with:
63+
name: testsuite-results
64+
path: |
65+
_build/test-perf.csv
66+
_build/test-summary.txt
67+
_build/test-junit.xml

0 commit comments

Comments
 (0)