non-termination
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 133
- Forks
- 87
- PR merge metrics
- No merged PRs in 30d
Description
To reproduce, create a directory with just the following file:
$ cat myocamlbuild.ml
open Printf
open Ocamlbuild_plugin
let () = dispatch (function
| After_rules -> (
printf "BEFORE RULE\n%!";
rule "m4" ~dep:"%.m4" ~prod:"%" (fun _ _ -> Nop);
printf "AFTER RULE\n%!"
)
| _ -> ()
)
Now try to build anything:
$ ocamlbuild foo
Finished, 1 target (0 cached) in 00:00:00.
BEFORE RULE
AFTER RULE
(* program hangs ... never finishes here *)
The issue is related to the "%" pattern. A more specific pattern such as ~dep:"%.ml.m4" ~prod:"%.ml" avoids the problem. I guess the "%" pattern is too general and ocamlbuild goes into a loop trying to produce foo from foo.m4, which doesn't exist so it tries to produce that from foo.m4.m4, and so on.
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 hang with myocamlbuild.ml and the ocamlbuild foo command, then trace handling of the rule pattern "%.m4" to "%". Compare it with the specific "%.ml.m4" to "%.ml" pattern. Done means the broad pattern no longer causes non-termination and the reproducer exits normally.
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
- 35/100