From 127aa25c2230875cbada87b1ee7a637cd17a364b Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sat, 2 Nov 2024 23:21:00 -0700 Subject: [PATCH 1/2] fix: missed cppo directive --- jscomp/core/record_attributes_check.cppo.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jscomp/core/record_attributes_check.cppo.ml b/jscomp/core/record_attributes_check.cppo.ml index 88b5e1588..a38e5ca83 100644 --- a/jscomp/core/record_attributes_check.cppo.ml +++ b/jscomp/core/record_attributes_check.cppo.ml @@ -52,7 +52,13 @@ let process_tag_name attrs = }; ] -> ( namespace_error ~loc txt; - match const.pconst_desc with + match +#if OCAML_VERSION >= (5, 3, 0) + const.pconst_desc +#else + const +#endif + with | Pconst_string (s, _, _) -> st := Some s | _ -> ()) | _ -> ()); From da90c3d6e0097fe5dc6d0b0e4b41a5981e9fa5b1 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sat, 2 Nov 2024 23:45:01 -0700 Subject: [PATCH 2/2] fix another cppo directive --- bin/melc.ml | 4 ++++ nix/shell.nix | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/melc.ml b/bin/melc.ml index d011f64f4..72029367d 100644 --- a/bin/melc.ml +++ b/bin/melc.ml @@ -279,8 +279,12 @@ let main: Melc_cli.t -> _ Cmdliner.Term.ret (* The OCaml compiler expects include_dirs in reverse CLI order, but cmdliner returns it in CLI order. *) List.rev_append include_dirs !Clflags.include_dirs; +#if OCAML_VERSION >= (5,2,0) Clflags.hidden_include_dirs := List.rev_append hidden_include_dirs !Clflags.hidden_include_dirs; +#else + let _hidden_include_dirs = hidden_include_dirs in +#endif List.iter ~f:Warnings.parse_alert_option alerts; diff --git a/nix/shell.nix b/nix/shell.nix index e0c5341d6..1745d4983 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -10,7 +10,6 @@ , git , python3 , nodePackages -, pkgs , release-mode ? false }: @@ -21,7 +20,7 @@ in mkShell { inputsFrom = lib.attrValues derivations; nativeBuildInputs = with ocamlPackages; [ - pkgs.ocaml-ng.ocamlPackages_5_2.ocamlformat + ocamlformat utop ocaml-lsp merlin