Skip to content

Commit e00063e

Browse files
authored
Use 4.14.0 opam switch for building (includes upgrading ocamlformat to 0.24.1) (#1030)
1 parent c2bbb90 commit e00063e

File tree

20 files changed

+61
-59
lines changed

20 files changed

+61
-59
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,45 +86,45 @@ jobs:
8686
with:
8787
path: 'flambda_backend'
8888

89-
- name: Cache OCaml 4.12 and dune
89+
- name: Cache OCaml 4.14 and dune
9090
uses: actions/cache@v1
9191
id: cache
9292
with:
93-
path: ${{ github.workspace }}/ocaml-412/_install
94-
key: ${{ matrix.os }}-cache-ocaml-412-dune-341
93+
path: ${{ github.workspace }}/ocaml-414/_install
94+
key: ${{ matrix.os }}-cache-ocaml-414-dune-361
9595

96-
- name: Checkout OCaml 4.12
96+
- name: Checkout OCaml 4.14
9797
uses: actions/checkout@master
9898
if: steps.cache.outputs.cache-hit != 'true'
9999
with:
100100
repository: 'ocaml/ocaml'
101-
path: 'ocaml-412'
102-
ref: '4.12'
101+
path: 'ocaml-414'
102+
ref: '4.14'
103103

104-
- name: Build OCaml 4.12
104+
- name: Build OCaml 4.14
105105
if: steps.cache.outputs.cache-hit != 'true'
106-
working-directory: ocaml-412
106+
working-directory: ocaml-414
107107
run: |
108-
./configure --prefix=$GITHUB_WORKSPACE/ocaml-412/_install
108+
./configure --prefix=$GITHUB_WORKSPACE/ocaml-414/_install
109109
make -j $J world.opt
110110
make install
111111
# Remove unneeded parts to shrink cache file
112-
rm -rf $GITHUB_WORKSPACE/ocaml-412/_install/{lib/ocaml/compiler-libs,lib/ocaml/expunge,bin/*.byte}
112+
rm -rf $GITHUB_WORKSPACE/ocaml-414/_install/{lib/ocaml/compiler-libs,lib/ocaml/expunge,bin/*.byte}
113113
114114
- name: Checkout dune github repo
115115
uses: actions/checkout@master
116116
if: steps.cache.outputs.cache-hit != 'true'
117117
with:
118118
repository: 'ocaml/dune'
119-
ref: '3.4.1'
119+
ref: '3.6.1'
120120
path: 'dune'
121121

122122
- name: Build dune
123123
working-directory: dune
124124
if: steps.cache.outputs.cache-hit != 'true'
125125
run: |
126-
PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH make release
127-
cp dune.exe $GITHUB_WORKSPACE/ocaml-412/_install/bin/dune
126+
PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH make release
127+
cp _boot/dune.exe $GITHUB_WORKSPACE/ocaml-414/_install/bin/dune
128128
129129
- name: Install GNU parallel
130130
if: matrix.os == 'macos-latest'
@@ -140,14 +140,14 @@ jobs:
140140
autoconf
141141
./configure \
142142
--prefix=$GITHUB_WORKSPACE/_install \
143-
--with-dune=$GITHUB_WORKSPACE/ocaml-412/_install/bin/dune \
143+
--with-dune=$GITHUB_WORKSPACE/ocaml-414/_install/bin/dune \
144144
${{ matrix.config }}
145145
146146
- name: Build, install and test Flambda backend
147147
working-directory: flambda_backend
148148
run: |
149149
if [ $run_testsuite = true ]; then target=ci; else target=compiler; fi
150-
export PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH
150+
export PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH
151151
if [ $build_upstream = true ]; then make -j$J build_and_test_upstream; else make $target; fi
152152
env:
153153
BUILD_OCAMLPARAM: ${{ matrix.ocamlparam }}
@@ -158,4 +158,4 @@ jobs:
158158
working-directory: flambda_backend
159159
if: matrix.check_arch == true
160160
run: |
161-
PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH make check_all_arches
161+
PATH=$GITHUB_WORKSPACE/ocaml-414/_install/bin:$PATH make check_all_arches

.github/workflows/coverage.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
path: 'flambda_backend'
2424

2525
# This adds a switch at $GITHUB_WORKSPACE/_opam
26-
- name: Set up OCaml 4.12
26+
- name: Set up OCaml 4.14
2727
uses: ocaml/setup-ocaml@v2
2828
with:
29-
ocaml-compiler: 4.12
29+
ocaml-compiler: 4.14
3030
opam-pin: false
3131
opam-depext: false
3232

@@ -35,19 +35,12 @@ jobs:
3535
id: cache
3636
with:
3737
path: ${{ github.workspace }}/_opam
38-
key: ${{ matrix.os }}-cache-ocaml-412-dune-2.9.1-g7606d586
39-
40-
- name: Build Dune
41-
if: steps.cache.outputs.cache-hit != 'true'
42-
run: |
43-
opam pin dune --yes \
44-
git+https://github.com/ocaml-flambda/dune#special_dune
38+
key: ${{ matrix.os }}-cache-ocaml-414-dune-2.9.1-g7606d586
4539

4640
- name: Build bisect_ppx
4741
if: steps.cache.outputs.cache-hit != 'true'
4842
run: |
49-
# bisect_ppx fails to build with current ppxlib
50-
opam pin ppxlib 0.23.0 --yes
43+
opam pin ppxlib 0.25.1
5144
opam pin bisect_ppx --yes \
5245
git+https://github.com/lukemaurer/bisect_ppx#html-report-collate-fix
5346

.github/workflows/ocamlformat.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
os: [ubuntu-latest]
1212
ocaml-compiler:
13-
- "4.12.0"
13+
- "4.14.0"
1414

1515
steps:
1616
- name: Checkout the Flambda backend repo
@@ -26,8 +26,8 @@ jobs:
2626
- name: Install a recent version of re
2727
run: opam install 're>=1.10.0'
2828

29-
- name: Install ocamlformat 0.19.0
30-
run: opam pin -y ocamlformat 0.19.0
29+
- name: Install ocamlformat 0.24.1
30+
run: opam pin -y ocamlformat 0.24.1
3131

3232
- name: autoconf
3333
working-directory: flambda_backend

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"ocaml.sandbox": {
33
"kind": "opam",
4-
"switch": "4.12.0"
4+
"switch": "4.14.0"
55
}
66
}

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"label": "Build & install Flambda backend",
66
"type": "shell",
7-
"command": "opam exec --switch=4.11.1 make install",
7+
"command": "opam exec --switch=4.14.0 make install",
88
"group": "build",
99
"problemMatcher": [
1010
"$ocamlc"

HACKING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Depending on the initial changes, it might be necessary to do this multiple time
8989
## Rebuilding during dev work
9090

9191
To rebuild after making changes, you can just type `make`. You need to
92-
have a working OCaml 4.12 compiler on your PATH before doing so,
92+
have a working OCaml 4.14 compiler on your PATH before doing so,
9393
e.g. installed via OPAM.
9494

9595
There is a special target `make hacking` which starts Dune in polling mode. The rebuild
@@ -206,7 +206,7 @@ thoroughly (e.g. `git clean -dfX`) before reconfiguring with a different prefix.
206206

207207
Then build the compiler with the command `make _install` (this is the default
208208
target plus some setup in preparation for installation). As usual when building,
209-
a 4.12 compiler (and dune) need to be in the path.
209+
a 4.14 compiler (and dune) need to be in the path.
210210

211211
Now the build part is done, we don't need to stay in the build environment
212212
anymore; the switch creation will likely replace it if your terminal is setup
@@ -225,12 +225,12 @@ opam switch create flambda-backend --empty --repositories=flambda2=git+https://g
225225
Then we can install the compiler. The recommended way is to use the `opam-custom-install`
226226
plugin. See [here](https://gitlab.ocamlpro.com/louis/opam-custom-install)
227227
for instructions. The plugin can be installed in any existing OPAM switch,
228-
for example a 4.12 switch used for building. Once installed, the plugin will be
228+
for example a 4.14 switch used for building. Once installed, the plugin will be
229229
available whatever the current active switch is.
230230
Once the plugin is installed, we can use it to install the compiler:
231231

232232
```shell
233-
opam custom-install ocaml-variants.4.12.0+flambda2 -- make -C ${flambda-backend-root-dir} install_for_opam
233+
opam custom-install ocaml-variants.4.14.0+flambda2 -- make -C ${flambda-backend-root-dir} install_for_opam
234234
```
235235
The `-C ${flambda-backend-dir}` part can be omitted if we're still in the build directory.
236236

@@ -239,7 +239,7 @@ it is recommended to run the command `opam reinstall --forget-pending` after
239239
every use of `opam custom-install`, otherwise any subsequent `opam` command
240240
tries to rebuild the compiler from scratch.
241241

242-
To finish the installation, `opam install ocaml.4.12.0` will install the remaining
242+
To finish the installation, `opam install ocaml.4.14.0` will install the remaining
243243
auxiliary packages necessary for a regular switch. After that, normal opam
244244
packages can be installed the usual way.
245245

@@ -252,7 +252,7 @@ As `opam-custom-install` is still experimental, it can sometimes be hard to inst
252252
In this case, it is possible to use the more fragile `opam install --fake` command:
253253

254254
```shell
255-
opam install --fake ocaml-variants.4.12.0+flambda2
255+
opam install --fake ocaml-variants.4.14.0+flambda2
256256
make -C ${flambda-backend-root-dir} install_for_opam
257257
```
258258

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This repository is for more experimental work, of production quality, on the mid
44
and backend of the OCaml compiler.
55
This is also the home of the Flambda 2 optimiser.
66

7-
The Flambda backend is currently based on OCaml 4.12.0.
7+
The Flambda backend is currently based on OCaml 4.14.0.
88

99
The following gives basic instructions for getting set up. Please see
1010
[`HACKING.md`](HACKING.md) for more detailed instructions if you want to develop in this repo.
@@ -18,7 +18,7 @@ Only currently tested on Linux/x86-64 and macOS/x86-64.
1818

1919
One-time setup:
2020
```
21-
$ opam switch 4.12.0 # or "opam switch create 4.12.0" if you haven't got that switch already
21+
$ opam switch 4.14.0 # or "opam switch create 4.14.0" if you haven't got that switch already
2222
$ eval $(opam env)
2323
$ opam install dune
2424
```
@@ -38,7 +38,7 @@ The Flambda backend tree has to be configured before building. The configure sc
3838
in; you have to run `autoconf`. For example:
3939
```
4040
$ autoconf
41-
$ ./configure --prefix=/path/to/install/dir --enable-middle-end=closure --with-dune=$DUNE_DIR/dune.exe
41+
$ ./configure --prefix=/path/to/install/dir --enable-middle-end=closure
4242
```
4343
You can also specify `--enable-middle-end=flambda` or `--enable-middle-end=flambda2`. (The Flambda 2
4444
compiler is not yet ready for production use.)

backend/.ocamlformat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ cases-exp-indent=2
77
doc-comments=before
88
dock-collection-brackets=false
99
if-then-else=keyword-first
10+
module-item-spacing=sparse
1011
parens-tuple=multi-line-only
1112
sequence-blank-line=compact
1213
space-around-lists=false
1314
space-around-variants=false
1415
type-decl=sparse
1516
wrap-comments=true
16-
version=0.19.0
17+
version=0.24.1

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AC_PREREQ([2.69])
22
AC_INIT([The Flambda backend for OCaml],
3-
4.11.1+dev0-2020-08-18,
3+
4.14.0+dev0-2022-12-19,
44
55
[flambda_backend],
66
[http://github.com/ocaml-flambda/flambda_backend])

middle_end/.ocamlformat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ cases-exp-indent=2
77
doc-comments=before
88
dock-collection-brackets=false
99
if-then-else=keyword-first
10+
module-item-spacing=sparse
1011
parens-tuple=multi-line-only
1112
sequence-blank-line=compact
1213
space-around-lists=false
1314
space-around-variants=false
1415
type-decl=sparse
1516
wrap-comments=true
16-
version=0.19.0
17+
version=0.24.1

0 commit comments

Comments
 (0)