summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changes2
-rw-r--r--ocamlbuild/plugin.ml3
-rw-r--r--ocamlbuild/testsuite/internal.ml12
3 files changed, 16 insertions, 1 deletions
diff --git a/Changes b/Changes
index ddcfcb86d..068d22f1e 100644
--- a/Changes
+++ b/Changes
@@ -92,6 +92,8 @@ Features wishes:
- PR#6064: GADT representation for Bigarray.kind + CAML_BA_CHAR runtime kind
- PR#6071: Add a -noinit option to the toplevel (patch by David Sheets)
- PR#6166: document -ocamldoc option of ocamlbuild
+- PR#6187: ocamlbuild: warn when using -plugin-tag(s) without myocamlbuild.ml
+ (patch by Jacques-Pascal Deplaix)
- PR#6246: allow wilcard _ as for-loop index
- ocamllex: user-definable refill action
(patch by Frédéric Bour, review by Gabriel Scherer and Luc Maranget)
diff --git a/ocamlbuild/plugin.ml b/ocamlbuild/plugin.ml
index 6e533bb90..eb831e722 100644
--- a/ocamlbuild/plugin.ml
+++ b/ocamlbuild/plugin.ml
@@ -248,6 +248,9 @@ module Make(U:sig end) =
let rc = sys_command (Command.string_of_command_spec spec) in
raise (Exit_silently_with_code rc);
end
+ else if not (sys_file_exists plugin_file) && !Options.plugin_tags <> [] then
+ eprintf "Warning: option -plugin-tag(s) has no effect \
+ in absence of plugin file %S" plugin_file
else
()
end
diff --git a/ocamlbuild/testsuite/internal.ml b/ocamlbuild/testsuite/internal.ml
index b25594f88..5d3c28840 100644
--- a/ocamlbuild/testsuite/internal.ml
+++ b/ocamlbuild/testsuite/internal.ml
@@ -239,6 +239,16 @@ let () = test "PluginCompilation3"
T.f "myocamlbuild.ml" ~content:"print_endline \"foo\";;"]
(* if the plugin were executed we'd get "foo" in failing_msg *)
~failing_msg:""
- ~targets:("main,byte", []) ();;
+ ~targets:("main.byte", []) ();;
+
+let () = test "PluginTagsWarning"
+ ~description:"check that a warning is raised if -plugin-tags \
+ is used without a plugin file"
+ ~options:[`no_ocamlfind; `plugin_tag "use_str"]
+ ~tree:[T.f "main.ml" ~content:""]
+ ~matching:[_build [M.f "main.cmo"]]
+ ~failing_msg:"Warning: option -plugin-tag(s) has no effect \
+ in absence of plugin file \"myocamlbuild.ml\""
+ ~targets:("main.ml", []) ();;
run ~root:"_test_internal";;