forked from ocaml-flambda/flambda-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (135 loc) · 5.04 KB
/
build.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: build
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: closure
config: --enable-middle-end=closure
os: ubuntu-latest
ocamlparam: ''
check_arch: true
use_runtime: d
ocamlrunparam: "v=0,V=1"
- name: closure_cfg
config: --enable-middle-end=closure --enable-poll-insertion
os: ubuntu-latest
ocamlparam: _,ocamlcfg=1
- name: flambda1
config: --enable-middle-end=flambda
os: ubuntu-latest
ocamlparam: ''
- name: flambda1_frame_pointers
config: --enable-middle-end=flambda --enable-frame-pointers --enable-poll-insertion
os: ubuntu-latest
ocamlparam: ''
- name: flambda1_cfg
config: --enable-middle-end=flambda --enable-poll-insertion
os: ubuntu-latest
ocamlparam: _,ocamlcfg=1
- name: flambda2
config: --enable-middle-end=flambda2
os: ubuntu-latest
ocamlparam: ''
use_runtime: d
ocamlrunparam: "v=0,V=1"
- name: flambda2_frame_pointers
config: --enable-middle-end=flambda2 --enable-frame-pointers --enable-poll-insertion
os: ubuntu-latest
ocamlparam: ''
- name: flambda2_cfg
config: --enable-middle-end=flambda2
os: ubuntu-latest
ocamlparam: _,ocamlcfg=1
- name: flambda2_macos
config: --enable-middle-end=flambda2
os: macos-latest
- name: irc
config: --enable-middle-end=flambda2
os: ubuntu-latest
ocamlparam: ''
check_arch: true
register_allocator: irc
irc_split: off
irc_spilling_heuristics: flat_uses
- name: build_upstream_closure
config: --enable-middle-end=closure
os: ubuntu-20.04
env:
J: "3"
# On macOS, the testsuite is slow, so run only on push to main (#507)
run_testsuite: "${{matrix.os != 'macos-latest' || (github.event_name == 'push' && github.event.ref == 'refs/heads/main')}}"
build_upstream: "${{matrix.name == 'build_upstream_closure'}}"
REGISTER_ALLOCATOR: "${{matrix.register_allocator}}"
IRC_SPLIT: "${{matrix.irc_split}}"
IRC_SPILLING_HEURISTICS: "${{matrix.irc_spilling_heuristics}}"
steps:
- name: Checkout the Flambda backend repo
uses: actions/checkout@master
with:
path: 'flambda_backend'
- name: Cache OCaml 4.14 and dune
uses: actions/cache@v1
id: cache
with:
path: ${{ github.workspace }}/ocaml-414/_install
key: ${{ matrix.os }}-cache-ocaml-414-dune-361
- name: Checkout OCaml 4.14
uses: actions/checkout@master
if: steps.cache.outputs.cache-hit != 'true'
with:
repository: 'ocaml/ocaml'
path: 'ocaml-414'
ref: '4.14'
- name: Build OCaml 4.14
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ocaml-414
run: |
./configure --prefix=$GITHUB_WORKSPACE/ocaml-414/_install
make -j $J world.opt
make install
# Remove unneeded parts to shrink cache file
rm -rf $GITHUB_WORKSPACE/ocaml-414/_install/{lib/ocaml/compiler-libs,lib/ocaml/expunge,bin/*.byte}
- name: Checkout dune github repo
uses: actions/checkout@master
if: steps.cache.outputs.cache-hit != 'true'
with:
repository: 'ocaml/dune'
ref: '3.6.1'
path: 'dune'
- name: Build dune
working-directory: dune
if: steps.cache.outputs.cache-hit != 'true'
run: |
PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH make release
cp _boot/dune.exe $GITHUB_WORKSPACE/ocaml-414/_install/bin/dune
- name: Install GNU parallel
if: matrix.os == 'macos-latest'
run: HOMEBREW_NO_INSTALL_CLEANUP=TRUE brew install parallel
- name: Configure Flambda backend
working-directory: flambda_backend
run: |
autoconf
./configure \
--prefix=$GITHUB_WORKSPACE/_install \
--with-dune=$GITHUB_WORKSPACE/ocaml-414/_install/bin/dune \
${{ matrix.config }}
- name: Build, install and test Flambda backend
working-directory: flambda_backend
run: |
if [ $run_testsuite = true ]; then target=ci; else target=compiler; fi
export PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH
if [ $build_upstream = true ]; then make -j$J build_and_test_upstream; else make $target; fi
env:
BUILD_OCAMLPARAM: ${{ matrix.ocamlparam }}
OCAMLRUNPARAM: ${{ matrix.ocamlrunparam }}
USE_RUNTIME: ${{ matrix.use_runtime }}
- name: Check other architectures
working-directory: flambda_backend
if: matrix.check_arch == true
run: |
PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH make check_all_arches