Change the name of intermediate files for reason projects

before:

- foo.re  --> foo.re.ml
- foo.rei --> foo.rei.mli

after:

- foo.re  --> foo.re.ml
- foo.rei --> foo.re.mli

When compiling foo.re.ml with ocamlc or ocamlopt, the compiler checks
for the existence of foo.re.mli to determine whether the file has an
explicit interface or not. With the previous naming scheme, the
compiler always thought that there was no interface and was
re-creating the .cmi, which caused a race condition.

Fixes #184
This commit is contained in:
Jeremie Dimino 2017-07-18 16:16:00 +01:00
parent dc895d455f
commit 0d1a3b7378
2 changed files with 6 additions and 2 deletions

View File

@ -16,6 +16,9 @@
- Fix a bug preventing one from generating `META.pkg.template` with a
custom rule (#190)
- Fix compilation of reason projects: .rei files where ignored and
caused the build to fail (#184)
1.0+beta10 (08/06/2017)
-----------------------

View File

@ -16,11 +16,12 @@ module File = struct
| Reason ->
{ syntax = OCaml
; name =
t.name ^
let base, ext = Filename.split_extension t.name in
base ^ ".re" ^
(match Filename.extension t.name with
| ".re" -> ".ml"
| ".rei" -> ".mli"
| e -> code_errorf "to_ocaml: unrecognized extension %s" e ())
| _ -> code_errorf "to_ocaml: unrecognized extension %s" ext ())
}
end