Skip to content

Commit

Permalink
Error when stub names are relative paths
Browse files Browse the repository at this point in the history
Previously, these would be ignored with a warning.

Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg committed Jul 24, 2019
1 parent 58a8587 commit f57be5c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
9 changes: 5 additions & 4 deletions src/c_sources.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ let make (d : _ Dir_with_dune.t)
let s = validate ~loc s in
let s' = Filename.basename s in
if s' <> s then begin
(* DUNE2: make this an error *)
User_warning.emit ~loc
[ Pp.text "relative part of stub are no longer \
necessary and are ignored."
User_error.raise ~loc
[ Pp.text
"relative part of stub is not necessary and should be \
removed. To include sources in subdirectories, \
use the include_subdirs stanza"
]
end;
s'
Expand Down
7 changes: 2 additions & 5 deletions test/blackbox-tests/test-cases/github734/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
File "src/dune", line 4, characters 10-17:
4 | (c_names stubs/x))
^^^^^^^
Warning: relative part of stub are no longer necessary and are ignored.
File "src/dune", line 4, characters 10-17:
4 | (c_names stubs/x))
^^^^^^^
Error: x does not exist as a C source. x.c must be present
Error: relative part of stub is not necessary and should be removed. To
include sources in subdirectories, use the include_subdirs stanza
[1]
6 changes: 3 additions & 3 deletions test/blackbox-tests/test-cases/multi-dir/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ Test with C stubs in sub-directories
File "dune", line 9, characters 16-25:
9 | (c_names stub1 sub/stub2))
^^^^^^^^^
Warning: relative part of stub are no longer necessary and are ignored.
main alias runtest
Hello, world!
Error: relative part of stub is not necessary and should be removed. To
include sources in subdirectories, use the include_subdirs stanza
[1]

Test some error cases
---------------------
Expand Down

0 comments on commit f57be5c

Please sign in to comment.