You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+6-41Lines changed: 6 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,31 +61,11 @@ This is primarily used when you need to test the repo with a different OCaml tha
61
61
For example, you might be testing BuckleScript on the 4.06 OCaml compiler instead of 4.02. Clone our patched [OCaml 4.06](https://github.com/bucklescript/ocaml), then do:
62
62
63
63
```
64
-
./configure -prefix `pwd` && make -j9 world.opt && make install
Note: clean up is necessary since the binary artifacts between versions of compiler may be incompatible.
@@ -100,36 +80,21 @@ cd foo
100
80
npm run build
101
81
```
102
82
103
-
And whenever you modify a file in bucklescript, run this inside `jscomp/`:
83
+
And whenever you modify a file in bucklescript, run this:
104
84
105
85
```
106
-
make ../lib/bsc.exe && ./install-bsc.sh # build the compiler and make it available globally
107
-
make ../lib/bsb.exe && ./install-bsb.sh # build the build system and make it available globally
86
+
npm install -g .
108
87
```
109
88
110
-
This will substitute the global `bsc.exe` & `bsb.exe` you just installed with the newly built one. Then run `npm run build` again in the dummy project and see the changes! The iteration cycle for testing these should be around 2 seconds =).
111
-
112
-
## Troubleshooting
113
-
114
-
Did any of the above step not work?
115
-
116
-
- If you get compilation errors even from a supposedly clean compilation, you might have skipped the opam reinstall step above: `opam switch reinstall 4.02.3+buckle-master`
117
-
- Make sure you did ``eval `opam config env` `` in your CLI/bashrc/zshrc
118
-
-**If the vendored ocaml changed between when you last iterated on the repo and now**, you probably skipped the `opam switch reinstall 4.02.3+buckle-master` part. You'll have to do `git clean -xdf` and then restart with the build instructions. Careful, as `git clean` removes your uncommitted changes.
119
-
-**If these fail too**, make sure you do have the correct `ocamlopt` in your environment: `which ocamlopt` should show an `opam` path, not `reason-cli` path. If you see the latter, this means it overrode the global `ocamlopt` BuckleScript needed. In this case, either temporarily uninstall reason-cli or make sure your opam PATH overrides the reason-cli PATH (and not the other way around) in your bashrc/zshrc.
120
-
121
-
Whenever there are dependencies changes: do `make depend` in the specific directory, when available. This allows the makefile to track new dependencies.
122
89
123
90
## Change the Vendored OCaml Compiler
124
91
125
92
This section is reserved for when you're making a change to the vendored ocaml compiler itself, in `ocaml`, and then testing on super-errors changes at the same time. If you're doing this for whatever reason, then the previous quick iteration workflow wouldn't work. Here's what you have to do after each change:
126
93
127
94
```
128
95
# at project root
129
-
cd jscomp
130
-
make force-snapshotml # make sure your changes are reflected in jscomp/bin/whole_compiler.ml
131
-
make -C ../lib bsc.exe && ./install-bsc.sh
132
-
make -C ../lib bsb.exe && ./install-bsb.sh
96
+
cd ocaml && make -j9 world.opt && make install && cd ..
0 commit comments