-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (61 loc) · 2.26 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: gha-sandbox
on:
push:
branches: [main]
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14]
ghc-version: ["9.4.8"]
cabal: [ '3.10.3.0' ]
steps:
- name: Install GCC 14
shell: bash
run: |
brew install gcc@14
GCC="$(brew --prefix gcc@14)/bin/gcc-14"
GXX="$(brew --prefix gcc@14)/bin/g++-14"
echo "GCC=$GCC" >> $GITHUB_ENV
echo "GXX=$GXX" >> $GITHUB_ENV
- name: Install LLVM 15
shell: bash
run: |
brew install llvm@15
LD_LLD="$(brew --prefix llvm@15)/bin/ld.lld"
echo "LD_LLD=$LD_LLD" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
submodules: true
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc-version }}
cabal-version: ${{ matrix.cabal }}
- name: sed hackery
shell: bash
run: |
sed -i.bak -E "s|(\(\"C\ compiler\ command\",\ \")[^\"]*(\"\))|\1${GCC}\2|" $(ghc --print-libdir)/settings
sed -i.bak -E "s|(\(\"C\+\+\ compiler\ command\",\ \")[^\"]*(\"\))|\1${GXX}\2|" $(ghc --print-libdir)/settings
# Pass `-fuse-ld=lld` to gcc when linking.
sed -i.bak -E "s|(\(\"C\ compiler\ link\ flags\",\ \")[^\"]*(\"\))|\1-fuse-ld=lld\2|" $(ghc --print-libdir)/settings
# Remove C/C++ compiler flags which gcc doesn't understand (namely,
# `--target=arm64-apple-darwin`).
sed -i.bak -E "s|(\(\"C\ compiler\ flags\",\ \")[^\"]*(\"\))|\1\2|" $(ghc --print-libdir)/settings
sed -i.bak -E "s|(\(\"C\+\+\ compiler\ flags\",\ \")[^\"]*(\"\))|\1\2|" $(ghc --print-libdir)/settings
# Switch the linker used for merging objects from Apple's ld to LLVM's
# ld.lld.
sed -i.bak -E "s|(\(\"Merge\ objects\ command\",\ \")[^\"]*(\"\))|\1${LD_LLD}\2|" $(ghc --print-libdir)/settings
- shell: bash
run: ghc --info
- name: Experiments
shell: bash
run: |
cat ~/.ghcup/bin/hsc2hs || true
grep -rn "target=arm64\-apple\-darwin" ~/.ghcup || true
- name: Build
shell: bash
run: cabal build