File: README.md

package info (click to toggle)
ppxlib 0.37.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,804 kB
  • sloc: ml: 66,587; sh: 103; makefile: 40; python: 36
file content (85 lines) | stat: -rw-r--r-- 4,051 bytes parent folder | download
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
## gencopy

`gencopy` is a script used to generate identity migrations. When adding support
for a new version of ocaml, it's used to generate the copy functions for each
compiler types. It simply generates identity copies so this likely won't compile
because it does not account for changes in the parsetree type. Once you have
those identity migrations, you should be able to follow the compilation errors
to find out which part need proper migrations.

The tool is further documented [here](gencopy/README.md).

## rev-deps.sh

You can use this script to fetch ppxlib's rev-deps and clone them locally to test them
against the latest changes in ppxlib and eventually send patch to them.
Eventually this will make it into a duniverse feature but in the meantime it can prove useful
to reproduce the steps we went through to send patches ahead of the 0.14.0 release.

This script is used to assemble a dune-workspace containing all you need to build ppxlib and a
co-installable subset of its reverse dependencies together. It's split into three steps.

### Getting the rev deps locally

The first step is to actually compute the list of rev-deps we want and clone them. For this you can
run the following, from the root of the repo:
- `./dev/rev-deps.sh pull` if you want the non-JaneStreet rev deps.
- `./dev/rev-deps.sh pull janestreet` if you want only the JaneStreet packages.

JS and non-JS ppx-es are handled separately because they tend to be non-coinstallable. Furthermore
we want to send patches to the JS ppx-es on top of the latest release branch instead of the master
branch for other ppx-es. When cloned, the JS rev deps will be checked out to the latest release
branch.

The script will clone them in a `dunireverse` folder at the repo's root.

### Installing their dependencies

To install the dependencies using opam-monorepo, you can run
`./dev/rev-deps.sh install-deps`

That gets the sources locally by pulling them into `duniverse/` in your dune-workspace.

To get the opam monorepo plugin, required to assemble the duniverse with all the dependencies,
simply install it through opam:
```
opam install opam-monorepo
```

### Building them

Since some of the cloned repos might contain more than just the ppx-es we're interested in,
running just `dune build` might not do it. You can use `./dev/rev-deps.sh build` which will build
exactly what you need, ie ppxlib and all the rev-deps packages you cloned.

No black magic here, it's just running `dune build -p ppxlib,...` where `...` is the list of
rev-deps packages. The `-p` is also helpful to avoid annoying warnings getting in the way.

### Notes

This is all very experimental and sometimes a bit of extra work is required. This section contains
note that can hopefully help you with this process.

A good thing to do is to deal with janestreet packages first because if some non-janestreet rev-deps
depend on a janestreet package you can then simply pin to your patch before running the
`install-deps` step.

When last assembling the non janestreet rev-deps duniverse I had to remove the following packages:
- `elpi` as it depends on `camlp5`
- `gen_js_api` which depends on `omp.1.x` directly
- `obus` as it depends on `lwt_ppx` which uses `omp.1.x`
- `ppx_import` as it depends on `omp.1.x` directly
- `ppx_show` depends on stdcompat which doesn't build with dune
- `ppx_string_interpolation` depends on `sedlex.ppx` which uses OMP and `ppx_tools_versioned`

When last assembling the janestreet rev-deps duniverse I had to remove the following packages:
- `memtrace_viewer` as the repo is weirdly maintained, there's no tag for the released versions and
  the master branch's opam file depends on packages not available in opam at the time:
  `async_rpc_websocket` and `ocaml-embed-file`
- `ppx_python` as it depends on `pyml` which doesn't build with dune

`opam-monorepo` will pull in `dune-configurator` and if you're using a recent version of dune this
will conflict with the one you have locally so you should probably run:
```
rm -rf duniverse/dune-configurator*
```