Fix #1101
Do not attempt to convert string -> path -> string as this loses information Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
parent
264263c819
commit
6dc6ac3668
16
bin/main.ml
16
bin/main.ml
|
@ -684,7 +684,7 @@ let resolve_path path ~(setup : Main.setup) =
|
||||||
| [] -> can't_build path
|
| [] -> can't_build path
|
||||||
| l -> Ok l
|
| l -> Ok l
|
||||||
|
|
||||||
let resolve_target common (setup : Main.setup) s =
|
let resolve_target common ~(setup : Main.setup) s =
|
||||||
let check_path = check_path setup.contexts in
|
let check_path = check_path setup.contexts in
|
||||||
if String.is_prefix s ~prefix:"@" then begin
|
if String.is_prefix s ~prefix:"@" then begin
|
||||||
let pos, is_rec =
|
let pos, is_rec =
|
||||||
|
@ -719,12 +719,14 @@ let log_targets ~log targets =
|
||||||
(Path.to_string_maybe_quoted path));
|
(Path.to_string_maybe_quoted path));
|
||||||
flush stdout
|
flush stdout
|
||||||
|
|
||||||
let resolve_targets ~log common (setup : Main.setup) user_targets =
|
let resolve_targets_mixed ~log common (setup : Main.setup) user_targets =
|
||||||
match user_targets with
|
match user_targets with
|
||||||
| [] -> []
|
| [] -> []
|
||||||
| _ ->
|
| _ ->
|
||||||
let targets =
|
let targets =
|
||||||
List.map user_targets ~f:(resolve_target common setup) in
|
List.map user_targets ~f:(function
|
||||||
|
| `String s -> resolve_target common ~setup s
|
||||||
|
| `Path p -> resolve_path p ~setup) in
|
||||||
if common.config.display = Verbose then begin
|
if common.config.display = Verbose then begin
|
||||||
Log.info log "Actual targets:";
|
Log.info log "Actual targets:";
|
||||||
List.concat_map targets ~f:(function
|
List.concat_map targets ~f:(function
|
||||||
|
@ -734,6 +736,10 @@ let resolve_targets ~log common (setup : Main.setup) user_targets =
|
||||||
end;
|
end;
|
||||||
targets
|
targets
|
||||||
|
|
||||||
|
let resolve_targets ~log common (setup : Main.setup) user_targets =
|
||||||
|
List.map ~f:(fun s -> `String s) user_targets
|
||||||
|
|> resolve_targets_mixed ~log common setup
|
||||||
|
|
||||||
let resolve_targets_exn ~log common setup user_targets =
|
let resolve_targets_exn ~log common setup user_targets =
|
||||||
resolve_targets ~log common setup user_targets
|
resolve_targets ~log common setup user_targets
|
||||||
|> List.concat_map ~f:(function
|
|> List.concat_map ~f:(function
|
||||||
|
@ -1236,8 +1242,8 @@ let exec =
|
||||||
[p]
|
[p]
|
||||||
| `This_abs _ ->
|
| `This_abs _ ->
|
||||||
[])
|
[])
|
||||||
|> List.map ~f:Path.to_string
|
|> List.map ~f:(fun p -> `Path p)
|
||||||
|> resolve_targets ~log common setup
|
|> resolve_targets_mixed ~log common setup
|
||||||
|> List.concat_map ~f:(function
|
|> List.concat_map ~f:(function
|
||||||
| Ok targets -> targets
|
| Ok targets -> targets
|
||||||
| Error _ -> [])
|
| Error _ -> [])
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
$ DUNE_BUILD_DIR="$PWD/_custom" dune exec ./main.exe
|
$ DUNE_BUILD_DIR="$PWD/_custom" dune exec ./main.exe
|
||||||
File unavailable: /Users/rgrinberg/reps/dune/_build/default/test/blackbox-tests/test-cases/dune-build-dir-exec-1101/_custom/default/main.exe
|
foobar
|
||||||
[1]
|
|
||||||
|
|
Loading…
Reference in New Issue