Skip to content

Commit 75fffce

Browse files
gretay-jsmshinwell
authored andcommitted
Add HACKING.md (#13)
1 parent b0f0191 commit 75fffce

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

HACKING.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Hacking on Flambda backend project for OCaml
2+
3+
This page is intended to keep track of useful information for people who
4+
want to modify Flambda backend.
5+
6+
7+
## Rebuilding during dev work
8+
9+
To rebuild after making changes, you can just type `make` (or `make -j16`, etc).
10+
11+
There is a special target `make hacking` which starts Dune in polling mode. The rebuild
12+
performed here is equivalent to `make ocamlopt` in the upstream distribution: it rebuilds the
13+
compiler itself, but doesn't rebuild the stdlib or anything else with the new compiler.
14+
This target is likely what you want for development of large features in the middle end or
15+
backend. Rebuild times for this target should be very fast.
16+
17+
The aim is to minimise patches against the upstream compiler (the
18+
contents of the ocaml/ subdirectory), but you can configure and build
19+
in that directory as you would for upstream. If a bootstrap is
20+
required, the normal bootstrapping commands should also work: from
21+
within the ocaml/ subdirectory, follow the instructions in
22+
[ocaml/BOOTSTRAP.adoc](ocaml/BOOSTRAP.adoc); the newly-bootstrapped
23+
compiler will be picked up the next time that the Flambda backend is
24+
built from the toplevel directory of the checkout.
25+
26+
Any changes in `ocaml/asmcomp` and `ocaml/middle_end` directories
27+
should also be applied to the corresponding directories `backend` and
28+
`middle_end`.

README.md

-18
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,3 @@ before running `make compare`.
6060
There is also a `make ci` target (best run as e.g. `make -j16 ci`) which does a full build
6161
and test run. It does not currently run `make compare` as some spurious failures have
6262
been observed on the Github systems.
63-
64-
## Rebuilding during dev work
65-
66-
To rebuild after making changes, you can just type `make` (or `make -j16`, etc).
67-
68-
There is a special target `make hacking` which starts Dune in polling mode. The rebuild
69-
performed here is equivalent to `make ocamlopt` in the upstream distribution: it rebuilds the
70-
compiler itself, but doesn't rebuild the stdlib or anything else with the new compiler.
71-
This target is likely what you want for development of large features in the middle end or
72-
backend. Rebuild times for this target should be very fast.
73-
74-
The aim is to minimise patches against the upstream compiler (the contents of
75-
the ocaml/ subdirectory), but you can configure and build in that directory as
76-
you would for upstream. If a bootstrap is required, the normal bootstrapping
77-
commands should also work (all from within the ocaml/ subdirectory); the
78-
newly-bootstrapped compiler will be picked up the next time that the Flambda
79-
backend is built from the toplevel directory of the checkout.
80-

0 commit comments

Comments
 (0)