Skip to content

Commit

Permalink
Disable noglob cygvoke mode
Browse files Browse the repository at this point in the history
This preferred mode of invocation of Cygwin programs is intended to keep
the command line length down, but it's causing problems for ocamlbuild.

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
  • Loading branch information
dra27 committed May 10, 2018
1 parent 9ec6639 commit 90132f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/opamProcess.ml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ let cygwin_create_process_env prog args env fd1 fd2 fd3 =
f 0
in
log ~level:3 "result: %S" r; r in
if List.exists (fun s -> try String.index s '"' >= 0 with Not_found -> false) argv then
(* Setting noglob is causing some problems for ocamlbuild invoking Cygwin's
find. The reason for using it is to try to keep command line lengths
below the maximum, but for now disable the use of noglob. *)
if true || List.exists (fun s -> try String.index s '"' >= 0 with Not_found -> false) argv then
("\"" ^ String.concat "\" \"" (List.map (gen_quote ~quote:"\"" ~pre:"\"'" ~post:"'\"") argv) ^ "\"", false)
else
(String.concat " " (List.map (gen_quote ~quote:"\b\r\n " ~pre:"\"") argv), true) in
Expand Down

0 comments on commit 90132f0

Please sign in to comment.