summaryrefslogtreecommitdiffstats
path: root/ocamlbuild/ocaml_compiler.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ocamlbuild/ocaml_compiler.ml')
-rw-r--r--ocamlbuild/ocaml_compiler.ml28
1 files changed, 24 insertions, 4 deletions
diff --git a/ocamlbuild/ocaml_compiler.ml b/ocamlbuild/ocaml_compiler.ml
index e21618ee0..c270a7f63 100644
--- a/ocamlbuild/ocaml_compiler.ml
+++ b/ocamlbuild/ocaml_compiler.ml
@@ -116,10 +116,30 @@ let prepare_compile build ml =
match mandatory, res with
| _, Good _ -> ()
| `mandatory, Bad exn ->
- if !Options.ignore_auto then
- dprintf 3 "Warning: Failed to build the module \
- %s requested by ocamldep" name
- else raise exn
+ if not !Options.ignore_auto then raise exn;
+ dprintf 3
+ "Warning: Failed to build the module %s requested by ocamldep."
+ name;
+ if not (!Options.recursive || Options.ocamlbuild_project_heuristic ())
+ then Log.at_failure ~name:"a module failed to build,
+ while recursive traversal was disabled by fragile heuristic;
+ hint that having a _tags or myocamlbuild.ml would maybe solve
+ the build error"
+ (fun `Error ->
+ eprintf "Hint:@ Recursive@ traversal@ of@ subdirectories@ \
+ was@ not@ enabled@ for@ this@ build,@ as@ the@ working@ \
+ directory does@ not@ look@ like@ an@ ocamlbuild@ project@ \
+ (no@ '_tags'@ or@ 'myocamlbuild.ml'@ file).@ \
+ If@ you@ have@ modules@ in@ subdirectories,@ you@ should@ add@ \
+ the@ option@ \"-r\"@ or@ create@ an@ empty@ '_tags'@ file.@\n\
+ @\n\
+ To@ enable@ recursive@ traversal@ for@ some@ subdirectories@ \
+ only,@ you@ can@ use@ the@ following@ '_tags'@ file:@\n\
+ @[<v 4>@,\
+ true: -traverse@,\
+ <dir1> or <dir2>: traverse@,\
+ @]"
+ );
| `just_try, Bad _ -> ()
end modules results