Skip to content

Commit 2052a05

Browse files
authored
Merge pull request #361 from gasche/unshadow_run_and_read
Unshadow run_and_read
2 parents bac5d35 + e9efc7d commit 2052a05

File tree

6 files changed

+11
-39
lines changed

6 files changed

+11
-39
lines changed

.github/workflows/build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ jobs:
8181
if: runner.os != 'Windows'
8282
- run: opam exec -- opam install -v shcaml.0.2.1 # this tests the cppo plugin
8383
if: ${{ ! startsWith(steps.conf.outputs.ocamlversion, '5.') && runner.os != 'Windows' && runner.os != 'macOS'}}
84+
- run: opam exec -- opam install -v tgls.0.8.6
85+
# this caught an ocamlbuild regression in https://github.com/ocaml/opam-repository/pull/27442
86+
# (incompatible with OCaml >=5.2 and with Windows)
87+
if: ${{ ! startsWith(steps.conf.outputs.ocamlversion, '5.') && runner.os != 'Windows'}}

.travis.yml

-32
This file was deleted.

src/command.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ let execute ?quiet ?pretend cmd =
291291
| Some(_, exn) -> raise exn
292292
| _ -> ()
293293

294-
let run_and_read ?(quiet=false) cmd =
294+
let run_spec_and_read ?(quiet=false) cmd =
295295
let kont = string_print_of_command_spec cmd quiet false in
296296
My_unix.run_and_read (kont ())
297297

src/ocaml_utils.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ open Command;;
2626
module S = Set.Make(String)
2727

2828
let stdlib_dir = lazy begin
29-
let ocamlc_where = !Options.build_dir / (Pathname.mk "ocamlc.where") in
30-
let () = Command.execute ~quiet:true (Cmd(S[!Options.ocamlc; A"-where"; Sh">"; P ocamlc_where])) in
31-
String.chomp (read_file ocamlc_where)
29+
String.chomp
30+
(Command.run_spec_and_read ~quiet:true
31+
(S[!Options.ocamlc; A"-where"]))
3232
end
3333

3434
let flag_and_dep = Flags.flag_and_dep

src/options.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ let init () =
401401
ignore_list := List.map String.capitalize_ascii !ignore_list;
402402

403403
let raw_ocamlc_config =
404-
try Command.run_and_read (S [!ocamlc; A "-config"])
405-
with Failure _ -> Command.run_and_read (S [!ocamlopt; A "-config"])
404+
try Command.run_spec_and_read (S [!ocamlc; A "-config"])
405+
with Failure _ -> Command.run_spec_and_read (S [!ocamlopt; A "-config"])
406406
in
407407
let ocamlc_config_lines = String.split_on_char '\n' raw_ocamlc_config in
408408
let ocamlc_configs =

src/signatures.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ module type COMMAND = sig
220220
val atomize_paths : string list -> spec
221221

222222
(** Run the command specification and returns its output *)
223-
val run_and_read : ?quiet:bool -> spec -> string
223+
val run_spec_and_read : ?quiet:bool -> spec -> string
224224

225225
(** Run the command. *)
226226
val execute : ?quiet:bool -> ?pretend:bool -> t -> unit

0 commit comments

Comments
 (0)