MPR#5185: creates incomplete cma under some circumstances
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 133
- Forks
- 87
- PR merge metrics
- No merged PRs in 30d
Description
PR transferred from https://caml.inria.fr/mantis/view.php?id=5185
[original reporter: @ygrek]
Consider the following mllib:
X Q Y
Create in the current directory empty files x.ml and y.ml AND q.mli
Under normal circumstances ocamlbuild will notice missing implementation of Q module and build fails.
But if the name of the mllib file matches the name of one of the modules inside it - build succeeds with incomplete cma - e.g. with y.mllib we get:
$ PATH=/opt/ocaml-3.12.0/bin:$PATH ocamlbuild -classic-display y.cma
/opt/ocaml-3.12.0/bin/ocamldep.opt -modules x.ml > x.ml.depends
/opt/ocaml-3.12.0/bin/ocamldep.opt -modules q.mli > q.mli.depends
/opt/ocaml-3.12.0/bin/ocamlc.opt -c -o q.cmi q.mli
/opt/ocaml-3.12.0/bin/ocamldep.opt -modules y.ml > y.ml.depends
/opt/ocaml-3.12.0/bin/ocamlc.opt -c -o x.cmo x.ml
/opt/ocaml-3.12.0/bin/ocamlc.opt -c -o y.cmo y.ml
/opt/ocaml-3.12.0/bin/ocamlc.opt -a y.cmo -o y.cma
Note: see the Mantis discussion for more information and patches.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the case with x.ml, y.ml, q.mli, and y.mllib using the ocamlbuild command shown in the report, then inspect the mllib handling involved in producing y.cma. Done means the missing Q implementation is rejected instead of producing an incomplete archive, while the normal X Q Y case still builds correctly.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100