Skip to content

Commit

Permalink
[messages] Improve warning message
Browse files Browse the repository at this point in the history
I found the old message confusing.

Signed-off-by: Emilio Jesus Gallego Arias <[email protected]>
  • Loading branch information
ejgallego committed Dec 9, 2023
1 parent 1edfd00 commit baa301d
Show file tree
Hide file tree
Showing 52 changed files with 247 additions and 248 deletions.
5 changes: 2 additions & 3 deletions src/dune_rules/warning_emit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ let check_project warning project =
let emit_hint warning =
[ Pp.concat
~sep:Pp.space
[ Pp.text
"To disable this warning, add the following to your dune-project file:"
; Pp.verbatim (sprintf "(%s disabled)" (Warning.name warning))
[ Pp.text "To disable this warning, add the following to your dune-project file:"
; Pp.verbatim (sprintf "(warnings (%s disabled))" (Warning.name warning))
]
]
;;
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/base-unsound.t/run.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
$ dune build --display short --profile unsound --debug-dependency-path @all
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
coqdep .basic.theory.d
coqc foo.{glob,vo}
coqc bar.{glob,vo}
8 changes: 4 additions & 4 deletions test/blackbox-tests/test-cases/coq/base.t/run.t
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
$ dune build --display short --debug-dependency-path @all --always-show-command-line
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
coqdep .basic.theory.d
coqc foo.{glob,vo}
coqc bar.{glob,vo}

$ dune build --debug-dependency-path @default
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
lib: [
"_build/install/default/lib/base/META"
"_build/install/default/lib/base/dune-package"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Testing composition with two boot libraries
$ dune build
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
File "A/dune", line 4, characters 11-12:
4 | (theories B)
^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Testing composition with two boot libraries
$ dune build
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Error: Cannot have more than one boot theory in scope:
- B at B/dune:1
- A at A/dune:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Composing library A depending on Coq but having `(stdlib no)`:
$ dune build A
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Module
Prelude
:= Struct Inductive BootType : Set := boot : BootType | type : BootType. End
Expand All @@ -20,8 +20,8 @@ Composing library B depending on Coq but having `(stdlib yes)`:
$ dune build B
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Module
Prelude
:= Struct Inductive BootType : Set := boot : BootType | type : BootType. End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Testing composition with a boot library with plugins
$ dune build
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
plugin loaded
plugin loaded
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/compose-cycle.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ We check cycles are detected
$ dune build
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Error: Dependency cycle between:
theory A in A/dune:2
-> theory B in B/dune:2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ so this also tests that it won't be a problem.
Entering directory 'B'
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Leaving directory 'B'
$ dune install --root B --prefix=$PWD --display=short
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Installing $TESTCASE_ROOT/lib/B/META
Installing $TESTCASE_ROOT/lib/B/dune-package
Installing $TESTCASE_ROOT/lib/coq/user-contrib/B/.coq-native/NB_b.cmi
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/compose-plugin.t/run.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
$ dune build --display short --debug-dependency-path @all
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
ocamlc src_b/.ml_plugin_b.objs/byte/ml_plugin_b.{cmi,cmo,cmt}
ocamldep src_b/.ml_plugin_b.objs/ml_plugin_b__Simple_b.impl.d
ocamlc src_a/.ml_plugin_a.objs/byte/ml_plugin_a.{cmi,cmo,cmt}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ B will pick up the private one:
$ dune build B
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
message = "I am the the private A "
: string

C picks up the private one too:
$ dune build C
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
File "C/dune", line 4, characters 11-12:
4 | (theories A))
^
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/compose-private.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ because a public theory cannot depend on a private theory.
$ dune build
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Hello
: Set
File "C/dune", line 4, characters 11-12:
Expand Down
12 changes: 6 additions & 6 deletions test/blackbox-tests/test-cases/coq/compose-projects-boot.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ coqdep and coqc.
$ dune build A
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Module
Prelude
:= Struct Inductive BootType : Set := boot : BootType | type : BootType. End
Expand All @@ -32,8 +32,8 @@ private boot library will be loaded implicitly.
$ dune build B
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
private_boot
: PrivateBootType
Expand All @@ -55,8 +55,8 @@ to fix this currently.
$ dune build B
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Error: Cannot have more than one boot theory in scope:
- Coq at Coq/dune:1
- Coq at B/Coq/dune:2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ dependencies.
$ dune build A
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Error: Dependency cycle between:
theory A in A/dune:2
-> theory B in B/dune:2
Expand All @@ -19,8 +19,8 @@ dependencies.
$ dune build B
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Error: Dependency cycle between:
theory B in B/dune:2
-> theory C in C/dune:2
Expand All @@ -34,8 +34,8 @@ dependencies.
$ dune build C
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Error: Dependency cycle between:
theory C in C/dune:2
-> theory A in A/dune:2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ dependency.
$ dune build C
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
File "B/dune", line 4, characters 11-12:
4 | (theories A))
^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ which complains.
$ dune build B
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
*** Warning: in file b.v, library a is required from root A and has not been found in the loadpath!
File "./B/b.v", line 2, characters 0-24:
Error: Cannot find a physical path bound to logical path a with prefix A.
Expand All @@ -22,8 +22,8 @@ which complains.
$ dune build C
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
*** Warning: in file c.v, library a is required from root A and has not been found in the loadpath!
*** Warning: in file a.v, library A is required from root C and has not been found in the loadpath!
File "./C/c.v", line 2, characters 0-24:
Expand All @@ -45,14 +45,14 @@ which complains.
$ dune build A
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))

$ dune build C/A_vendored
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
File "C/A_vendored/dune", line 1, characters 0-36:
1 | (coq.theory
2 | (name A)
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/compose-projects.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Testing composition of theories across a dune workspace
$ dune build B
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Hello
: Set

Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/compose-self.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Composing a theory with itself should cause a cycle
$ dune build
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Error: Dependency cycle between:
theory A in A/dune:2
-> required by _build/default/A/.A.theory.d
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/compose-simple.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ depends on A.
$ dune build
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))

We inspect the contents of the build directory.

Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/compose-sub-theory.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ defined as Foo.A. This changes the install layout of A.
$ dune build
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))

Inspecting the build and install directory
$ ls _build/install/default/lib/coq/user-contrib/Foo/A/a.vo
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/compose-two-scopes.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
$ dune build
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
lib: [
"_build/install/default/lib/cvendor/META"
"_build/install/default/lib/cvendor/dune-package"
Expand Down
8 changes: 4 additions & 4 deletions test/blackbox-tests/test-cases/coq/coqdep-on-rebuild.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
$ dune build --display short --debug-dependency-path
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
coqdep a/.a.theory.d
coqdep b/.b.theory.d
coqc a/Na_a.{cmi,cmxs},a/a.{glob,vo}
Expand All @@ -31,7 +31,7 @@
$ dune build --display short --debug-dependency-path
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
coqdep b/.b.theory.d
coqc b/Nb_b.{cmi,cmxs},b/b.{glob,vo}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ directory targets. Notice how the tex one fails before html one.
$ dune build @check
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file
(warnings ...) section: (deprecated_coq_lang_lt_08 disabled)
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
File "dune", line 9, characters 0-116:
9 | (rule
10 | (targets
Expand Down
Loading

0 comments on commit baa301d

Please sign in to comment.