Skip to content

Commit

Permalink
update reason to 3.14, lsp, ocamlformat (#1799)
Browse files Browse the repository at this point in the history
* update reason to 3.14, lsp, ocamlformat

* ignore linol for 4.14 too
  • Loading branch information
anmonteiro authored Nov 29, 2024
1 parent 9b1c356 commit dcb625f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 29 deletions.
7 changes: 4 additions & 3 deletions ci/filter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ let

# not compatible with latest odoc
"sherlodoc"

## Doesn't work with latest lsp on 5.2
"linol"
"linol-lwt"
];

ocaml5Ignores = [
Expand All @@ -117,9 +121,6 @@ let
"ppx_debug"
"typedppxlib"

## Doesn't work with latest lsp on 5.2
"linol"
"linol-lwt"
];

darwinIgnores = [
Expand Down
66 changes: 40 additions & 26 deletions ocaml/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1205,9 +1205,19 @@ with oself;
else if lib.versionOlder "5.2" ocaml.version then
builtins.fetchurl
{
url = "https://github.com/ocaml/ocaml-lsp/releases/download/1.19.0/lsp-1.19.0.tbz";
sha256 = "1v75vqhr4i8bx0ys9k5v978qndi8l8salj4i9jzy377qlzqxk0z7";
url = "https://github.com/ocaml/ocaml-lsp/releases/download/1.20.0/lsp-1.20.0.tbz";
sha256 = "151cg2qs6ck7709chdnxsdxhz548rgj87j9q09g93infv87x9mli";
}
else if
lib.versionOlder "4.14" ocaml.version
&& !(lib.versionOlder "5.0" ocaml.version)
then
builtins.fetchurl
{
url = "https://github.com/ocaml/ocaml-lsp/releases/download/1.20.0-4.14/lsp-1.20.0-4.14.tbz";
sha256 = "11bjzcclc1bq319azgfv9m6vmhhcmsx5i6cyv5m179sp2d664dz5";
}

else o.src;
});

Expand Down Expand Up @@ -1685,11 +1695,9 @@ with oself;
inherit (ocamlformat-lib) src;
});
ocamlformat-lib = osuper.ocamlformat-lib.overrideAttrs (_: {
src = fetchFromGitHub {
owner = "ocaml-ppx";
repo = "ocamlformat";
rev = "7ebe9fc020a9faf24e2c1d021dd2163230e6707b";
hash = "sha256-J2PCDoBfF8fj4YF4pFn7Yj2YOIOIC5x35+qVJg9GGjo=";
src = builtins.fetchurl {
url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/0.27.0/ocamlformat-0.27.0.tbz";
sha256 = "0jzbs8nnn73rp75wif596kd6n3z10k8p2b5s4d7dm6hd12niqmxb";
};
});
ocamlformat-rpc-lib = buildDunePackage {
Expand Down Expand Up @@ -1795,23 +1803,29 @@ with oself;
ocaml-lsp = osuper.ocaml-lsp.overrideAttrs (o: {
buildInputs = o.buildInputs ++ [ base ];

postPatch = if lib.versionOlder "5.2" ocaml.version then "" else ''
substituteInPlace ocaml-lsp-server/src/merlin_config.ml --replace-fail \
'| `ERROR_MSG' '| `SOURCE_ROOT _ | `UNIT_NAME _ | `WRAPPING_PREFIX _ -> assert false | `ERROR_MSG'
substituteInPlace \
"ocaml-lsp-server/src/rename.ml" \
"ocaml-lsp-server/src/ocaml_lsp_server.ml" --replace-fail \
'List.map locs' 'List.map (fst locs)'
substituteInPlace \
"ocaml-lsp-server/src/ocaml_lsp_server.ml" --replace-fail \
'List.filter_map locs' 'List.filter_map (fst locs)'
substituteInPlace \
"ocaml-lsp-server/src/ocaml_lsp_server.ml" --replace-fail \
'List.find_opt locs' 'List.find_opt (fst locs)'
'';
postPatch =
if
lib.versionOlder "5.2" ocaml.version ||
(lib.versionOlder "4.14" ocaml.version &&
!(lib.versionOlder "5.0" ocaml.version))
then ""
else ''
substituteInPlace ocaml-lsp-server/src/merlin_config.ml --replace-fail \
'| `ERROR_MSG' '| `SOURCE_ROOT _ | `UNIT_NAME _ | `WRAPPING_PREFIX _ -> assert false | `ERROR_MSG'
substituteInPlace \
"ocaml-lsp-server/src/rename.ml" \
"ocaml-lsp-server/src/ocaml_lsp_server.ml" --replace-fail \
'List.map locs' 'List.map (fst locs)'
substituteInPlace \
"ocaml-lsp-server/src/ocaml_lsp_server.ml" --replace-fail \
'List.filter_map locs' 'List.filter_map (fst locs)'
substituteInPlace \
"ocaml-lsp-server/src/ocaml_lsp_server.ml" --replace-fail \
'List.find_opt locs' 'List.find_opt (fst locs)'
'';
});

ocaml-recovery-parser = osuper.ocaml-recovery-parser.overrideAttrs (o: {
Expand Down Expand Up @@ -2297,8 +2311,8 @@ with oself;
src = fetchFromGitHub {
owner = "reasonml";
repo = "reason";
rev = "20eb82b7dccbdc8ad3d41c2d0b6dba006d3583c8";
hash = "sha256-ZI6U31o48boRMf5PFwsBfoGNSx3GZX8Mzq4INQXkBHI=";
rev = "3.14.0";
hash = "sha256-m63aXSq/vjZdVKb8A1SMzmIBo1jhzOutas4aMZtAFPI=";
};

propagatedBuildInputs = o.propagatedBuildInputs ++ [ dune-build-info ];
Expand Down

0 comments on commit dcb625f

Please sign in to comment.