Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unquoted list variables. #845

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/action.ml
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ module Var_expansion = struct
| Paths (l, _) -> concat (List.map l ~f:(string_of_path ~dir))

let to_path dir = function
| Strings (l, _) -> path_of_string dir (concat l)
| Strings ([l], _) -> path_of_string dir l
| Paths ([p], _) -> p
| Paths (l, _) ->
path_of_string dir (concat (List.map l ~f:(string_of_path ~dir)))
| Paths (_, _) -> die "paths must be quoted"
| Strings (_, _) -> die "strings must be quoted"

let to_prog_and_args dir exp : Unresolved.Program.t * string list =
let module P = Unresolved.Program in
Expand Down
4 changes: 1 addition & 3 deletions test/blackbox-tests/test-cases/quoting/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ This behavior is surprising, we should get an error about the fact
that ${@} is not quoted and doesn't contain exactly 1 element

$ dune build --root bad x 2>&1 | grep -v Entering
Error: Rule failed to generate the following targets:
- x
- y
Paths must be quoted


The targets should only be interpreted as a single path when quoted
Expand Down