Skip to content

Commit

Permalink
cr: only enabled for Dune versions starting with 3.18
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
  • Loading branch information
anmonteiro committed Dec 21, 2024
1 parent e85775d commit 493b6f9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dune_rules/preprocess.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module Pps_and_flags = struct
( String_with_vars.is_prefix ~prefix:"-" s
, String_with_vars.is_prefix ~prefix:"+" s )
with
| Yes, _ | _, Yes -> Right s
| Yes, _ -> Right s
| _, Yes when syntax_version >= (3, 18) -> Right s
| (No | Unknown _), _ ->
let loc = String_with_vars.loc s in
(match String_with_vars.text_only s with
Expand Down
14 changes: 14 additions & 0 deletions test/blackbox-tests/test-cases/ppx/ppx-flags-plus.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,17 @@ Create ppx1 and exe:
$ touch the_exe.ml

$ dune build ./the_exe.exe
File "dune", line 9, characters 30-35:
9 | (preprocess (pps ppx --alert ++foo)))
^^^^^
Error: Library "++foo" not found.
-> required by _build/default/.merlin-conf/exe-the_exe
-> required by _build/default/the_exe.exe
[1]

Works since Dune 3.18

$ cat > dune-project <<EOF
> (lang dune 3.18)
> EOF
$ dune build ./the_exe.exe

0 comments on commit 493b6f9

Please sign in to comment.