nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 714 lines 27 kB view raw
1diff --git a/src/examples/downloader.ml b/src/examples/downloader.ml 2index 93638e5..a785549 100644 3--- a/src/examples/downloader.ml 4+++ b/src/examples/downloader.ml 5@@ -1,5 +1,5 @@ 6 open! Base 7-module Filename = Caml.Filename 8+module Filename = Stdlib.Filename 9 10 let downloader () = 11 let open Genspio.EDSL in 12@@ -154,7 +154,7 @@ let downloader () = 13 ; string " -> not HTTP(s) or FTP: NOT IMPLEMENTED" ] ] ) ] ) 14 15 let () = 16- match Caml.Sys.argv |> Array.to_list |> List.tl_exn with 17+ match Stdlib.Sys.argv |> Array.to_list |> List.tl_exn with 18 | ["make"; path] -> ( 19 let script = Genspio.Compile.to_many_lines (downloader ()) in 20 let content = 21@@ -163,12 +163,12 @@ let () = 22 match path with 23 | "-" -> Fmt.pr "\n`````\n%s`````\n%!" content 24 | other -> 25- let o = Caml.open_out other in 26- Caml.Printf.fprintf o "%s%!" content ; 27- Caml.close_out o ) 28+ let o = Stdlib.open_out other in 29+ Stdlib.Printf.fprintf o "%s%!" content ; 30+ Stdlib.close_out o ) 31 | other -> 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%!" 35- Caml.Sys.argv.(0) ; 36- Caml.exit 1 37+ Stdlib.Sys.argv.(0) ; 38+ Stdlib.exit 1 39diff --git a/src/examples/multigit.ml b/src/examples/multigit.ml 40index e05885c..b0e5fd2 100644 41--- a/src/examples/multigit.ml 42+++ b/src/examples/multigit.ml 43@@ -7,7 +7,7 @@ 44 $genspio_multigit $BINNPATH 45 *) 46 open! Base 47-module Filename = Caml.Filename 48+module Filename = Stdlib.Filename 49 50 let ( // ) = Filename.concat 51 let msg fmt = Fmt.kstr (Fmt.epr "%s\n%!") fmt 52@@ -62,7 +62,7 @@ end 53 54 let version_string = 55 Fmt.str "%s (Genspio: %s)" 56- (try Caml.Sys.getenv "multigit_version" with _ -> "0") 57+ (try Stdlib.Sys.getenv "multigit_version" with _ -> "0") 58 Genspio.Meta.version 59 60 module Multi_status = struct 61@@ -504,7 +504,7 @@ end 62 let cmdf fmt = 63 Fmt.kstr 64 (fun s -> 65- match Caml.Sys.command s with 66+ match Stdlib.Sys.command s with 67 | 0 -> () 68 | other -> Fmt.kstr failwith "CMD: %S failed with %d" s other ) 69 fmt 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 73 let rec loop acc = 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 78 loop [] 79 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 89 par "" ; 90 section "Authors / Making-of" ; 91 par 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 98 par 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 \ 101- OCaml program." ; 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 107 *) 108 109 let () = 110- let path = Caml.Sys.argv.(1) in 111+ let path = Stdlib.Sys.argv.(1) in 112 cmdf "mkdir -p %s" (Filename.quote path) ; 113 let repomode = 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 121- Caml.Format.( 122+ let o = Stdlib.open_out gms in 123+ Stdlib.Format.( 124 fprintf 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/>." 131 ] 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) )) ; 137- Caml.close_out o ; 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) ; 142diff --git a/src/examples/service_composer.ml b/src/examples/service_composer.ml 143index ef3c69b..b52969f 100644 144--- a/src/examples/service_composer.ml 145+++ b/src/examples/service_composer.ml 146@@ -36,7 +36,7 @@ 147 `cosc config show` is actually able to call `cosc-configuration-display`. 148 *) 149 open! Base 150-module Filename = Caml.Filename 151+module Filename = Stdlib.Filename 152 153 let ( // ) = Filename.concat 154 let msg fmt = Fmt.kstr (Fmt.epr "%s\n%!") fmt 155@@ -46,7 +46,7 @@ module Gedsl = Genspio.EDSL 156 let cmdf fmt = 157 Fmt.kstr 158 (fun s -> 159- match Caml.Sys.command s with 160+ match Stdlib.Sys.command s with 161 | 0 -> () 162 | other -> Fmt.kstr failwith "CMD: %S failed with %d" s other ) 163 fmt 164@@ -87,24 +87,24 @@ module Script = struct 165 output_path // String.concat ~sep:"-" (root :: t.relative_path) 166 ``` 167 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. 170 *) 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 177 | `Slow_flow -> 178 Fmt.( 179 pf 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) )) 185 | `Standard -> 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 191 end 192 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 197 @ par 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 \ 202 library, see its \ 203@@ -341,7 +341,7 @@ module Manual = struct 204 let image = "smondet/genspio-doc-dockerfiles:apps406" in 205 Fmt.kstr par 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:" 211 image 212@@ -912,7 +912,7 @@ module Example_script = struct 213 let basic env root = 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 218 ( "basic" 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 () 222 let () = 223 let anon = ref [] in 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 234 let args = 235 Arg.align 236 [ ( "--name" 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 244 | Some o -> o 245 | None -> 246diff --git a/src/examples/small.ml b/src/examples/small.ml 247index f6e4504..8c776a6 100644 248--- a/src/examples/small.ml 249+++ b/src/examples/small.ml 250@@ -1,10 +1,10 @@ 251 open! Base 252 253-let examples = ref ([] : (Caml.out_channel -> unit) list) 254+let examples = ref ([] : (Stdlib.out_channel -> unit) list) 255 256 let example ?show name description code = 257 let f o = 258- Caml.Printf.fprintf o 259+ Stdlib.Printf.fprintf o 260 "let () = examples := Example.make ~ocaml:%S %s %S %S %s :: !examples\n" 261 code 262 (match show with None -> "" | Some s -> Fmt.str "~show:%s" s) 263@@ -303,7 +303,7 @@ Genspio.EDSL.( 264 (******************************************************************************) 265 266 let () = 267- let open Caml in 268+ let open Stdlib.in 269 let open Printf in 270 let o = open_out Sys.argv.(1) in 271 fprintf o "%s" 272@@ -318,7 +318,7 @@ let examples = ref [] 273 fprintf o "%s" 274 {ocaml| 275 let () = 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) 278 |ocaml} ; 279 close_out o ; 280 printf "%s: Done.\n%!" Sys.argv.(0) 281diff --git a/src/examples/vm_tester.ml b/src/examples/vm_tester.ml 282index f8272b9..59c81e0 100644 283--- a/src/examples/vm_tester.ml 284+++ b/src/examples/vm_tester.ml 285@@ -1,5 +1,5 @@ 286 open! Base 287-module Filename = Caml.Filename 288+module Filename = Stdlib.Filename 289 290 let ( // ) = Filename.concat 291 292@@ -18,7 +18,7 @@ module Shell_script = struct 293 try String.sub ~pos:0 ~len:40 m with _ -> m 294 295 let path {name; content; _} = 296- let open Caml in 297+ let open Stdlib.in 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 302 303 let tmp_name_of_url = function 304 | Http (url, ext) -> 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") 308 309 let make_files files = 310@@ -410,14 +410,14 @@ end 311 let cmdf fmt = 312 Fmt.kstr 313 (fun cmd -> 314- match Caml.Sys.command cmd with 315+ match Stdlib.Sys.command cmd with 316 | 0 -> () 317 | other -> Fmt.kstr failwith "Command %S did not return 0: %d" cmd other 318 ) 319 fmt 320 321 let write_lines p l = 322- let open Caml in 323+ let open Stdlib.in 324 let o = open_out p in 325 Base.List.iter l ~f:(Printf.fprintf o "%s\n") ; 326 close_out o 327@@ -427,7 +427,7 @@ let () = 328 Fmt.kstr 329 (fun s -> 330 Fmt.epr "Wrong CLI: %s\n%!" s ; 331- Caml.exit 2 ) 332+ Stdlib.exit 2 ) 333 fmt in 334 let example = ref None in 335 let path = ref None in 336@@ -458,7 +458,7 @@ let () = 337 with 338 | Some s -> s 339 | None -> fail "Don't know VM %S" arg ) in 340- let module Arg = Caml.Arg in 341+ let module Arg = Stdlib.Arg in 342 let args = 343 Arg.align 344 [ ( "--ssh-port" 345diff --git a/src/lib/EDSL.ml b/src/lib/EDSL.ml 346index 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 352 353-let ( // ) = Caml.Filename.concat 354+let ( // ) = Stdlib.Filename.concat 355 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 "/" 360 ; 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 365 object (_self) 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 = 377 object 378 method v = 42 379 end in 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 382 383 let sanitize_name n = 384 String.map n ~f:(function 385diff --git a/src/lib/EDSL_v0.ml b/src/lib/EDSL_v0.ml 386index 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 392 393-let ( // ) = Caml.Filename.concat 394+let ( // ) = Stdlib.Filename.concat 395 396 include Language.Construct 397 398@@ -63,7 +63,7 @@ let tmp_file ?tmp_dir name : file = 399 [ get_tmp_dir; c_string "/" 400 ; 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 405 object (self) 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 418 let anon_tmp = 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) 422 in 423 let anon = anon_tmp#get |> Elist.deserialize_to_c_string_list in 424 let applied_action = 425@@ -293,7 +293,7 @@ let fresh_name suf = 426 object 427 method v = 42 428 end in 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 431 432 let sanitize_name n = 433 String.map n ~f:(function 434diff --git a/src/lib/common.ml b/src/lib/common.ml 435index fe9cfee..d98d697 100644 436--- a/src/lib/common.ml 437+++ b/src/lib/common.ml 438@@ -4,7 +4,7 @@ module Unique_name = struct 439 let x = ref 0 440 441 let create prefix = 442- Caml.incr x ; 443+ Stdlib.incr x ; 444 Fmt.str "%s_%d_%d" prefix !x (Random.int 100_000) 445 446 let variable = create 447diff --git a/src/lib/compile.ml b/src/lib/compile.ml 448index 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) ) 453 more ) 454 () 455- |> Caml.Filename.quote in 456+ |> Stdlib.Filename.quote in 457 str " printf -- '%%s\\n' %s >&2 " msg_str 458 459 let one_liner = 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 462 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 466 | 0 -> () 467 | other -> Fmt.failwith "Command returned %d" other 468 469@@ -125,7 +125,7 @@ let to_string_hum e = Fmt.str "%a" pp_hum e 470 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 ; 479 Buffer.contents buf 480diff --git a/src/lib/language.ml b/src/lib/language.ml 481index cf7b810..6f71027 100644 482--- a/src/lib/language.ml 483+++ b/src/lib/language.ml 484@@ -1,7 +1,7 @@ 485 open Common 486 487 (* Here we use the legacy module (too much code to change at once): *) 488-module Format = Caml.Format 489+module Format = Stdlib.Format 490 491 type c_string = C_string 492 type byte_array = Byte_Array 493diff --git a/src/lib/standard_compiler.ml b/src/lib/standard_compiler.ml 494index 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 = 498 match c_str with 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) 506diff --git a/src/lib/to_slow_flow.ml b/src/lib/to_slow_flow.ml 507index 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 = 511 let m = ref 0 512 513 let var_name ?expression ?script tag = 514- Caml.incr m ; 515+ Stdlib.incr m ; 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 518- Caml.( 519+ Stdlib.( 520 Marshal.to_string (expression, script) [Marshal.Closures] 521 |> Digest.string |> Digest.to_hex) 522 523@@ -49,7 +49,7 @@ module Tmp_db = struct 524 let make ?(deletion_grouping = 20) how = 525 let default_tmpdir = 526 match how with 527- | `Fresh -> Caml.Filename.concat "/tmp" (var_name "tmpdir") 528+ | `Fresh -> Stdlib.Filename.concat "/tmp" (var_name "tmpdir") 529 | `Use p -> p in 530 {default_tmpdir; tmp_file_db= []; deletion_grouping} 531 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 535 | Literal_value s -> 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 539 | File s -> 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 547 | File f -> 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 556 | Raw_inline s -> s 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) 566 | Literal_value v -> 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 = 574 match trap with 575 | `Exit_with _ -> 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 ] 579 | `None -> 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 ; 588- Caml.flush o ; 589- Caml.close_out o ; 590- let res = Fmt.kstr Caml.Sys.command "sh %s" script_file in 591+ Stdlib.flush o ; 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 ) 595diff --git a/src/lib/transform.ml b/src/lib/transform.ml 596index a1f16a3..78bb202 100644 597--- a/src/lib/transform.ml 598+++ b/src/lib/transform.ml 599@@ -370,7 +370,7 @@ module Constant_propagation = struct 600 let count = ref 0 in 601 let check ?trace name e res = 602 let p = process ?trace e in 603- Caml.incr count ; 604+ Stdlib.incr count ; 605 match Poly.(p = res) with 606 | true -> () 607 | false -> 608diff --git a/src/test-lib/test_lib.ml b/src/test-lib/test_lib.ml 609index eba7adf..ecf765d 100644 610--- a/src/test-lib/test_lib.ml 611+++ b/src/test-lib/test_lib.ml 612@@ -1,9 +1,9 @@ 613 open! Base 614 615-let ( // ) = Caml.Filename.concat 616+let ( // ) = Stdlib.Filename.concat 617 618-module Filename = Caml.Filename 619-module Sys = Caml.Sys 620+module Filename = Stdlib.Filename 621+module Sys = Stdlib.Sys 622 623 module Test = struct 624 type t = 625@@ -82,7 +82,7 @@ module Shell_directory = struct 626 if String.length long > 30 then String.sub long ~pos:0 ~len:30 627 else long ) 628 (List.length args) returns 629- Caml.( 630+ Stdlib.( 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 636 | Ok script -> 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 ; 640- Caml.close_out o ; 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 653 let rec loop () = 654 try 655- ff fmt "%c" @@ Caml.input_char i ; 656+ ff fmt "%c" @@ Stdlib.input_char i ; 657 loop () 658 with _ -> () in 659 loop () ; ff fmt "@\n%s@\n@\n" fence in 660diff --git a/src/test/main.ml b/src/test/main.ml 661index 3374bdf..44d4e3f 100644 662--- a/src/test/main.ml 663+++ b/src/test/main.ml 664@@ -1,5 +1,5 @@ 665 open! Base 666-module Filename = Caml.Filename 667+module Filename = Stdlib.Filename 668 open Tests.Test_lib 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 () = 681 Fmt.kstr 682 (fun s -> 683 Fmt.epr "Error: %s\nUsage: %s\n%!" s usage ; 684- Caml.exit 1 ) 685+ Stdlib.exit 1 ) 686 fmt in 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 694 let args = 695 Arg.align 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 700 | `File (p, v) -> 701- let mo = Caml.open_out p in 702- Caml.Printf.fprintf mo "%s\n" v ; 703- Caml.close_out mo 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 ) ) ; 708 let errors = 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)