Skip to content

Build GHC with cabal-install and a Makefile #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
db67fa3
Add zig cc support
hsyl20 Apr 7, 2025
1f9479d
Fix build without polluting the global store
hsyl20 Apr 10, 2025
c088e30
Use zig to cross-compile to aarch64-linux
hsyl20 Apr 15, 2025
cc44de7
Revert "Fix libffi linking"
hsyl20 Apr 15, 2025
109e4b9
Revert "[build] drop ffi"
hsyl20 Apr 15, 2025
1fd397e
Revert "Drop libffi; Stop shipping a copy of libffi"
hsyl20 Apr 15, 2025
4eed2ea
Cross build libffi with zig
hsyl20 Apr 29, 2025
27abce3
Disable ubsan and properly install libCffi
hsyl20 Apr 30, 2025
fae5819
Progress towards fixing the build of cross libraries
hsyl20 Apr 30, 2025
bc31fb9
Finally build hackily install libffi
hsyl20 Apr 30, 2025
8dfd49d
Deal with unlit path
hsyl20 Apr 30, 2025
680b9c5
Use libffi adjustors on aarch64
hsyl20 Apr 30, 2025
1a56bf1
Add multi-target support
hsyl20 May 5, 2025
bb87a13
Support listing targets
hsyl20 May 7, 2025
17203d9
Don't forget to rebuild cabal when needed
hsyl20 May 13, 2025
a5bfd6a
Use newer Cabal with support for -W
hsyl20 May 13, 2025
b2dca92
Bump cabal-version to support extra-static-libraries
hsyl20 May 13, 2025
273aff9
Use two GHCs with cabal
hsyl20 May 13, 2025
306d8db
Fix installation path for targets
hsyl20 May 14, 2025
1b5a3b2
Add cross compile for aarch64 with GCC
hsyl20 May 23, 2025
89b802c
Add .envrc
angerman May 9, 2025
57b4a7b
[ci] used devx action
angerman May 10, 2025
c4a5d1c
Disable forced static.
angerman May 26, 2025
5a9e4e4
Print cabal command on failure
angerman May 26, 2025
c9f0f6c
clone via https
angerman May 26, 2025
223929b
Add ZIG_LIBFFI defines
angerman May 26, 2025
5256df6
Augmenting the .envrc shell with
angerman May 26, 2025
6d13fd5
Add cabal-install debug info to boot libraries
angerman May 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Check if nix-direnv is already loaded; if not, source it
if ! has nix_direnv_reload; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.0/direnvrc" "sha256-+IuxtJIDzJIlHDAxyzr7M2S3FD +zSd/BNfZe+ntXje0="
fi

# Use the specified flake to enter the Nix development environment
use flake github:input-output-hk/devx#ghc98-minimal-ghc
39 changes: 21 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,51 @@ on:
push:
branches: [master]

workflow_dispatch:

jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
name: ${{ matrix.plat }} / ghc ${{ matrix.ghc }}
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] }}"

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc: ['9.8.4'] # bootstrapping compiler
plat: [x86_64-linux, aarch64-linux, x86_64-darwin, aarch64-darwin]
ghc: ['98'] # bootstrapping compiler

steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- uses: haskell-actions/setup@v2
id: setup
name: Setup Haskell tools
- uses: input-output-hk/actions/devx@latest
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "latest"
cabal-update: true
platform: ${{ matrix.plat }}
compiler-nix-name: 'ghc98'
minimal: true
ghc: true

- name: Configure the build
run: ./boot
- name: Update hackage
shell: devx {0}
run: cabal update

- name: Build patched cabal
run: make cabal
- name: Configure the build
shell: devx {0}
run: ./configure

- name: Build the bindist
env:
CC: gcc
CXX: g++
shell: devx {0}
run: make

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: bindist
name: ${{ matrix.plat }}-bindist
path: _build/bindist

- name: Run the testsuite
shell: devx {0}
run: make test

- name: Upload test results
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@
path = utils/hsc2hs
url = https://gitlab.haskell.org/ghc/hsc2hs.git
ignore = untracked
[submodule "libffi-tarballs"]
path = libffi-tarballs
url = https://gitlab.haskell.org/ghc/libffi-tarballs.git
ignore = untracked
[submodule "gmp-tarballs"]
path = libraries/ghc-internal/gmp/gmp-tarballs
url = https://gitlab.haskell.org/ghc/gmp-tarballs.git
Expand Down
Loading
Loading