Skip to content

Commit

Permalink
Start testing 4.14 (nix-ocaml#172)
Browse files Browse the repository at this point in the history
* Start testing 4.14

* hopefully this unbreaks everything?

* eliom too

* add missing patch file

* upgrade sources and override dune_3

* fix batteries

* fix 4.14 x-compilation

* misc multicore fixes

* more multicore fixes

* remove duplicate

* fix merlin and make reason work for 5.00

* clean up, ulrik was right about uucp
  • Loading branch information
anmonteiro authored Feb 21, 2022
1 parent 4266edd commit 6f4004d
Show file tree
Hide file tree
Showing 12 changed files with 226 additions and 79 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
setup:
- { ocaml-version: 4_12, continue-on-error: false }
- { ocaml-version: 4_13, continue-on-error: false }
- { ocaml-version: 4_14, continue-on-error: false }
- { ocaml-version: 5_00, continue-on-error: true }
name: Native packages (Linux, OCaml ${{ matrix.setup.ocaml-version }})
runs-on: ubuntu-latest
Expand Down Expand Up @@ -49,6 +50,7 @@ jobs:
setup:
- { ocaml-version: 4_12, continue-on-error: false }
- { ocaml-version: 4_13, continue-on-error: false }
- { ocaml-version: 4_14, continue-on-error: false }
- { ocaml-version: 5_00, continue-on-error: true }
name: Native packages (macOS, OCaml ${{ matrix.setup.ocaml-version }})
runs-on: macos-latest
Expand Down Expand Up @@ -78,6 +80,7 @@ jobs:
setup:
- { ocaml-version: 4_12, continue-on-error: false }
- { ocaml-version: 4_13, continue-on-error: false }
- { ocaml-version: 4_14, continue-on-error: false }
- { ocaml-version: 5_00, continue-on-error: true }
target:
- arm64
Expand Down
8 changes: 8 additions & 0 deletions ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ let
"functory"
"getopt"

# Incompatible with 4.14
"pcap-format"
"notty"
"ppx_tools"
"eliom"
"ocsigen_server"
"ocsigen-toolkit"

# incompatible with newer menhir
"odate"

Expand Down
2 changes: 1 addition & 1 deletion cross/ocaml.nix
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ in
'';
installTargets = o.installTargets ++ [ "installoptopt" ];
patches = [
(if lib.versionOlder "5.00" ocaml.version
(if lib.versionOlder "4.14" ocaml.version
then ./cross_5_00.patch
else if lib.versionOlder "4.13" ocaml.version
then ./cross_4_13.patch
Expand Down
8 changes: 8 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ in
(cross-overlays ++ static-overlays));
};


ocamlformat = super.ocamlformat.overrideAttrs (_: {
postPatch = ''
substituteInPlace vendor/parse-wyc/menhir-recover/emitter.ml \
--replace \
"String.capitalize" "String.capitalize_ascii"
'';
});
# Other packages

lib = lib.fix (self: lib //
Expand Down
118 changes: 114 additions & 4 deletions ocaml/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ with oself;

});

batteries = osuper.batteries.overrideAttrs (_: {
src = builtins.fetchurl {
url = https://github.com/ocaml-batteries-team/batteries-included/archive/a7276a8d41b31035423235b2395aa82ab5d6f392.tar.gz;
sha256 = "0b5wy0m83ynw2lz50vx67p1dfgdkbc8y6kfkvxhi8zxpiwm27kml";
};
});

biniou = osuper.biniou.overrideAttrs (o: {
patches = [
(fetchpatch {
Expand Down Expand Up @@ -257,12 +264,18 @@ with oself;
url = https://github.com/ocamllabs/ocaml-ctypes/archive/0.17.1.tar.gz;
sha256 = "1sd74bcsln51bnz11c82v6h6fv23dczfyfqqvv9rxa9wp4p3qrs1";
};

postPatch = ''
substituteInPlace ./Makefile --replace "bigarray" ""
'';
});

ctypes = osuper.ctypes.overrideAttrs (_: {
src = builtins.fetchurl {
url = https://github.com/ocamllabs/ocaml-ctypes/archive/57f069897b36f784ff0296c40f726e3baf5d8a1d.tar.gz;
sha256 = "05wy8nxprj4ka1dk5h4nmnmlrqildmlrqx37pbyvc8az16awz5x3";
};
});

cudf = buildDunePackage {
pname = "cudf";
version = "0.5.97+500";
Expand All @@ -289,6 +302,17 @@ with oself;

decimal = callPackage ./decimal { };

decompress = disableTests osuper.decompress;

dolog = buildDunePackage {
pname = "dolog";
version = "6.0.0";
src = builtins.fetchurl {
url = https://github.com/UnixJunkie/dolog/archive/refs/tags/v6.0.0.tar.gz;
sha256 = "0idxs1lnpsh49hvxnrkb3ijybd83phzbxfcichchw511k9ismlia";
};
};

domainslib =
if lib.versionAtLeast ocaml.version "5.00" then
callPackage ./domainslib { }
Expand Down Expand Up @@ -319,7 +343,9 @@ with oself;
then oself.dune_2
else osuper.dune_1;

dune_2 = osuper.dune_2.overrideAttrs (_: {
dune_2 = dune_3;

dune_3 = osuper.dune_3.overrideAttrs (_: {
src = builtins.fetchurl {
url = https://github.com/ocaml/dune/archive/435f026896a0410546c4cef73c005bbca364a177.tar.gz;
sha256 = "1jqiaqxyab487f2gzghy5l10asljkb824xjaryl2vpck85yiqbp1";
Expand All @@ -329,6 +355,7 @@ with oself;
CoreServices
]);
});

dune-configurator = callPackage ./dune/configurator.nix { };
dyn = callPackage ./dune/dyn.nix { };
ordering = callPackage ./dune/ordering.nix { };
Expand Down Expand Up @@ -580,7 +607,22 @@ with oself;
propagatedBuildInputs = [ bigstringaf ];
};

lutils = buildDunePackage {
pname = "lutils";
version = "1.51.3";
src = builtins.fetchurl {
url = https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/lutils/-/archive/1.51.3/lutils-1.51.3.tar.gz;
sha256 = "0brbv0hzddac8v9kfm97i81d0x9nnlfpmwgk0mzc2vpy3p3vd315";
};
propagatedBuildInputs = [ num camlp-streams ];

postPatch = ''
substituteInPlace lib/dune --replace "(libraries " "(libraries camlp-streams "
'';
};

lwt = osuper.lwt.overrideAttrs (o: {

version = "5.5.0";
propagatedBuildInputs = o.propagatedBuildInputs ++ [ bigarray-compat ];
src = builtins.fetchurl {
Expand Down Expand Up @@ -696,6 +738,21 @@ with oself;
ppx_deriving_bson = callPackage ./mongo/ppx.nix { };
bson = callPackage ./mongo/bson.nix { };

mimic = osuper.mimic.overrideAttrs (_: {
src = builtins.fetchurl {
url = https://github.com/dinosaure/mimic/archive/d548777d2f33b88ea04b2d0550df020578419b4e.tar.gz;
sha256 = "17mk21f76yl0yiskybnvd4zwr073m1rh2l5hswj34dyvcfzz153y";
};

postPatch = ''
substituteInPlace lib/implicit.ml --replace "Obj.extension_id" "Obj.Extension_constructor.id"
substituteInPlace lib/implicit.ml --replace "Stdlib.Obj.((extension_id (extension_constructor t" "Stdlib.Obj.Extension_constructor.((id (of_val t"
substituteInPlace test/dune --replace "bigarray" ""
'';
});

mrmime = osuper.mrmime.overrideAttrs (o: {
propagatedBuildInputs = o.propagatedBuildInputs ++ [ hxd jsonm cmdliner ];

Expand Down Expand Up @@ -727,21 +784,26 @@ with oself;
};

});
bigstring = osuper.bigstring.overrideAttrs (_: {

bigstring = osuper.bigstring.overrideAttrs (_: {
postPatch =
if lib.versionAtLeast ocaml.version "5.00" then ''
substituteInPlace src/dune --replace " bigarray" ""
'' else "";
});

mmap = osuper.mmap.overrideAttrs (o: {
src = builtins.fetchurl {
url = https://github.com/mirage/mmap/archive/41596aa.tar.gz;
sha256 = "0fxv8qff9fsribymjgka7rq050i9yisph74nx642i5z7ng8ahlxq";
};
});


npy = osuper.npy.overrideAttrs (_: {
postPatch = ''
substituteInPlace src/dune --replace " bigarray" ""
'';
});

num = osuper.num.overrideAttrs (o: {
src = builtins.fetchurl {
Expand Down Expand Up @@ -806,6 +868,13 @@ with oself;
preConfigure = "";
});

ocp-index = osuper.ocp-index.overrideAttrs (_: {
src = builtins.fetchurl {
url = https://github.com/OCamlPro/ocp-index/archive/a6b3a022522359a38618777c685363a750cb82d4.tar.gz;
sha256 = "1rh1z48qj946zq2vmxrfib0p3br1p5gkpfb48rq5kz3j82sfs2jk";
};
});

ocplib-endian = osuper.ocplib-endian.overrideAttrs (o: {
src = builtins.fetchurl {
url = https://github.com/ocamlpro/ocplib-endian/archive/7179dd6e66.tar.gz;
Expand Down Expand Up @@ -884,6 +953,17 @@ with oself;
doCheck = false;
});

ppx_cstubs = osuper.ppx_cstubs.overrideAttrs (_: {
postPatch =
if lib.versionOlder "4.14" osuper.ocaml.version
then ''
substituteInPlace "src/custom/ppx_cstubs_custom.cppo.ml" --replace \
"(str, _sg, _sn, newenv)" \
"(str, _sg, _sn, _shp, newenv)"
''
else "";
});

ppx_jsx_embed = callPackage ./ppx_jsx_embed { };

ppx_rapper = callPackage ./ppx_rapper { };
Expand Down Expand Up @@ -1017,6 +1097,17 @@ with oself;
});

sedlex = oself.sedlex_2;
sedlex_2 = osuper.sedlex_2.overrideAttrs (o: {
src = builtins.fetchurl {
url = https://github.com/ocaml-community/sedlex/archive/refs/tags/v2.5.tar.gz;
sha256 = "199ql06hpk3p2n1hbghl1iky8zwr7lzl8n4qf14pfp0lvgvdr62v";
};
preBuild = ''
substituteInPlace src/lib/dune --replace "(libraries " "(libraries camlp-streams "
'';

propagatedBuildInputs = o.propagatedBuildInputs ++ [ camlp-streams ];
});

session = callPackage ./session { };
session-redis-lwt = callPackage ./session/redis.nix { };
Expand Down Expand Up @@ -1054,6 +1145,15 @@ with oself;
propagatedBuildInputs = [ xmlm uri ptime ];
};

tar = osuper.tar.overrideAttrs (_: {
src = builtins.fetchurl {
url = https://github.com/mirage/ocaml-tar/releases/download/v2.0.0/tar-mirage-v2.0.0.tbz;
sha256 = "0aaazix3d6a3jjskzyilg2jwlfp54dw5mfxzkvc65xswaqgly80b";
};
buildInputs = [ ];

});

toml = osuper.toml.overrideAttrs (_: {
src = builtins.fetchurl {
url = https://github.com/ocaml-toml/to.ml/archive/41172b739dff43424a12f7c1f0f64939e3660648.tar.gz;
Expand Down Expand Up @@ -1104,6 +1204,12 @@ with oself;
'';
});

tyxml = osuper.tyxml.overrideAttrs (_: {
src = builtins.fetchurl {
url = https://github.com/ocsigen/tyxml/archive/c28e871df6db66a261ba541aa15caad314c78ddc.tar.gz;
sha256 = "10vbg9qdmmb96vrpv65px2ipshckzn12k2z611261ii7ab2y4s2s";
};
});
tyxml-jsx = callPackage ./tyxml/jsx.nix { };
tyxml-ppx = callPackage ./tyxml/ppx.nix { };
tyxml-syntax = callPackage ./tyxml/syntax.nix { };
Expand Down Expand Up @@ -1132,6 +1238,10 @@ with oself;
buildPhase = "${topkg.buildPhase} --with-cmdliner false";
});

uucp = osuper.uucp.overrideAttrs (o: {
buildInputs = o.buildInputs ++ [ uucd ];
});

uunf = osuper.uunf.overrideAttrs (_: {
buildPhase = ''
# big enough stack size
Expand Down
23 changes: 15 additions & 8 deletions ocaml/merlin/default.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
{ lib
, substituteAll
, ocaml
, dune_2
, dune_3
, buildDunePackage
, dot-merlin-reader
, yojson
, csexp
, result
}:

# let camlp-streams-patch = if (lib.versionOlder "5.00" ocaml.version)a then

# in
buildDunePackage {
pname = "merlin";
inherit (dot-merlin-reader) src version;

patches = [
(substituteAll {
src = ./fix-paths.patch;
dot_merlin_reader = "${dot-merlin-reader}/bin/dot-merlin-reader";
dune = "${dune_2}/bin/dune";
})
] ++ lib.optional (lib.versionOlder "4.12" ocaml.version) ./camlp-streams.patch;
postPatch = ''
substituteInPlace src/kernel/mconfig_dot.ml --replace \
'let prog = "dot-merlin-reader"' \
'let prog = "${dot-merlin-reader}/bin/dot-merlin-reader"'
substituteInPlace src/kernel/mconfig_dot.ml --replace \
'let prog = "dune"' \
'let prog = "${dune_3}/bin/dune"'
substituteInPlace src/frontend/ocamlmerlin/dune --replace \
'(libraries ' \
'(libraries camlp-streams '
'';

buildInputs = [ dot-merlin-reader yojson csexp result ];
}
47 changes: 27 additions & 20 deletions ocaml/merlin/dot-merlin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,39 @@ buildDunePackage {
pname = "dot-merlin-reader";
version = version;
src =
if (lib.versionOlder "4.13" ocaml.version) then
if (lib.versionOlder "4.14" ocaml.version)
then
builtins.fetchurl
{
url = https://github.com/ocaml/merlin/archive/82723b88659112e76f8da78830243e4c557c60f5.tar.gz;
sha256 = "1yd70s78a3csacmn9zs9z2qhqghc6844ly5c5lzgghib304sw75l";
}
else if (lib.versionOlder "4.13" ocaml.version)
then
builtins.fetchurl
{
url = https://github.com/ocaml/merlin/releases/download/v4.4-413/merlin-4.4-413.tbz;
sha256 = "1ilmh2gqpwgr51w2ba8r0s5zkj75h00wkw4az61ssvivn9jxr7k0";
}
else if (lib.versionOlder "4.12" ocaml.version)
then
builtins.fetchurl
{
url = https://github.com/ocaml/merlin/releases/download/v4.4-412/merlin-4.4-412.tbz;
sha256 = "18xjpsiz7xbgjdnsxfc52l7yfh22harj0birlph4xm42d14pkn0n";
}
else if (lib.versionOlder "4.11" ocaml.version)
then
builtins.fetchurl
{
url = https://github.com/ocaml/merlin/releases/download/v4.1-411/merlin-v4.1-411.tbz;
sha256 = "0zckb729mhp1329bcqp0mi1lxxipzbm4a5hqqzrf2g69k73nybly";
}
else
if (lib.versionOlder "4.12" ocaml.version)
then
builtins.fetchurl
{
url = https://github.com/ocaml/merlin/releases/download/v4.4-412/merlin-4.4-412.tbz;
sha256 = "18xjpsiz7xbgjdnsxfc52l7yfh22harj0birlph4xm42d14pkn0n";
}
else if (lib.versionOlder "4.11" ocaml.version)
then
builtins.fetchurl
{
url = https://github.com/ocaml/merlin/releases/download/v4.1-411/merlin-v4.1-411.tbz;
sha256 = "0zckb729mhp1329bcqp0mi1lxxipzbm4a5hqqzrf2g69k73nybly";
}
else
builtins.fetchurl {
url = https://github.com/ocaml/merlin/releases/download/v3.4.2/merlin-v3.4.2.tbz;
sha256 = "109ai1ggnkrwbzsl1wdalikvs1zx940m6n65jllxj68in6bvidz1";
};
builtins.fetchurl {
url = https://github.com/ocaml/merlin/releases/download/v3.4.2/merlin-v3.4.2.tbz;
sha256 = "109ai1ggnkrwbzsl1wdalikvs1zx940m6n65jllxj68in6bvidz1";
};

postPatch = ''
substituteInPlace src/utils/std.ml --replace "= capitalize" "= capitalize_ascii"
Expand Down
Loading

0 comments on commit 6f4004d

Please sign in to comment.