Skip to content

Add HACKING.md #13

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

Merged
merged 2 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Hacking on Flambda backend project for OCaml

This page is intended to keep track of useful information for people who
want to modify Flambda backend.


## Rebuilding during dev work

To rebuild after making changes, you can just type `make` (or `make -j16`, etc).

There is a special target `make hacking` which starts Dune in polling mode. The rebuild
performed here is equivalent to `make ocamlopt` in the upstream distribution: it rebuilds the
compiler itself, but doesn't rebuild the stdlib or anything else with the new compiler.
This target is likely what you want for development of large features in the middle end or
backend. Rebuild times for this target should be very fast.

The aim is to minimise patches against the upstream compiler (the
contents of the ocaml/ subdirectory), but you can configure and build
in that directory as you would for upstream. If a bootstrap is
required, the normal bootstrapping commands should also work: from
within the ocaml/ subdirectory, follow the instructions in
[ocaml/BOOTSTRAP.adoc](ocaml/BOOSTRAP.adoc); the newly-bootstrapped
compiler will be picked up the next time that the Flambda backend is
built from the toplevel directory of the checkout.

Any changes in `ocaml/asmcomp` and `ocaml/middle_end` directories
should also be applied to the corresponding directories `backend` and
`middle_end`.
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,3 @@ before running `make compare`.
There is also a `make ci` target (best run as e.g. `make -j16 ci`) which does a full build
and test run. It does not currently run `make compare` as some spurious failures have
been observed on the Github systems.

## Rebuilding during dev work

To rebuild after making changes, you can just type `make` (or `make -j16`, etc).

There is a special target `make hacking` which starts Dune in polling mode. The rebuild
performed here is equivalent to `make ocamlopt` in the upstream distribution: it rebuilds the
compiler itself, but doesn't rebuild the stdlib or anything else with the new compiler.
This target is likely what you want for development of large features in the middle end or
backend. Rebuild times for this target should be very fast.

The aim is to minimise patches against the upstream compiler (the contents of
the ocaml/ subdirectory), but you can configure and build in that directory as
you would for upstream. If a bootstrap is required, the normal bootstrapping
commands should also work (all from within the ocaml/ subdirectory); the
newly-bootstrapped compiler will be picked up the next time that the Flambda
backend is built from the toplevel directory of the checkout.