1 diff --git a/src/examples/downloader.ml b/src/examples/downloader.ml
2 index 93638e5..a785549 100644
3 --- a/src/examples/downloader.ml
4 +++ b/src/examples/downloader.ml
7 -module Filename = Caml.Filename
8 +module Filename = Stdlib.Filename
11 let open Genspio.EDSL in
12 @@ -154,7 +154,7 @@ let downloader () =
13 ; string " -> not HTTP(s) or FTP: NOT IMPLEMENTED" ] ] ) ] )
16 - match Caml.Sys.argv |> Array.to_list |> List.tl_exn with
17 + match Stdlib.Sys.argv |> Array.to_list |> List.tl_exn with
19 let script = Genspio.Compile.to_many_lines (downloader ()) in
21 @@ -163,12 +163,12 @@ let () =
23 | "-" -> Fmt.pr "\n`````\n%s`````\n%!" content
25 - let o = Caml.open_out other in
26 - Caml.Printf.fprintf o "%s%!" content ;
28 + let o = Stdlib.open_out other in
29 + Stdlib.Printf.fprintf o "%s%!" content ;
30 + Stdlib.close_out o )
32 Fmt.epr "Wrong command line: [%s]\n"
33 (List.map ~f:(Fmt.str "%S") other |> String.concat ~sep:"; ") ;
34 Fmt.epr "Usage:\n%s make <path>\n Create the downloader script.\n%!"
37 + Stdlib.Sys.argv.(0) ;
39 diff --git a/src/examples/multigit.ml b/src/examples/multigit.ml
40 index e05885c..b0e5fd2 100644
41 --- a/src/examples/multigit.ml
42 +++ b/src/examples/multigit.ml
44 $genspio_multigit $BINNPATH
47 -module Filename = Caml.Filename
48 +module Filename = Stdlib.Filename
50 let ( // ) = Filename.concat
51 let msg fmt = Fmt.kstr (Fmt.epr "%s\n%!") fmt
55 Fmt.str "%s (Genspio: %s)"
56 - (try Caml.Sys.getenv "multigit_version" with _ -> "0")
57 + (try Stdlib.Sys.getenv "multigit_version" with _ -> "0")
60 module Multi_status = struct
61 @@ -504,7 +504,7 @@ end
65 - match Caml.Sys.command s with
66 + match Stdlib.Sys.command s with
68 | other -> Fmt.kstr failwith "CMD: %S failed with %d" s other )
70 @@ -531,13 +531,13 @@ module Meta_repository = struct
71 let cmd_to_string_list cmd =
72 let i = Unix.open_process_in cmd in
74 - try loop (Caml.input_line i :: acc)
75 - with _ -> Caml.close_in i ; List.rev acc in
76 + try loop (Stdlib.input_line i :: acc)
77 + with _ -> Stdlib.close_in i ; List.rev acc in
80 let readme_md ~path:_ ~output =
81 - let o = Caml.open_out output in
82 - let open Caml.Format in
83 + let o = Stdlib.open_out output in
84 + let open Stdlib.Format in
85 let fmt = formatter_of_out_channel o in
86 let out f = fprintf fmt f in
87 let sec c s = out "%s\n%s\n\n" s (String.make (String.length s) c) in
88 @@ -591,7 +591,7 @@ module Meta_repository = struct
90 section "Authors / Making-of" ;
92 - "This repository is generated by an OCaml program which itself was \
93 + "This repository is generated by an OStdlib.program which itself was \
94 written by [Seb Mondet](https://seb.mondet.org), it uses the \
95 [Genspio](https://smondet.gitlab.io/genspio-doc/) EDSL library, and \
96 serves as one of its examples of usage, see also its \
97 @@ -599,7 +599,7 @@ module Meta_repository = struct
99 "Similarly, you may check out the <https://github.com/smondet/cosc> \
100 repository, which is also a bunch of shell scripts maintained by an \
102 + OStdlib.program." ;
103 section "Example Session / Demo" ;
104 let git_repos_top = "/tmp/git-repos-example" in
105 let git_repos_hammerlab = git_repos_top // "hammerlab" in
106 @@ -724,21 +724,21 @@ end
110 - let path = Caml.Sys.argv.(1) in
111 + let path = Stdlib.Sys.argv.(1) in
112 cmdf "mkdir -p %s" (Filename.quote path) ;
114 - try String.(Caml.Sys.getenv "repomode" = "true") with _ -> false in
115 + try String.(Stdlib.Sys.getenv "repomode" = "true") with _ -> false in
116 let output filename script long_description =
117 let gms = if repomode then path // "bin" // filename else path // filename in
118 msg "Outputting %S" gms ;
119 cmdf "mkdir -p %s" Filename.(quote (dirname gms)) ;
120 - let o = Caml.open_out gms in
122 + let o = Stdlib.open_out gms in
125 (formatter_of_out_channel o)
126 "#!/bin/sh\n\n%s\n\n%a\n"
127 ( long_description ()
128 - @ [ "The following is generated by an OCaml program using the \
129 + @ [ "The following is generated by an OStdlib.program using the \
130 Genspio EDSL."; "See <https://smondet.gitlab.io/genspio-doc/>."
132 |> List.map ~f:(Fmt.str "# %s")
133 @@ -746,7 +746,7 @@ let () =
134 Genspio.Compile.To_slow_flow.Script.pp_posix
135 (Genspio.Compile.To_slow_flow.compile
136 (script () |> Genspio.Transform.Constant_propagation.process) )) ;
138 + Stdlib.close_out o ;
139 cmdf "chmod +x %s" (Filename.quote gms) in
140 Multi_status.(output name script long_description) ;
141 Activity_report.(output name script long_description) ;
142 diff --git a/src/examples/service_composer.ml b/src/examples/service_composer.ml
143 index ef3c69b..b52969f 100644
144 --- a/src/examples/service_composer.ml
145 +++ b/src/examples/service_composer.ml
147 `cosc config show` is actually able to call `cosc-configuration-display`.
150 -module Filename = Caml.Filename
151 +module Filename = Stdlib.Filename
153 let ( // ) = Filename.concat
154 let msg fmt = Fmt.kstr (Fmt.epr "%s\n%!") fmt
155 @@ -46,7 +46,7 @@ module Gedsl = Genspio.EDSL
159 - match Caml.Sys.command s with
160 + match Stdlib.Sys.command s with
162 | other -> Fmt.kstr failwith "CMD: %S failed with %d" s other )
164 @@ -87,24 +87,24 @@ module Script = struct
165 output_path // String.concat ~sep:"-" (root :: t.relative_path)
168 - The function `write` is the only real I/O of this whole OCaml program.
169 + The function `write` is the only real I/O of this whole OStdlib.program.
171 let write ?(compiler = `Slow_flow) t ~output_path ~root =
172 let path = output_path // String.concat ~sep:"-" (root :: t.relative_path) in
173 - let o = Caml.open_out path in
174 + let o = Stdlib.open_out path in
175 msg "Outputting “%s” to %s\n%!" t.description path ;
176 ( match compiler with
180 - (Caml.Format.formatter_of_out_channel o)
181 + (Stdlib.Format.formatter_of_out_channel o)
182 "#!/bin/sh\n\n%a\n" Genspio.Compile.To_slow_flow.Script.pp_posix
183 (Genspio.Compile.To_slow_flow.compile
184 (t.make ~root |> Genspio.Transform.Constant_propagation.process) ))
186 - Caml.Printf.fprintf o "#!/bin/sh\n\n%s\n"
187 + Stdlib.Printf.fprintf o "#!/bin/sh\n\n%s\n"
188 (Genspio.Compile.to_many_lines (t.make ~root)) ) ;
189 - Caml.close_out o ; cmdf "chmod +x %s" path
190 + Stdlib.close_out o ; cmdf "chmod +x %s" path
193 (*md Configuration of the scripts is bootstrapped with an environment
194 @@ -275,7 +275,7 @@ module Manual = struct
195 (Environment.var_configuration_path env)
196 env.Environment.default_configuration_path root root
198 - "The scripts are generated by an OCaml program which uses the \
199 + "The scripts are generated by an OStdlib.program which uses the \
200 [Genspio](https://smondet.gitlab.io/genspio-doc) EDSL/library. \
201 The code generator serves as one of the usage examples of the \
203 @@ -341,7 +341,7 @@ module Manual = struct
204 let image = "smondet/genspio-doc-dockerfiles:apps406" in
206 "If you have [`opam`](https://opam.ocaml.org), setting up the \
207 - genspio repository is easy (only simple, pure OCaml \
208 + genspio repository is easy (only simple, pure OStdlib.\
209 dependencies), if not, or if you just like Docker™, the \
210 generator is available in the `%s` image, see:"
212 @@ -912,7 +912,7 @@ module Example_script = struct
214 let call s = Fmt.str "%s %s" root s in
215 let conf = "/tmp/example-basic.d" in
216 - let cmt fmt = Fmt.str Caml.("# " ^^ fmt) in
217 + let cmt fmt = Fmt.str Stdlib.("# " ^^ fmt) in
219 , [ cmt "We setup the configuration root path:"
220 ; Fmt.str "export %s=%s" (Environment.var_configuration_path env) conf
221 @@ -1051,13 +1051,13 @@ let make ?default_configuration_path ?default_screen_name ~name ~output_path ()
224 let anon_fun p = anon := p :: !anon in
225 - let usage = Fmt.str "%s [-help] <path>" Caml.Sys.argv.(0) in
226 + let usage = Fmt.str "%s [-help] <path>" Stdlib.Sys.argv.(0) in
227 let name = ref None in
228 let output_path = ref None in
229 let config_path = ref None in
230 let screen_name = ref None in
231 let output_readme = ref false in
232 - let module Arg = Caml.Arg in
233 + let module Arg = Stdlib.Arg in
237 @@ -1077,7 +1077,7 @@ let () =
238 , Fmt.str "<script-name> Where to write the scripts." ) ] in
239 Arg.parse args anon_fun usage ;
240 List.iter !anon ~f:(msg "Ignoring %s") ;
241 - let die () = Caml.exit 2 in
242 + let die () = Stdlib.exit 2 in
243 let need opt = function
246 diff --git a/src/examples/small.ml b/src/examples/small.ml
247 index f6e4504..8c776a6 100644
248 --- a/src/examples/small.ml
249 +++ b/src/examples/small.ml
253 -let examples = ref ([] : (Caml.out_channel -> unit) list)
254 +let examples = ref ([] : (Stdlib.out_channel -> unit) list)
256 let example ?show name description code =
258 - Caml.Printf.fprintf o
259 + Stdlib.Printf.fprintf o
260 "let () = examples := Example.make ~ocaml:%S %s %S %S %s :: !examples\n"
262 (match show with None -> "" | Some s -> Fmt.str "~show:%s" s)
263 @@ -303,7 +303,7 @@ Genspio.EDSL.(
264 (******************************************************************************)
270 let o = open_out Sys.argv.(1) in
272 @@ -318,7 +318,7 @@ let examples = ref []
276 - List.iter (List.rev !examples) ~f:(Example.run Caml.Format.std_formatter)
277 + List.iter (List.rev !examples) ~f:(Example.run Stdlib.Format.std_formatter)
280 printf "%s: Done.\n%!" Sys.argv.(0)
281 diff --git a/src/examples/vm_tester.ml b/src/examples/vm_tester.ml
282 index f8272b9..59c81e0 100644
283 --- a/src/examples/vm_tester.ml
284 +++ b/src/examples/vm_tester.ml
287 -module Filename = Caml.Filename
288 +module Filename = Stdlib.Filename
290 let ( // ) = Filename.concat
292 @@ -18,7 +18,7 @@ module Shell_script = struct
293 try String.sub ~pos:0 ~len:40 m with _ -> m
295 let path {name; content; _} =
298 let hash = Marshal.to_string content [] |> Digest.string |> Digest.to_hex in
299 let tag = String.sub hash 0 8 in
300 "_scripts" // Fmt.str "%s_%s.sh" (sanitize_name name) tag
301 @@ -54,7 +54,7 @@ module Run_environment = struct
303 let tmp_name_of_url = function
305 - ("_cache" // Caml.Digest.(string url |> to_hex))
306 + ("_cache" // Stdlib.Digest.(string url |> to_hex))
307 ^ Option.value_map ~default:"" ext ~f:(fun `Xz -> ".xz")
309 let make_files files =
310 @@ -410,14 +410,14 @@ end
314 - match Caml.Sys.command cmd with
315 + match Stdlib.Sys.command cmd with
317 | other -> Fmt.kstr failwith "Command %S did not return 0: %d" cmd other
321 let write_lines p l =
324 let o = open_out p in
325 Base.List.iter l ~f:(Printf.fprintf o "%s\n") ;
327 @@ -427,7 +427,7 @@ let () =
330 Fmt.epr "Wrong CLI: %s\n%!" s ;
334 let example = ref None in
335 let path = ref None in
336 @@ -458,7 +458,7 @@ let () =
339 | None -> fail "Don't know VM %S" arg ) in
340 - let module Arg = Caml.Arg in
341 + let module Arg = Stdlib.Arg in
345 diff --git a/src/lib/EDSL.ml b/src/lib/EDSL.ml
346 index 9663489..9d31805 100644
347 --- a/src/lib/EDSL.ml
348 +++ b/src/lib/EDSL.ml
349 @@ -5,7 +5,7 @@ type c_string = Language.c_string
350 type byte_array = Language.byte_array
351 type fd_redirection = Language.fd_redirection
353 -let ( // ) = Caml.Filename.concat
354 +let ( // ) = Stdlib.Filename.concat
356 open Language.Construct
357 include Language.Construct.Base
358 @@ -109,7 +109,7 @@ let tmp_file ?tmp_dir name : file =
359 [ get_tmp_dir; str "/"
361 (Fmt.str "genspio-tmp-file-%s-%s" clean
362 - Caml.Digest.(string name |> to_hex) ) ] in
363 + Stdlib.Digest.(string name |> to_hex) ) ] in
364 let tmp = Str.concat_list [path; string "-tmp"] in
366 method get = get_stdout (call [string "cat"; path])
367 @@ -172,7 +172,7 @@ module Command_line = struct
368 let variable {switches; _} =
369 Fmt.str "%s_%s" prefix
370 ( String.concat ~sep:"" switches
371 - |> Caml.Digest.string |> Caml.Digest.to_hex ) in
372 + |> Stdlib.Digest.string |> Stdlib.Digest.to_hex ) in
373 let inits = ref [] in
374 let to_init s = inits := s :: !inits in
375 let cases = ref [] in
376 @@ -331,7 +331,7 @@ let fresh_name suf =
380 - Fmt.str "g-%d-%d-%s" (Caml.Oo.id x) (Random.int 100_000) suf
381 + Fmt.str "g-%d-%d-%s" (Stdlib.Oo.id x) (Random.int 100_000) suf
383 let sanitize_name n =
384 String.map n ~f:(function
385 diff --git a/src/lib/EDSL_v0.ml b/src/lib/EDSL_v0.ml
386 index 1ac12de..dd82023 100644
387 --- a/src/lib/EDSL_v0.ml
388 +++ b/src/lib/EDSL_v0.ml
389 @@ -5,7 +5,7 @@ type c_string = Language.c_string
390 type byte_array = Language.byte_array
391 type fd_redirection = Language.fd_redirection
393 -let ( // ) = Caml.Filename.concat
394 +let ( // ) = Stdlib.Filename.concat
396 include Language.Construct
398 @@ -63,7 +63,7 @@ let tmp_file ?tmp_dir name : file =
399 [ get_tmp_dir; c_string "/"
401 (Fmt.str "genspio-tmp-file-%s-%s" clean
402 - Caml.Digest.(string name |> to_hex) ) ] in
403 + Stdlib.Digest.(string name |> to_hex) ) ] in
404 let tmp = C_string.concat_list [path; string "-tmp"] in
406 method get = get_stdout (call [string "cat"; path])
407 @@ -127,7 +127,7 @@ module Command_line = struct
408 let variable {switches; _} =
409 Fmt.str "%s_%s" prefix
410 ( String.concat ~sep:"" switches
411 - |> Caml.Digest.string |> Caml.Digest.to_hex ) in
412 + |> Stdlib.Digest.string |> Stdlib.Digest.to_hex ) in
413 let inits = ref [] in
414 let to_init s = inits := s :: !inits in
415 let cases = ref [] in
416 @@ -139,7 +139,7 @@ module Command_line = struct
417 let bool_of_var var = getenv (string var) |> Bool.of_string in
419 Fmt.kstr tmp_file "parse-cli-%s"
420 - Caml.(Marshal.to_string options [] |> Digest.string |> Digest.to_hex)
421 + Stdlib.(Marshal.to_string options [] |> Digest.string |> Digest.to_hex)
423 let anon = anon_tmp#get |> Elist.deserialize_to_c_string_list in
425 @@ -293,7 +293,7 @@ let fresh_name suf =
429 - Fmt.str "g-%d-%d-%s" (Caml.Oo.id x) (Random.int 100_000) suf
430 + Fmt.str "g-%d-%d-%s" (Stdlib.Oo.id x) (Random.int 100_000) suf
432 let sanitize_name n =
433 String.map n ~f:(function
434 diff --git a/src/lib/common.ml b/src/lib/common.ml
435 index fe9cfee..d98d697 100644
436 --- a/src/lib/common.ml
437 +++ b/src/lib/common.ml
438 @@ -4,7 +4,7 @@ module Unique_name = struct
444 Fmt.str "%s_%d_%d" prefix !x (Random.int 100_000)
446 let variable = create
447 diff --git a/src/lib/compile.ml b/src/lib/compile.ml
448 index 12cc836..d365e37 100644
449 --- a/src/lib/compile.ml
450 +++ b/src/lib/compile.ml
451 @@ -53,7 +53,7 @@ module To_posix = struct
452 (fun ppf s -> pf ppf "@[`%s`@]" s) )
455 - |> Caml.Filename.quote in
456 + |> Stdlib.Filename.quote in
457 str " printf -- '%%s\\n' %s >&2 " msg_str
460 @@ -116,7 +116,7 @@ let to_many_lines ?max_argument_length ?no_trap e =
461 to_legacy `Multi_line ?max_argument_length ?no_trap e
463 let quick_run_exn ?max_argument_length ?no_trap e =
464 - match to_many_lines ?max_argument_length ?no_trap e |> Caml.Sys.command with
465 + match to_many_lines ?max_argument_length ?no_trap e |> Stdlib.Sys.command with
467 | other -> Fmt.failwith "Command returned %d" other
469 @@ -125,7 +125,7 @@ let to_string_hum e = Fmt.str "%a" pp_hum e
471 let to_one_line_hum e =
472 let buf = Buffer.create 42 in
473 - let formatter = Caml.Format.formatter_of_buffer buf in
474 - Caml.Format.pp_set_margin formatter 10_000_000 ;
475 - Caml.Format.fprintf formatter "@[<h>%a@]@?" pp_hum e ;
476 + let formatter = Stdlib.Format.formatter_of_buffer buf in
477 + Stdlib.Format.pp_set_margin formatter 10_000_000 ;
478 + Stdlib.Format.fprintf formatter "@[<h>%a@]@?" pp_hum e ;
480 diff --git a/src/lib/language.ml b/src/lib/language.ml
481 index cf7b810..6f71027 100644
482 --- a/src/lib/language.ml
483 +++ b/src/lib/language.ml
487 (* Here we use the legacy module (too much code to change at once): *)
488 -module Format = Caml.Format
489 +module Format = Stdlib.Format
491 type c_string = C_string
492 type byte_array = Byte_Array
493 diff --git a/src/lib/standard_compiler.ml b/src/lib/standard_compiler.ml
494 index 7e639c6..bc8848b 100644
495 --- a/src/lib/standard_compiler.ml
496 +++ b/src/lib/standard_compiler.ml
497 @@ -147,7 +147,7 @@ let rec to_ir : type a. _ -> _ -> a Language.t -> internal_representation =
499 | Byte_array_to_c_string (Literal (Literal.String s))
500 when Literal.Str.easy_to_escape s ->
501 - argument (Caml.Filename.quote s |> check_length)
502 + argument (Stdlib.Filename.quote s |> check_length)
503 | Byte_array_to_c_string (Literal (Literal.String s))
504 when Literal.Str.impossible_to_escape_for_variable s ->
505 error ~comment_backtrace:comments (`Not_a_c_string s)
506 diff --git a/src/lib/to_slow_flow.ml b/src/lib/to_slow_flow.ml
507 index e1305ce..0f812aa 100644
508 --- a/src/lib/to_slow_flow.ml
509 +++ b/src/lib/to_slow_flow.ml
510 @@ -33,10 +33,10 @@ let expand_octal_command ~remove_l s =
513 let var_name ?expression ?script tag =
516 let stag = String.map tag ~f:(function '-' -> '_' | a -> a) in
517 Fmt.str "genspio_%s_%d_%d_%s" stag (Random.int 100_000_000) !m
520 Marshal.to_string (expression, script) [Marshal.Closures]
521 |> Digest.string |> Digest.to_hex)
523 @@ -49,7 +49,7 @@ module Tmp_db = struct
524 let make ?(deletion_grouping = 20) how =
527 - | `Fresh -> Caml.Filename.concat "/tmp" (var_name "tmpdir")
528 + | `Fresh -> Stdlib.Filename.concat "/tmp" (var_name "tmpdir")
530 {default_tmpdir; tmp_file_db= []; deletion_grouping}
532 @@ -122,10 +122,10 @@ module Script = struct
533 let v = Fmt.str "$(%s)" (expand_octal_command ~remove_l:false oct) in
534 if not arithmetic then Fmt.str "\"%s\"" v else v
536 - let v = Caml.Filename.quote s in
537 + let v = Stdlib.Filename.quote s in
538 if arithmetic then Fmt.str "$(printf -- %s)" v else v
540 - let v = Fmt.str "$(cat %s)" (Caml.Filename.quote s) in
541 + let v = Fmt.str "$(cat %s)" (Stdlib.Filename.quote s) in
542 if not arithmetic then Fmt.str "\"%s\"" v else v
543 | Tmp_file_in_variable s ->
544 (* Parameters.(tmp_file_db := s :: !tmp_file_db) ; *)
545 @@ -150,7 +150,7 @@ module Script = struct
546 | Literal_value s -> string_to_octal s
548 Fmt.str "$(cat %s | od -t o1 -An -v | tr -d ' \\n')"
549 - (Caml.Filename.quote f)
550 + (Stdlib.Filename.quote f)
551 | Tmp_file_in_variable f ->
552 (* Parameters.(tmp_file_db := f :: !tmp_file_db) ; *)
553 Fmt.str "$(cat \"${%s}\" | od -t o1 -An -v | tr -d ' \\n')" f
554 @@ -162,7 +162,7 @@ module Script = struct
555 | Unit -> assert false
557 | Literal_value _ -> assert false
558 - | File f -> Caml.Filename.quote f
559 + | File f -> Stdlib.Filename.quote f
560 | Tmp_file_in_variable f ->
561 (* Parameters.(tmp_file_db := f :: !tmp_file_db) ; *)
562 Fmt.str "\"${%s}\"" f
563 @@ -343,7 +343,7 @@ let rec to_ir : type a. fail_commands:_ -> tmpdb:_ -> a t -> Script.t =
564 let esc = string_to_octal v ~prefix:"\\" in
565 mk (rawf "printf -- '%s' > %s" esc tmparg, tmp)
567 - mk (rawf "printf -- '%%s' %s > %s" (Caml.Filename.quote v) tmparg, tmp)
568 + mk (rawf "printf -- '%%s' %s > %s" (Stdlib.Filename.quote v) tmparg, tmp)
569 | File p -> mk (rawf ":", make [] (File p))
570 | Tmp_file_in_variable p -> mk (rawf "cp \"${%s}\" %s" p tmparg, tmp)
571 | Raw_inline s -> mk (rawf "printf -- '%%s' %s > %s" s tmparg, tmp)
572 @@ -725,7 +725,7 @@ let compile ?(default_tmpdir = `Fresh) ?(signal_name = "USR1")
573 let fail_commands s =
576 - [ rawf "printf '%%s\\n' %s > %s " (Caml.Filename.quote s) tmparg
577 + [ rawf "printf '%%s\\n' %s > %s " (Stdlib.Filename.quote s) tmparg
578 ; rawf "kill -s %s ${%s}" signal_name pid ]
580 failwith "You cannot use the `fail` construct with no `trap` strategy"
581 @@ -851,9 +851,9 @@ let test () =
582 let ir = compile expr in
583 fprintf std_formatter "==== TEST %d ====\n%a\n%!" idx Script.pp_posix ir ;
584 let script_file = Fmt.str "/tmp/script-%d.sh" idx in
585 - let o = Caml.open_out script_file in
586 + let o = Stdlib.open_out script_file in
587 fprintf (formatter_of_out_channel o) "\n%a\n%!" Script.pp_posix ir ;
590 - let res = Fmt.kstr Caml.Sys.command "sh %s" script_file in
592 + Stdlib.close_out o ;
593 + let res = Fmt.kstr Stdlib.Sys.command "sh %s" script_file in
594 fprintf std_formatter "\nRESULT: %d\n" res )
595 diff --git a/src/lib/transform.ml b/src/lib/transform.ml
596 index a1f16a3..78bb202 100644
597 --- a/src/lib/transform.ml
598 +++ b/src/lib/transform.ml
599 @@ -370,7 +370,7 @@ module Constant_propagation = struct
601 let check ?trace name e res =
602 let p = process ?trace e in
604 + Stdlib.incr count ;
605 match Poly.(p = res) with
608 diff --git a/src/test-lib/test_lib.ml b/src/test-lib/test_lib.ml
609 index eba7adf..ecf765d 100644
610 --- a/src/test-lib/test_lib.ml
611 +++ b/src/test-lib/test_lib.ml
615 -let ( // ) = Caml.Filename.concat
616 +let ( // ) = Stdlib.Filename.concat
618 -module Filename = Caml.Filename
619 -module Sys = Caml.Sys
620 +module Filename = Stdlib.Filename
621 +module Sys = Stdlib.Sys
625 @@ -82,7 +82,7 @@ module Shell_directory = struct
626 if String.length long > 30 then String.sub long ~pos:0 ~len:30
628 (List.length args) returns
631 Marshal.to_string script [Marshal.Closures]
632 |> Digest.string |> Digest.to_hex
633 |> fun s -> String.sub s 0 10)
634 @@ -358,9 +358,9 @@ module Example = struct
635 ( match Genspio.Compile.To_posix.(string ~options:multi_line) code with
637 let tmp = Filename.temp_file "genspio-example" ".sh" in
638 - let o = Caml.open_out tmp in
639 - Caml.Printf.fprintf o "\n%s\n" script ;
641 + let o = Stdlib.open_out tmp in
642 + Stdlib.Printf.fprintf o "\n%s\n" script ;
643 + Stdlib.close_out o ;
644 (* ff fmt "@[<hov 2>* Compiled:@ `%s`@ (%d bytes)@]@\n" tmp (String.length script); *)
645 let out = Filename.temp_file "genspio-example" ".out" in
646 let err = Filename.temp_file "genspio-example" ".err" in
647 @@ -371,10 +371,10 @@ module Example = struct
648 let show_file name path =
649 let fence = String.make 50 '`' in
650 ff fmt "@\n%s:@\n@\n%s@\n" name fence ;
651 - let i = Caml.open_in path in
652 + let i = Stdlib.open_in path in
655 - ff fmt "%c" @@ Caml.input_char i ;
656 + ff fmt "%c" @@ Stdlib.input_char i ;
659 loop () ; ff fmt "@\n%s@\n@\n" fence in
660 diff --git a/src/test/main.ml b/src/test/main.ml
661 index 3374bdf..44d4e3f 100644
662 --- a/src/test/main.ml
663 +++ b/src/test/main.ml
666 -module Filename = Caml.Filename
667 +module Filename = Stdlib.Filename
669 module Compile = Genspio.Language
670 module Construct = Genspio.EDSL_v0
671 @@ -635,7 +635,7 @@ let () =
672 @@ exits ~name:"getenv" 25
673 (let open Construct in
674 let alternate_get_env v =
675 - (* We cannot use OCaml's Sys.getenv because the compilation output may
676 + (* We cannot use OStdlib.s Sys.getenv because the compilation output may
677 be run on a different host/system (through SSH or alike). *)
678 exec ["sh"; "-c"; Fmt.str "echo ${%s} | tr -d '\\n'" v]
679 |> get_stdout |> Byte_array.to_c in
680 @@ -1224,14 +1224,14 @@ let () =
683 Fmt.epr "Error: %s\nUsage: %s\n%!" s usage ;
687 let anon_fun p = anon := p :: !anon in
688 let no_compilation_tests = ref false in
689 let extra_slow_flow_tests = ref false in
690 let extra_transform_cp_tests = ref false in
691 let filter_tests = ref None in
692 - let module Arg = Caml.Arg in
693 + let module Arg = Stdlib.Arg in
696 [ ( "--important-shells"
697 @@ -1294,13 +1294,13 @@ let () =
698 let todo = Test_directory.contents testdir ~path testlist in
699 List.iter todo ~f:(function
701 - let mo = Caml.open_out p in
702 - Caml.Printf.fprintf mo "%s\n" v ;
704 + let mo = Stdlib.open_out p in
705 + Stdlib.Printf.fprintf mo "%s\n" v ;
706 + Stdlib.close_out mo
707 | `Directory v -> Fmt.kstr Sys.command "mkdir -p '%s'" v |> ignore ) ) ;
709 if !no_compilation_tests then false else compilation_error_tests () in
710 if !extra_slow_flow_tests then Genspio.To_slow_flow.test () ;
711 if !extra_transform_cp_tests then
712 Genspio.Transform.Constant_propagation.test () ;
713 - Caml.exit (if errors then 23 else 0)
714 + Stdlib.exit (if errors then 23 else 0)