about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/comby/comby.patch
blob: d3d2088d602fd64343be1957052749e8ea80724c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
diff --git a/comby-kernel.opam b/comby-kernel.opam
index 9db7cc5..a497bff 100644
--- a/comby-kernel.opam
+++ b/comby-kernel.opam
@@ -20,7 +20,7 @@ build: [
 depends: [
   "dune" {>= "2.8.0"}
   "ocaml" {>= "4.08.1"}
-  "core_kernel"
+  "core_kernel" {>= "v0.15.0"}
   "mparser" {>= "1.3"}
   "mparser-pcre"
   "ppx_deriving"
diff --git a/comby-semantic.opam b/comby-semantic.opam
index 88563f6..fbbc122 100644
--- a/comby-semantic.opam
+++ b/comby-semantic.opam
@@ -20,7 +20,7 @@ build: [
 depends: [
   "dune" {>= "2.8.0"}
   "ocaml" {>= "4.08.1"}
-  "core_kernel"
+  "core_kernel" {>= "v0.15.0"}
   "ppx_deriving"
   "lwt"
   "cohttp"
diff --git a/comby.opam b/comby.opam
index 9e5d96b..ecab789 100644
--- a/comby.opam
+++ b/comby.opam
@@ -31,7 +31,7 @@ depends: [
   "cohttp-lwt-unix"
   "comby-kernel" {= "1.7.0"}
   "comby-semantic" {= "1.7.0"}
-  "core"
+  "core" {>= "v0.15.0"}
   "hack_parallel" {arch != "arm32" & arch != "arm64"}
   "lwt"
   "lwt_react"
diff --git a/lib/app/configuration/command_configuration.ml b/lib/app/configuration/command_configuration.ml
index 75c3107..418276e 100644
--- a/lib/app/configuration/command_configuration.ml
+++ b/lib/app/configuration/command_configuration.ml
@@ -16,21 +16,21 @@ type 'a next =
 
 let fold_directory ?(sorted=false) root ~init ~f =
   let rec aux acc absolute_path depth =
-    if Sys.is_file absolute_path = `Yes then
+    if Sys_unix.is_file absolute_path = `Yes then
       match f acc ~depth ~absolute_path ~is_file:true with
       | Continue acc
       | Skip acc -> acc
-    else if Sys.is_directory absolute_path = `Yes then
+    else if Sys_unix.is_directory absolute_path = `Yes then
       match f acc ~depth ~absolute_path ~is_file:false with
       | Skip acc -> acc
       | Continue acc ->
         let dir_contents =
           if Option.is_some (Sys.getenv "COMBY_TEST") || sorted then
-            Sys.ls_dir absolute_path
+            Sys_unix.ls_dir absolute_path
             |> List.sort ~compare:String.compare
             |> List.rev
           else
-            Sys.ls_dir absolute_path
+            Sys_unix.ls_dir absolute_path
         in
         List.fold dir_contents ~init:acc ~f:(fun acc subdir ->
             aux acc (Filename.concat absolute_path subdir) (depth + 1))
@@ -50,8 +50,8 @@ let parse_source_directories
   let exact_file_paths, file_patterns =
     List.partition_map file_filters ~f:(fun path ->
         let is_exact path =
-          (String.contains path '/' && Sys.is_file path = `Yes)
-          || (Sys.is_file ("." ^/ path) = `Yes) (* See if it matches something in the current directory *)
+          (String.contains path '/' && Sys_unix.is_file path = `Yes)
+          || (Sys_unix.is_file ("." ^/ path) = `Yes) (* See if it matches something in the current directory *)
         in
         if is_exact path then Either.First path else Either.Second path)
   in
@@ -167,8 +167,8 @@ let parse_templates ?metasyntax ?(warn_for_missing_file_in_dir = false) paths =
   let f acc ~depth:_ ~absolute_path ~is_file =
     let is_leaf_directory absolute_path =
       not is_file &&
-      Sys.ls_dir absolute_path
-      |> List.for_all ~f:(fun path -> Sys.is_directory (absolute_path ^/ path) = `No)
+      Sys_unix.ls_dir absolute_path
+      |> List.for_all ~f:(fun path -> Sys_unix.is_directory (absolute_path ^/ path) = `No)
     in
     if is_leaf_directory absolute_path then
       match parse_directory absolute_path with
@@ -178,7 +178,7 @@ let parse_templates ?metasyntax ?(warn_for_missing_file_in_dir = false) paths =
       Continue acc
   in
   List.concat_map paths ~f:(fun path ->
-      if Sys.is_directory path = `Yes then
+      if Sys_unix.is_directory path = `Yes then
         fold_directory path ~sorted:true ~init:[] ~f
       else
         parse_toml ?metasyntax path)
@@ -428,7 +428,7 @@ let parse_metasyntax metasyntax_path =
   match metasyntax_path with
   | None -> Matchers.Metasyntax.default_metasyntax
   | Some metasyntax_path ->
-    match Sys.file_exists metasyntax_path with
+    match Sys_unix.file_exists metasyntax_path with
     | `No | `Unknown ->
       Format.eprintf "Could not open file: %s@." metasyntax_path;
       exit 1
@@ -477,14 +477,14 @@ let emit_errors { input_options; output_options; _ } =
     ; Option.is_some input_options.directory_depth
       && Option.value_exn (input_options.directory_depth) < 0
     , "-depth must be 0 or greater."
-    ; Sys.is_directory input_options.target_directory = `No
+    ; Sys_unix.is_directory input_options.target_directory = `No
     , "Directory specified with -d or -directory is not a directory."
     ; output_options.json_only_diff && not output_options.json_lines
     , "-json-only-diff can only be supplied with -json-lines."
     ; (Option.is_some output_options.chunk_matches) && Option.is_some input_options.zip_file
     , "chunk-matches output format is not supported for zip files."
     ; Option.is_some output_options.interactive_review &&
-      (not (String.equal input_options.target_directory (Sys.getcwd ())))
+      (not (String.equal input_options.target_directory (Sys_unix.getcwd ())))
     , "Please remove the -d option and `cd` to the directory where you want to \
        review from. The -review, -editor, or -default-no options should only be run \
        at the root directory of the project files to patch."
@@ -492,11 +492,11 @@ let emit_errors { input_options; output_options; _ } =
          match input_options.templates with
          | Some inputs ->
            List.find_map inputs ~f:(fun input ->
-               if Sys.is_file input = `Yes then
+               if Sys_unix.is_file input = `Yes then
                  (match Toml.Parser.from_filename input with
                   | `Error (s, _) -> Some s
                   | _ -> None)
-               else if not (Sys.is_directory input = `Yes) then
+               else if not (Sys_unix.is_directory input = `Yes) then
                  Some (Format.sprintf "Directory %S specified with -templates is not a directory." input)
                else
                  None)
@@ -611,7 +611,7 @@ let filter_zip_entries file_filters exclude_directory_prefix exclude_file_prefix
 
 let syntax custom_matcher_path =
   match
-    Sys.file_exists custom_matcher_path with
+    Sys_unix.file_exists custom_matcher_path with
   | `No | `Unknown ->
     Format.eprintf "Could not open file: %s@." custom_matcher_path;
     exit 1
@@ -795,7 +795,7 @@ let create
     | Directory ->
       let target_directory =
         if target_directory = "." then
-          Filename.realpath target_directory
+          Filename_unix.realpath target_directory
         else
           target_directory
       in
diff --git a/lib/app/configuration/dune b/lib/app/configuration/dune
index e0f9748..e417cfe 100644
--- a/lib/app/configuration/dune
+++ b/lib/app/configuration/dune
@@ -1,6 +1,21 @@
 (library
-  (name configuration)
-  (public_name comby.configuration)
-  (instrumentation (backend bisect_ppx))
-  (preprocess (pps ppx_deriving.show ppx_sexp_conv ppx_sexp_message ppx_deriving_yojson))
-  (libraries comby-kernel comby-semantic comby.patdiff comby.camlzip core yojson ppx_deriving_yojson toml lwt lwt.unix tar tar-unix))
+ (name configuration)
+ (public_name comby.configuration)
+ (instrumentation
+  (backend bisect_ppx))
+ (preprocess
+  (pps ppx_deriving.show ppx_sexp_conv ppx_sexp_message ppx_deriving_yojson))
+ (libraries
+  comby-kernel
+  comby-semantic
+  comby.patdiff
+  comby.camlzip
+  core
+  core_unix.sys_unix
+  yojson
+  ppx_deriving_yojson
+  toml
+  lwt
+  lwt.unix
+  tar
+  tar-unix))
diff --git a/lib/app/configuration/external_semantic.ml b/lib/app/configuration/external_semantic.ml
index bdc7051..ac69b1b 100644
--- a/lib/app/configuration/external_semantic.ml
+++ b/lib/app/configuration/external_semantic.ml
@@ -2,13 +2,10 @@ open Core_kernel
 
 open Comby_semantic
 
-let debug =
-  match Sys.getenv "DEBUG_COMBY" with
-  | exception Not_found -> false
-  | _ -> true
+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
 
 let lsif_hover ~name:_ ~filepath ~line ~column =
-  String.chop_prefix_if_exists filepath ~prefix:(Sys.getcwd ()) |> fun filepath_relative_root ->
+  String.chop_prefix_if_exists filepath ~prefix:(Sys_unix.getcwd ()) |> fun filepath_relative_root ->
   if debug then Format.printf "File relative root: %s@." filepath;
   if debug then Format.printf "Querying type at %d::%d@." line column;
   let context =
diff --git a/lib/app/dune b/lib/app/dune
index 2ed553c..a91f826 100644
--- a/lib/app/dune
+++ b/lib/app/dune
@@ -1,9 +1,8 @@
 (library
-  (name comby)
-  (public_name comby)
-  (instrumentation (backend bisect_ppx))
-  (preprocess (pps ppx_deriving.show ppx_deriving.eq ppx_sexp_conv))
-  (libraries 
-   core 
-   comby-kernel
-   comby.pipeline))
+ (name comby)
+ (public_name comby)
+ (instrumentation
+  (backend bisect_ppx))
+ (preprocess
+  (pps ppx_deriving.show ppx_deriving.eq ppx_sexp_conv))
+ (libraries core comby-kernel comby.pipeline))
diff --git a/lib/app/interactive/dune b/lib/app/interactive/dune
index 815aff5..63c1757 100644
--- a/lib/app/interactive/dune
+++ b/lib/app/interactive/dune
@@ -1,5 +1,12 @@
 (library
-  (name interactive)
-  (public_name comby.interactive)
-  (preprocess (pps ppx_sexp_conv))
-  (libraries comby-kernel comby.configuration core shell.filename_extended lwt lwt.unix))
+ (name interactive)
+ (public_name comby.interactive)
+ (preprocess
+  (pps ppx_sexp_conv))
+ (libraries
+  comby-kernel
+  comby.configuration
+  core
+  shell.filename_extended
+  lwt
+  lwt.unix))
diff --git a/lib/app/interactive/interactive.ml b/lib/app/interactive/interactive.ml
index d4bf200..b27105a 100644
--- a/lib/app/interactive/interactive.ml
+++ b/lib/app/interactive/interactive.ml
@@ -1,5 +1,6 @@
 open Core
 open Lwt
+module Unix = Core_unix
 
 open Configuration
 
@@ -37,6 +38,7 @@ module Diff = struct
           ~big_enough:line_big_enough
           ~prev
           ~next
+          ()
       | Some prog ->
         let compare x y =
           let cmd = sprintf "%s %S %S" prog x y in
@@ -52,7 +54,7 @@ module Diff = struct
             let compare = compare
           end)
         in
-        P.get_hunks ~transform ~context ~big_enough:line_big_enough ~prev ~next
+        P.get_hunks ~transform ~context ~big_enough:line_big_enough ~prev ~next ()
     in
     match float_tolerance with
     | None -> hunks
diff --git a/lib/app/pipeline/dune b/lib/app/pipeline/dune
index 3369b9e..e6ec880 100644
--- a/lib/app/pipeline/dune
+++ b/lib/app/pipeline/dune
@@ -1,11 +1,23 @@
 (library
-  (name pipeline)
-  (public_name comby.pipeline)
-  (instrumentation (backend bisect_ppx))
-  (preprocess (pps ppx_sexp_conv ppx_deriving_yojson))
-  (libraries comby-kernel comby.statistics comby.configuration comby.interactive comby.camlzip core core.uuid yojson ppx_deriving_yojson parany
-    (select parallel_hack.ml from
-      (hack_parallel -> parallel_hack.available.ml)
-      (!hack_parallel -> parallel_hack.parany_fallback.ml)) 
-  ))
-
+ (name pipeline)
+ (public_name comby.pipeline)
+ (instrumentation
+  (backend bisect_ppx))
+ (preprocess
+  (pps ppx_sexp_conv ppx_deriving_yojson))
+ (libraries
+  comby-kernel
+  comby.statistics
+  comby.configuration
+  comby.interactive
+  comby.camlzip
+  core
+  core_unix.uuid
+  yojson
+  ppx_deriving_yojson
+  parany
+  (select
+   parallel_hack.ml
+   from
+   (hack_parallel -> parallel_hack.available.ml)
+   (!hack_parallel -> parallel_hack.parany_fallback.ml))))
diff --git a/lib/app/pipeline/parallel_hack.available.ml b/lib/app/pipeline/parallel_hack.available.ml
index a901eea..ad33070 100644
--- a/lib/app/pipeline/parallel_hack.available.ml
+++ b/lib/app/pipeline/parallel_hack.available.ml
@@ -1,4 +1,5 @@
 open Core
+module Unix = Core_unix
 
 open Hack_parallel
 
diff --git a/lib/app/statistics/dune b/lib/app/statistics/dune
index b14d5b1..12aff7f 100644
--- a/lib/app/statistics/dune
+++ b/lib/app/statistics/dune
@@ -1,6 +1,8 @@
 (library
-  (name statistics)
-  (public_name comby.statistics)
-  (instrumentation (backend bisect_ppx))
-  (preprocess (pps ppx_deriving_yojson))
-  (libraries yojson ppx_deriving_yojson ppx_deriving_yojson.runtime))
+ (name statistics)
+ (public_name comby.statistics)
+ (instrumentation
+  (backend bisect_ppx))
+ (preprocess
+  (pps ppx_deriving_yojson))
+ (libraries yojson ppx_deriving_yojson ppx_deriving_yojson.runtime))
diff --git a/lib/app/vendored/patdiff/kernel/src/dune b/lib/app/vendored/patdiff/kernel/src/dune
index 7a6353d..b79cba2 100644
--- a/lib/app/vendored/patdiff/kernel/src/dune
+++ b/lib/app/vendored/patdiff/kernel/src/dune
@@ -1,3 +1,6 @@
-(library (name patdiff_kernel) (public_name comby.patdiff_kernel)
+(library
+ (name patdiff_kernel)
+ (public_name comby.patdiff_kernel)
  (libraries core_kernel.composition_infix core_kernel patience_diff re)
- (preprocess (pps ppx_jane)))
+ (preprocess
+  (pps ppx_jane)))
diff --git a/lib/app/vendored/patdiff/kernel/src/patdiff_core.ml b/lib/app/vendored/patdiff/kernel/src/patdiff_core.ml
index 4f53a0b..88ee0e3 100644
--- a/lib/app/vendored/patdiff/kernel/src/patdiff_core.ml
+++ b/lib/app/vendored/patdiff/kernel/src/patdiff_core.ml
@@ -138,6 +138,7 @@ module Make (Output_impls : Output_impls) = struct
       ~big_enough:line_big_enough
       ~prev
       ~next
+      ()
   ;;
 
   type word_or_newline =
@@ -345,6 +346,7 @@ module Make (Output_impls : Output_impls) = struct
       ~big_enough:word_big_enough
       ~prev:prev_pieces
       ~next:next_pieces
+      ()
   ;;
 
   let ranges_are_just_whitespace (ranges : _ Patience_diff.Range.t list) =
diff --git a/lib/app/vendored/patdiff/lib/src/compare_core.ml b/lib/app/vendored/patdiff/lib/src/compare_core.ml
index fafb201..8b40d09 100644
--- a/lib/app/vendored/patdiff/lib/src/compare_core.ml
+++ b/lib/app/vendored/patdiff/lib/src/compare_core.ml
@@ -1,5 +1,6 @@
 open! Core
 open! Import
+module Unix = Core_unix
 
 let lines_of_contents contents =
   let lines = Array.of_list (String.split_lines contents) in
@@ -100,6 +101,7 @@ let compare_lines (config : Configuration.t) ?prev_diff ?next_diff ~prev ~next (
         ~big_enough:line_big_enough
         ~prev
         ~next
+        ()
     | Some prog ->
       let compare x y =
         let cmd = sprintf "%s %S %S" prog x y in
@@ -116,7 +118,7 @@ let compare_lines (config : Configuration.t) ?prev_diff ?next_diff ~prev ~next (
           let compare = compare
         end)
       in
-      P.get_hunks ~transform ~context ~big_enough:line_big_enough ~prev ~next
+      P.get_hunks ~transform ~context ~big_enough:line_big_enough ~prev ~next ()
   in
   let hunks =
     match config.float_tolerance with
@@ -361,7 +363,7 @@ let rec diff_dirs_internal (config : Configuration.t) ~prev_dir ~next_dir ~file_
       | None -> Fn.const true
       | Some file_filter -> file_filter
     in
-    Sys.ls_dir (File_name.real_name_exn dir)
+    Sys_unix.ls_dir (File_name.real_name_exn dir)
     |> List.filter ~f:(fun x ->
       let x = File_name.real_name_exn dir ^/ x in
       match Unix.stat x with
diff --git a/lib/app/vendored/patdiff/lib/src/compare_core.mli b/lib/app/vendored/patdiff/lib/src/compare_core.mli
index e919512..caa8dcb 100644
--- a/lib/app/vendored/patdiff/lib/src/compare_core.mli
+++ b/lib/app/vendored/patdiff/lib/src/compare_core.mli
@@ -1,5 +1,6 @@
 open! Core
 open! Import
+module Unix = Core_unix
 
 val diff_files
   :  Configuration.t
diff --git a/lib/app/vendored/patdiff/lib/src/configuration.ml b/lib/app/vendored/patdiff/lib/src/configuration.ml
index 6879daa..7d59706 100644
--- a/lib/app/vendored/patdiff/lib/src/configuration.ml
+++ b/lib/app/vendored/patdiff/lib/src/configuration.ml
@@ -481,7 +481,7 @@ let rec load_exn' ~set config_file =
        | Error _another_exn -> raise exn
        | Ok c ->
          (let new_file = config_file ^ ".new" in
-          match Sys.file_exists new_file with
+          match Sys_unix.file_exists new_file with
           | `Yes | `Unknown -> ()
           | `No ->
             (try Sexp.save_hum new_file (On_disk.V1.sexp_of_t c) with
@@ -564,7 +564,7 @@ let get_config ?filename () =
       (* ~/.patdiff exists *)
       Option.bind (Sys.getenv "HOME") ~f:(fun home ->
         let f = home ^/ ".patdiff" in
-        match Sys.file_exists f with
+        match Sys_unix.file_exists f with
         | `Yes -> Some f
         | `No | `Unknown -> None)
   in
diff --git a/lib/app/vendored/patdiff/lib/src/dune b/lib/app/vendored/patdiff/lib/src/dune
index 007acad..b6a0f80 100644
--- a/lib/app/vendored/patdiff/lib/src/dune
+++ b/lib/app/vendored/patdiff/lib/src/dune
@@ -1,4 +1,13 @@
-(library (name patdiff) (public_name comby.patdiff)
- (libraries core_kernel.composition_infix core core.linux_ext comby.patdiff_kernel
+(library
+ (name patdiff)
+ (public_name comby.patdiff)
+ (libraries
+  core_kernel.composition_infix
+  core
+  core_unix
+  core_unix.linux_ext
+  core_unix.sys_unix
+  comby.patdiff_kernel
   patience_diff)
- (preprocess (pps ppx_jane)))
+ (preprocess
+  (pps ppx_jane)))
diff --git a/lib/app/vendored/patdiff/lib/src/html_output.ml b/lib/app/vendored/patdiff/lib/src/html_output.ml
index 3d08f91..93ae8af 100644
--- a/lib/app/vendored/patdiff/lib/src/html_output.ml
+++ b/lib/app/vendored/patdiff/lib/src/html_output.ml
@@ -1,5 +1,6 @@
 open! Core
 open! Import
+module Unix = Core_unix
 
 include Patdiff_kernel.Html_output.Private.Make (struct
     let mtime file =
diff --git a/lib/kernel/match/dune b/lib/kernel/match/dune
index 03b120a..4d48b61 100644
--- a/lib/kernel/match/dune
+++ b/lib/kernel/match/dune
@@ -1,6 +1,12 @@
 (library
-  (name match)
-  (public_name comby-kernel.match)
-  (instrumentation (backend bisect_ppx))
-  (preprocess (pps ppx_deriving.eq ppx_sexp_conv ppx_deriving_yojson))
-  (libraries core_kernel yojson ppx_deriving_yojson ppx_deriving_yojson.runtime))
+ (name match)
+ (public_name comby-kernel.match)
+ (instrumentation
+  (backend bisect_ppx))
+ (preprocess
+  (pps ppx_deriving.eq ppx_sexp_conv ppx_deriving_yojson))
+ (libraries
+  core_kernel
+  yojson
+  ppx_deriving_yojson
+  ppx_deriving_yojson.runtime))
diff --git a/lib/kernel/matchers/alpha.ml b/lib/kernel/matchers/alpha.ml
index d6116f7..993aafc 100644
--- a/lib/kernel/matchers/alpha.ml
+++ b/lib/kernel/matchers/alpha.ml
@@ -13,20 +13,11 @@ module R = MakeRegexp(Regexp)
 let configuration_ref = ref (Configuration.create ())
 let weaken_delimiter_hole_matching = false
 
-let debug =
-  match Sys.getenv "DEBUG_COMBY" with
-  | exception Not_found -> false
-  | _ -> true
+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
 
-let debug_hole =
-  match Sys.getenv "DEBUG_COMBY_HOLE" with
-  | exception Not_found -> false
-  | _ -> true
+let debug_hole = Sys.getenv "DEBUG_COMBY_HOLE" |> Option.is_some
 
-let debug_position =
-  match Sys.getenv "DEBUG_COMBY_POS" with
-  | exception Not_found -> false
-  | _ -> true
+let debug_position = Sys.getenv "DEBUG_COMBY_POS" |> Option.is_some
 
 let f _ = return Types.Unit
 
@@ -147,7 +138,7 @@ module Make (Lang : Types.Language.S) (Meta : Types.Metasyntax.S) (Ext : Types.E
         ]
       >>= fun _ -> f Types.Unit
 
-    let sequence_chain (plist : ('c, Match.t) parser sexp_list) : ('c, Match.t) parser =
+    let sequence_chain (plist : ('c, Match.t) parser list) : ('c, Match.t) parser =
       List.fold plist ~init:(return Types.Unit) ~f:(>>)
 
     let with_debug_matcher s tag =
diff --git a/lib/kernel/matchers/dune b/lib/kernel/matchers/dune
index 12ed326..4625458 100644
--- a/lib/kernel/matchers/dune
+++ b/lib/kernel/matchers/dune
@@ -1,6 +1,18 @@
 (library
-  (name matchers)
-  (public_name comby-kernel.matchers)
-  (instrumentation (backend bisect_ppx))
-  (preprocess (pps ppx_here ppx_sexp_conv ppx_sexp_message ppx_deriving_yojson))
-  (libraries comby-kernel.replacement comby-kernel.parsers comby-kernel.match comby-kernel.vangstrom core_kernel mparser mparser-pcre re yojson ppx_deriving_yojson))
+ (name matchers)
+ (public_name comby-kernel.matchers)
+ (instrumentation
+  (backend bisect_ppx))
+ (preprocess
+  (pps ppx_here ppx_sexp_conv ppx_sexp_message ppx_deriving_yojson))
+ (libraries
+  comby-kernel.replacement
+  comby-kernel.parsers
+  comby-kernel.match
+  comby-kernel.vangstrom
+  core_kernel
+  mparser
+  mparser-pcre
+  re
+  yojson
+  ppx_deriving_yojson))
diff --git a/lib/kernel/matchers/evaluate.ml b/lib/kernel/matchers/evaluate.ml
index 9ea71a0..288f79a 100644
--- a/lib/kernel/matchers/evaluate.ml
+++ b/lib/kernel/matchers/evaluate.ml
@@ -3,10 +3,7 @@ open Core_kernel
 open Match
 open Types.Ast
 
-let debug =
-  match Sys.getenv "DEBUG_COMBY" with
-  | exception Not_found -> false
-  | _ -> true
+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
 
 type result = bool * Match.environment option
 
diff --git a/lib/kernel/matchers/omega.ml b/lib/kernel/matchers/omega.ml
index 61cc69a..0bef682 100644
--- a/lib/kernel/matchers/omega.ml
+++ b/lib/kernel/matchers/omega.ml
@@ -32,15 +32,9 @@ let push_source_ref : string ref = ref ""
 
 let filepath_ref : string option ref = ref None
 
-let debug =
-  match Sys.getenv "DEBUG_COMBY" with
-  | exception Not_found -> false
-  | _ -> true
-
-let rewrite =
-  match Sys.getenv "REWRITE" with
-  | exception Not_found -> false
-  | _ -> true
+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
+
+let rewrite = Sys.getenv "REWRITE" |> Option.is_some
 
 let actual = Buffer.create 10
 
diff --git a/lib/kernel/matchers/preprocess.ml b/lib/kernel/matchers/preprocess.ml
index 84f3ed0..b6d10e7 100644
--- a/lib/kernel/matchers/preprocess.ml
+++ b/lib/kernel/matchers/preprocess.ml
@@ -1,9 +1,6 @@
 open Core_kernel
 
-let debug =
-  match Sys.getenv "DEBUG_COMBY" with
-  | exception Not_found -> false
-  | _ -> true
+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
 
 let append_rule (module Parser : Types.Rule.S) rule parent_rule =
   let open Option in
diff --git a/lib/kernel/matchers/regexp.ml b/lib/kernel/matchers/regexp.ml
index ef0bd59..906820b 100644
--- a/lib/kernel/matchers/regexp.ml
+++ b/lib/kernel/matchers/regexp.ml
@@ -3,7 +3,7 @@ open Vangstrom
 let debug =
   match Sys.getenv "DEBUG_COMBY" with
   | exception Not_found -> false
-  | _ -> true
+  | (_ : string) -> true
 
 module type Regexp_engine_intf = sig
   type t
diff --git a/lib/kernel/matchers/rewrite.ml b/lib/kernel/matchers/rewrite.ml
index 32c4740..2fc28db 100644
--- a/lib/kernel/matchers/rewrite.ml
+++ b/lib/kernel/matchers/rewrite.ml
@@ -4,10 +4,7 @@ open Core_kernel
 open Match
 open Replacement
 
-let debug =
-  match Sys.getenv "DEBUG_COMBY" with
-  | exception Not_found -> false
-  | _ -> true
+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
 
 let counter =
   let uuid_for_id_counter = ref 0 in
diff --git a/lib/kernel/matchers/template.ml b/lib/kernel/matchers/template.ml
index 423a07f..136236c 100644
--- a/lib/kernel/matchers/template.ml
+++ b/lib/kernel/matchers/template.ml
@@ -4,10 +4,7 @@ open Core_kernel
 open Match
 open Types.Template
 
-let debug =
-  match Sys.getenv "DEBUG_COMBY" with
-  | exception Not_found -> false
-  | _ -> true
+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
 
 module Make (Metasyntax : Types.Metasyntax.S) (External : Types.External.S) : Types.Template.S = struct
 
diff --git a/lib/kernel/parsers/dune b/lib/kernel/parsers/dune
index 28b020c..0cc1fa5 100644
--- a/lib/kernel/parsers/dune
+++ b/lib/kernel/parsers/dune
@@ -1,6 +1,8 @@
 (library
-  (name parsers)
-  (public_name comby-kernel.parsers)
-  (instrumentation (backend bisect_ppx))
-  (preprocess (pps ppx_sexp_conv))
-  (libraries core_kernel comby-kernel.vangstrom mparser))
+ (name parsers)
+ (public_name comby-kernel.parsers)
+ (instrumentation
+  (backend bisect_ppx))
+ (preprocess
+  (pps ppx_sexp_conv))
+ (libraries core_kernel comby-kernel.vangstrom mparser))
diff --git a/lib/kernel/replacement/dune b/lib/kernel/replacement/dune
index 3e62de6..485b716 100644
--- a/lib/kernel/replacement/dune
+++ b/lib/kernel/replacement/dune
@@ -1,6 +1,13 @@
 (library
-  (name replacement)
-  (public_name comby-kernel.replacement)
-  (instrumentation (backend bisect_ppx))
-  (preprocess (pps ppx_deriving_yojson))
-  (libraries comby-kernel.match core_kernel yojson ppx_deriving_yojson ppx_deriving_yojson.runtime))
+ (name replacement)
+ (public_name comby-kernel.replacement)
+ (instrumentation
+  (backend bisect_ppx))
+ (preprocess
+  (pps ppx_deriving_yojson))
+ (libraries
+  comby-kernel.match
+  core_kernel
+  yojson
+  ppx_deriving_yojson
+  ppx_deriving_yojson.runtime))
diff --git a/lib/semantic/dune b/lib/semantic/dune
index 9a244d3..186a2ed 100644
--- a/lib/semantic/dune
+++ b/lib/semantic/dune
@@ -1,11 +1,8 @@
 (library
-   (name comby_semantic)
-   (public_name comby-semantic)
-   (instrumentation (backend bisect_ppx))
-   (preprocess (pps ppx_deriving.show ppx_deriving.eq ppx_sexp_conv))
-   (libraries
-      core_kernel
-      lwt
-      cohttp
-      cohttp-lwt-unix
-      yojson))
+ (name comby_semantic)
+ (public_name comby-semantic)
+ (instrumentation
+  (backend bisect_ppx))
+ (preprocess
+  (pps ppx_deriving.show ppx_deriving.eq ppx_sexp_conv))
+ (libraries core_kernel lwt cohttp cohttp-lwt-unix yojson))
diff --git a/lib/semantic/lsif.ml b/lib/semantic/lsif.ml
index 49747bc..d6b3e19 100644
--- a/lib/semantic/lsif.ml
+++ b/lib/semantic/lsif.ml
@@ -3,10 +3,7 @@ open Lwt
 open Cohttp
 open Cohttp_lwt_unix
 
-let debug =
-  match Sys.getenv "DEBUG_COMBY" with
-  | exception Not_found -> false
-  | _ -> true
+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
 
 module Formatting = struct
   type t =
diff --git a/src/dune b/src/dune
index 444a5a3..f006195 100644
--- a/src/dune
+++ b/src/dune
@@ -1,10 +1,17 @@
 (executables
- (libraries comby core ppx_deriving_yojson ppx_deriving_yojson.runtime
-    (select if_hack_parallel.ml from
-      (hack_parallel -> if_hack_parallel.available.ml)
-      (!hack_parallel -> if_hack_parallel.unavailable.ml))
- )
- (preprocess (pps ppx_deriving_yojson ppx_let ppx_deriving.show ppx_sexp_conv))
+ (libraries
+  comby
+  core
+  core_unix.command_unix
+  ppx_deriving_yojson
+  ppx_deriving_yojson.runtime
+  (select
+   if_hack_parallel.ml
+   from
+   (hack_parallel -> if_hack_parallel.available.ml)
+   (!hack_parallel -> if_hack_parallel.unavailable.ml)))
+ (preprocess
+  (pps ppx_deriving_yojson ppx_let ppx_deriving.show ppx_sexp_conv))
  (modules main if_hack_parallel)
  (modes byte exe)
  (names main))
@@ -20,4 +27,5 @@
 (install
  (package comby)
  (section bin)
- (files (main.exe as comby)))
+ (files
+  (main.exe as comby)))
diff --git a/src/main.ml b/src/main.ml
index 1def81d..79af76b 100644
--- a/src/main.ml
+++ b/src/main.ml
@@ -1,4 +1,5 @@
 open Core
+module Unix = Core_unix
 open Command.Let_syntax
 
 open Comby_kernel
@@ -47,7 +48,7 @@ let substitute_environment_only_and_exit metasyntax_path anonymous_arguments jso
     match metasyntax_path with
     | None -> Matchers.Metasyntax.default_metasyntax
     | Some metasyntax_path ->
-      match Sys.file_exists metasyntax_path with
+      match Sys_unix.file_exists metasyntax_path with
       | `No | `Unknown ->
         Format.eprintf "Could not open file: %s@." metasyntax_path;
         exit 1
@@ -95,7 +96,7 @@ let base_command_parameters : (unit -> 'result) Command.Param.t =
     and verbose = flag "verbose" no_arg ~doc:(Format.sprintf "Log to %s" verbose_out_file)
     and rule = flag "rule" (optional_with_default "where true" string) ~doc:"rule Apply rules to matches."
     and match_timeout = flag "timeout" (optional_with_default 3 int) ~doc:"seconds Set match timeout on a source. Default: 3 seconds"
-    and target_directory = flag "directory" ~aliases:["d"] (optional_with_default (Sys.getcwd ()) string) ~doc:(Format.sprintf "path Run recursively on files in a directory relative to the root. Default is current directory: %s" @@ Sys.getcwd ())
+    and target_directory = flag "directory" ~aliases:["d"] (optional_with_default (Sys_unix.getcwd ()) string) ~doc:(Format.sprintf "path Run recursively on files in a directory relative to the root. Default is current directory: %s" @@ Sys_unix.getcwd ())
     and directory_depth = flag "depth" (optional int) ~doc:"n Depth to recursively descend into directories"
     and templates = flag "templates" ~aliases:["config"; "configuration"] (optional (Arg_type.comma_separated string)) ~doc:"paths CSV of directories containing templates, or TOML configuration files"
     and file_filters = flag "extensions" ~aliases:["e"; "file-extensions"; "f"] (optional (Arg_type.comma_separated string)) ~doc:"extensions Comma-separated extensions to include, like \".go\" or \".c,.h\". It is just a file suffix, so you can use it to filter file names like \"main.go\". The extension will be used to infer a matcher, unless -custom-matcher or -matcher is specified"
@@ -147,7 +148,7 @@ let base_command_parameters : (unit -> 'result) Command.Param.t =
       | l ->
         List.map l ~f:(fun pattern ->
             if String.contains pattern '/' then
-              match Filename.realpath pattern with
+              match Filename_unix.realpath pattern with
               | exception Unix.Unix_error _ ->
                 Format.eprintf
                   "No such file or directory: %s. Comby interprets \
@@ -204,7 +205,7 @@ let base_command_parameters : (unit -> 'result) Command.Param.t =
     let omega = omega || omega_env in
     let fast_offset_conversion_env = Option.is_some @@ Sys.getenv "FAST_OFFSET_CONVERSION_COMBY" in
     let fast_offset_conversion = fast_offset_conversion_env || fast_offset_conversion in
-    let arch = Unix.Utsname.machine (Core.Unix.uname ()) in
+    let arch = Unix.Utsname.machine (Unix.uname ()) in
     let compute_mode = match sequential, parany, arch with
       | true, _, _ -> `Sequential
       | _, true, _
@@ -304,7 +305,7 @@ let parse_comby_dot_file () =
 
 let () =
   If_hack_parallel.check_entry_point ();
-  Command.run default_command ~version:"1.8.1" ~extend:(fun _ ->
-      match Sys.file_exists ".comby" with
+  Command_unix.run default_command ~version:"1.8.1" ~extend:(fun _ ->
+      match Sys_unix.file_exists ".comby" with
       | `Yes -> parse_comby_dot_file ()
       | _ -> [])
diff --git a/test/alpha/dune b/test/alpha/dune
index d7e5532..020677c 100644
--- a/test/alpha/dune
+++ b/test/alpha/dune
@@ -1,17 +1,14 @@
 (library
  (name alpha_test_integration)
  (package comby)
- (modules
-  test_special_matcher_cases
-  test_substring_disabled)
+ (modules test_special_matcher_cases test_substring_disabled)
  (inline_tests)
- (preprocess (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
- (libraries
-  comby
-  cohttp-lwt-unix
-  core
-  camlzip))
+ (preprocess
+  (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
+ (libraries comby cohttp-lwt-unix core camlzip))
 
 (alias
-(name runtest)
-(deps (source_tree example) (source_tree example/src/.ignore-me)))
+ (name runtest)
+ (deps
+  (source_tree example)
+  (source_tree example/src/.ignore-me)))
diff --git a/test/common/dune b/test/common/dune
index 6851f2e..bc3c055 100644
--- a/test/common/dune
+++ b/test/common/dune
@@ -36,16 +36,14 @@
   test_regex_holes
   test_template_constraints
   test_custom_metasyntax
-  test_rewrite_attributes
-  )
+  test_rewrite_attributes)
  (inline_tests)
- (preprocess (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
- (libraries
-  comby
-  cohttp-lwt-unix
-  core
-  camlzip))
+ (preprocess
+  (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
+ (libraries comby cohttp-lwt-unix core camlzip))
 
 (alias
-(name runtest)
-(deps (source_tree example) (source_tree example/src/.ignore-me)))
+ (name runtest)
+ (deps
+  (source_tree example)
+  (source_tree example/src/.ignore-me)))
diff --git a/test/common/test_cli.ml b/test/common/test_cli.ml
index 3606367..d5d0c0b 100644
--- a/test/common/test_cli.ml
+++ b/test/common/test_cli.ml
@@ -1,7 +1,10 @@
 open Core
 open Camlzip
 
+module Filename = Filename_unix
+module Sys = Sys_unix
 module Time = Core_kernel.Time_ns.Span
+module Unix = Core_unix
 
 let binary_path = "../../../../comby"
 
diff --git a/test/common/test_cli_helper.ml b/test/common/test_cli_helper.ml
index 5791ee6..18372ae 100644
--- a/test/common/test_cli_helper.ml
+++ b/test/common/test_cli_helper.ml
@@ -1,6 +1,7 @@
 open Core
 
 module Time = Core_kernel.Time_ns.Span
+module Unix = Core_unix
 
 let binary_path = "../../../../comby"
 
diff --git a/test/omega/dune b/test/omega/dune
index 3b31a7e..bf68dcb 100644
--- a/test/omega/dune
+++ b/test/omega/dune
@@ -2,20 +2,19 @@
  (name omega_test_integration)
  (package comby)
  (modules
-;
-; TODO
-;
+  ;
+  ; TODO
+  ;
   test_optional_holes
   test_special_matcher_cases
   test_substring_disabled)
  (inline_tests)
- (preprocess (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
- (libraries
-  comby
-  cohttp-lwt-unix
-  core
-  camlzip))
+ (preprocess
+  (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
+ (libraries comby cohttp-lwt-unix core camlzip))
 
 (alias
-(name runtest)
-(deps (source_tree example) (source_tree example/src/.ignore-me)))
+ (name runtest)
+ (deps
+  (source_tree example)
+  (source_tree example/src/.ignore-me)))