push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
diff --git a/serapi/serapi_paths.ml b/serapi/serapi_paths.ml
index 17cbb98..1fd85a0 100644
--- a/serapi/serapi_paths.ml
+++ b/serapi/serapi_paths.ml
@@ -23,10 +23,10 @@
let coq_loadpath_default ~implicit ~coq_path =
let open Mltop in
let mk_path prefix = coq_path ^ "/" ^ prefix in
- let mk_lp ~ml ~root ~dir ~implicit =
+ let mk_lp ~ml ~root ~dir ~implicit ~absolute =
{ recursive = true;
path_spec = VoPath {
- unix_path = mk_path dir;
+ unix_path = if absolute then dir else mk_path dir;
coq_path = root;
has_ml = ml;
implicit;
@@ -35,10 +35,12 @@ let coq_loadpath_default ~implicit ~coq_path =
(* in 8.8 we can use Libnames.default_* *)
let coq_root = Names.DirPath.make [Libnames.coq_root] in
let default_root = Libnames.default_root_prefix in
- [mk_lp ~ml:AddRecML ~root:coq_root ~implicit ~dir:"plugins";
- mk_lp ~ml:AddNoML ~root:coq_root ~implicit ~dir:"theories";
- mk_lp ~ml:AddRecML ~root:default_root ~implicit:false ~dir:"user-contrib";
- ]
+ [mk_lp ~ml:AddRecML ~root:coq_root ~implicit ~dir:"plugins" ~absolute:false;
+ mk_lp ~ml:AddNoML ~root:coq_root ~implicit ~dir:"theories" ~absolute:false;
+ mk_lp ~ml:AddRecML ~root:default_root ~implicit:false ~dir:"user-contrib" ~absolute:false;
+ ] @
+ List.map (fun dir -> mk_lp ~ml:AddRecML ~root:default_root ~implicit:false ~dir ~absolute:true)
+ Envars.coqpath
(******************************************************************************)
(* Generate a module name given a file *)

View File

@@ -0,0 +1,33 @@
diff --git a/serapi/serapi_paths.ml b/serapi/serapi_paths.ml
index a9c5074..eed92e3 100644
--- a/serapi/serapi_paths.ml
+++ b/serapi/serapi_paths.ml
@@ -23,10 +23,10 @@
let coq_loadpath_default ~implicit ~coq_path =
let open Loadpath in
let mk_path prefix = coq_path ^ "/" ^ prefix in
- let mk_lp ~ml ~root ~dir ~implicit =
+ let mk_lp ~ml ~root ~dir ~implicit ~absolute =
{ recursive = true;
path_spec = VoPath {
- unix_path = mk_path dir;
+ unix_path = if absolute then dir else mk_path dir;
coq_path = root;
has_ml = ml;
implicit;
@@ -35,11 +35,11 @@ let coq_loadpath_default ~implicit ~coq_path =
(* in 8.8 we can use Libnames.default_* *)
let coq_root = Names.DirPath.make [Libnames.coq_root] in
let default_root = Libnames.default_root_prefix in
- [mk_lp ~ml:AddRecML ~root:coq_root ~implicit ~dir:"plugins";
- mk_lp ~ml:AddNoML ~root:coq_root ~implicit ~dir:"theories";
- mk_lp ~ml:AddRecML ~root:default_root ~implicit:false ~dir:"user-contrib";
+ [mk_lp ~ml:AddRecML ~root:coq_root ~implicit ~dir:"plugins" ~absolute:false;
+ mk_lp ~ml:AddNoML ~root:coq_root ~implicit ~dir:"theories" ~absolute:false;
+ mk_lp ~ml:AddRecML ~root:default_root ~implicit:false ~dir:"user-contrib" ~absolute:false;
] @
- List.map (fun dir -> mk_lp ~ml:AddRecML ~root:default_root ~implicit:false ~dir)
+ List.map (fun dir -> mk_lp ~ml:AddRecML ~root:default_root ~implicit:false ~dir ~absolute:true)
Envars.coqpath
(******************************************************************************)

View File

@@ -0,0 +1,29 @@
diff --git a/serapi/serapi_paths.ml b/serapi/serapi_paths.ml
index b71fa60..0bec8c2 100644
--- a/serapi/serapi_paths.ml
+++ b/serapi/serapi_paths.ml
@@ -24,8 +24,8 @@ let coq_loadpath_default ~implicit ~coq_path =
let open Loadpath in
let mk_path prefix = coq_path ^ "/" ^ prefix in
(* let mk_ml = () in *)
- let mk_vo ~has_ml ~coq_path ~dir ~implicit =
- { unix_path = mk_path dir
+ let mk_vo ~has_ml ~coq_path ~dir ~implicit ~absolute =
+ { unix_path = if absolute then dir else mk_path dir
; coq_path
; has_ml
; recursive = true
@@ -40,10 +40,10 @@ let coq_loadpath_default ~implicit ~coq_path =
List.map fst plugins_dirs
in
ml_paths ,
- [ mk_vo ~has_ml:false ~coq_path:coq_root ~implicit ~dir:"theories"
- ; mk_vo ~has_ml:true ~coq_path:default_root ~implicit:false ~dir:"user-contrib";
+ [ mk_vo ~has_ml:false ~coq_path:coq_root ~implicit ~dir:"theories" ~absolute:false
+ ; mk_vo ~has_ml:true ~coq_path:default_root ~implicit:false ~dir:"user-contrib" ~absolute:false;
] @
- List.map (fun dir -> mk_vo ~has_ml:true ~coq_path:default_root ~implicit:false ~dir)
+ List.map (fun dir -> mk_vo ~has_ml:true ~coq_path:default_root ~implicit:false ~dir ~absolute:true)
Envars.coqpath
(******************************************************************************)

View File

@@ -0,0 +1,162 @@
{
lib,
fetchzip,
mkCoqDerivation,
coq,
coq-lsp,
version ? null,
}:
let
release = {
"8.20.0+0.20.0".sha256 = "sha256-Mll3m7CVfh52yA5zACDzMZk8lwhOONMMliqQ2l/ObKI=";
"8.19.0+0.19.3".sha256 = "sha256-QWRXBTcjtAGskZBeLIuX7WDE95KfH6SxV8MJSMx8B2Q=";
"8.18.0+0.18.3".sha256 = "sha256-3JGZCyn62LYJVpfXiwnSMxvdA2vQNTL7li2ZBPcjF0M=";
"8.17.0+0.17.3".sha256 = "sha256-XolzpJd8zs4LLyJO4eWvCiAJ0HJSGBJTGVSBClQRGnw=";
"8.16.0+0.16.3".sha256 = "sha256-22Kawp8jAsgyBTppwN5vmN7zEaB1QfPs0qKxd6x/7Uc=";
"8.15.0+0.15.0".sha256 = "1vh99ya2dq6a8xl2jrilgs0rpj4j227qx8zvzd2v5xylx0p4bbrp";
"8.14.0+0.14.0".sha256 = "1kh80yb791yl771qbqkvwhbhydfii23a7lql0jgifvllm2k8hd8d";
"8.13.0+0.13.0".sha256 = "0k69907xn4k61w4mkhwf8kh8drw9pijk9ynijsppihw98j8w38fy";
"8.12.0+0.12.1".sha256 = "048x3sgcq4h845hi6hm4j4dsfca8zfj70dm42w68n63qcm6xf9hn";
"8.11.0+0.11.1".sha256 = "1phmh99yqv71vlwklqgfxiq2vj99zrzxmryj2j4qvg5vav3y3y6c";
"8.10.0+0.7.2".sha256 = "1ljzm63hpd0ksvkyxcbh8rdf7p90vg91gb4h0zz0941v1zh40k8c";
};
in
(mkCoqDerivation {
pname = "serapi";
owner = "ejgallego";
repo = "coq-serapi";
inherit version release;
defaultVersion = lib.switch coq.version [
{
case = lib.versions.isEq "8.20";
out = "8.20.0+0.20.0";
}
{
case = lib.versions.isEq "8.19";
out = "8.19.0+0.19.3";
}
{
case = lib.versions.isEq "8.18";
out = "8.18.0+0.18.3";
}
{
case = lib.versions.isEq "8.17";
out = "8.17.0+0.17.3";
}
{
case = lib.versions.isEq "8.16";
out = "8.16.0+0.16.3";
}
{
case = lib.versions.isEq "8.15";
out = "8.15.0+0.15.0";
}
{
case = lib.versions.isEq "8.14";
out = "8.14.0+0.14.0";
}
{
case = lib.versions.isEq "8.13";
out = "8.13.0+0.13.0";
}
{
case = lib.versions.isEq "8.12";
out = "8.12.0+0.12.1";
}
{
case = lib.versions.isEq "8.11";
out = "8.11.0+0.11.1";
}
{
case = lib.versions.isEq "8.10";
out = "8.10.0+0.7.2";
}
] null;
useDune = true;
propagatedBuildInputs = with coq.ocamlPackages; [
cmdliner
findlib # run time dependency of SerAPI
ppx_sexp_conv
ppx_hash
sexplib
];
installPhase = ''
runHook preInstall
dune install --prefix $out --libdir $OCAMLFIND_DESTDIR coq-serapi
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/ejgallego/coq-serapi";
description = "SerAPI is a library for machine-to-machine interaction with the Coq proof assistant";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [
alizter
Zimmi48
];
};
}).overrideAttrs
(
o:
if lib.versions.isLe "8.19.0+0.19.3" o.version && o.version != "dev" then
let
ppx_deriving = coq.ocamlPackages.ppx_deriving.override { version = "5.2.1"; };
in
let
inherit (o) version;
in
{
src = fetchzip {
url = "https://github.com/ejgallego/coq-serapi/releases/download/${version}/coq-serapi-${
if version == "8.11.0+0.11.1" then version else builtins.replaceStrings [ "+" ] [ "." ] version
}.tbz";
sha256 = release."${version}".sha256;
};
patches =
lib.optional (lib.versions.isGe "8.16" version) ./sertop.patch
++ (
if version == "8.10.0+0.7.2" then
[
./8.10.0+0.7.2.patch
]
else if version == "8.11.0+0.11.1" then
[
./8.11.0+0.11.1.patch
]
else if version == "8.12.0+0.12.1" || version == "8.13.0+0.13.0" then
[
./8.12.0+0.12.1.patch
]
else if version == "8.14.0+0.14.0" || version == "8.15.0+0.15.0" then
[
./janestreet-0.15.patch
]
else if version == "8.16.0+0.16.3" || version == "8.17.0+0.17.0" then
[
./janestreet-0.16.patch
]
else
[
]
);
propagatedBuildInputs =
o.propagatedBuildInputs
++ (with coq.ocamlPackages; [
ppx_deriving
(ppx_deriving_yojson.override { inherit ppx_deriving; })
(ppx_import.override { inherit ppx_deriving; })
yojson
zarith # zarith needed because of Coq
]);
}
else
{ propagatedBuildInputs = o.propagatedBuildInputs ++ [ coq-lsp ]; }
)

View File

@@ -0,0 +1,80 @@
diff --git a/serlib/ser_constr.ml b/serlib/ser_constr.ml
index 69b2077..47fa06a 100644
--- a/serlib/ser_constr.ml
+++ b/serlib/ser_constr.ml
@@ -99,11 +99,13 @@ type 'constr pcase_branch =
let map_pcase_branch f (bi, c) = (bi, f c)
type 'types pcase_return =
- [%import: 'constr Constr.pcase_return]
+ [%import: 'types Constr.pcase_return]
[@@deriving sexp,yojson]
let map_pcase_return f (bi, c) = (bi, f c)
+type 'a identity = 'a [@@deriving sexp,yojson]
+
type _constr =
| Rel of int
| Var of Names.Id.t
@@ -126,7 +128,7 @@ type _constr =
| Float of Float64.t
| Array of Univ.Instance.t * _constr array * _constr * _types
[@@deriving sexp,yojson]
-and _types = _constr
+and _types = _constr identity
[@@deriving sexp,yojson]
let rec _constr_put (c : constr) : _constr =
diff --git a/serlib/ser_locus.ml b/serlib/ser_locus.ml
index 1f74ebc..cdcfc99 100644
--- a/serlib/ser_locus.ml
+++ b/serlib/ser_locus.ml
@@ -57,7 +57,7 @@ type clause_atom =
[%import: Locus.clause_atom]
[@@deriving sexp]
-type concrete_clause =
+type 'id concrete_clause =
[%import: 'id Locus.clause_expr]
[@@deriving sexp]
@@ -65,7 +65,7 @@ type hyp_location =
[%import: Locus.clause_atom]
[@@deriving sexp]
-type goal_location =
+type 'id goal_location =
[%import: 'id Locus.clause_expr]
[@@deriving sexp]
@@ -73,7 +73,7 @@ type simple_clause =
[%import: Locus.clause_atom]
[@@deriving sexp]
-type 'a or_like_first =
+type 'id or_like_first =
[%import: 'id Locus.clause_expr]
[@@deriving sexp]
diff --git a/serlib/ser_stdlib.ml b/serlib/ser_stdlib.ml
index fdb1720..3907548 100644
--- a/serlib/ser_stdlib.ml
+++ b/serlib/ser_stdlib.ml
@@ -16,6 +16,16 @@
open Sexplib.Conv
type nonrec 'a ref = 'a ref
+let ref = ref
+let ( ! ) = ( ! )
+let ( := ) = ( := )
+
+module Option = struct
+ type 'a t = 'a option =
+ | None
+ | Some of 'a
+ [@@deriving sexp]
+end
let ref_of_sexp = ref_of_sexp
let sexp_of_ref = sexp_of_ref

View File

@@ -0,0 +1,17 @@
diff --git a/serlib/ser_stdlib.ml b/serlib/ser_stdlib.ml
index 894d300..11c9217 100644
--- a/serlib/ser_stdlib.ml
+++ b/serlib/ser_stdlib.ml
@@ -28,6 +28,7 @@ let ref_to_yojson f x = f !x
let ref_of_yojson f x = Result.map (fun x -> ref x) (f x)
let hash_fold_ref = hash_fold_ref_frozen
let compare_ref = compare_ref
+let (==) x y = (==) x y
module Lazy = struct
type 'a t = 'a lazy_t
@@ -35,3 +36,4 @@ module Lazy = struct
end
module Option = Stdlib.Option
+module List = Stdlib.List

View File

@@ -0,0 +1,11 @@
--- a/sertop/sertop_loader.ml 2024-11-14 11:49:00.887576232 +0100
+++ b/sertop/sertop_loader.ml 2024-11-14 11:49:32.433659096 +0100
@@ -51,7 +51,7 @@
else None
let plugin_handler user_handler =
- let loader = Option.default (Fl_dynload.load_packages ~debug:false) user_handler in
+ let loader = Option.default (Fl_dynload.load_packages ?loadfile:None ~debug:false) user_handler in
fun fl_pkg ->
try
let _, fl_pkg = Mltop.PluginSpec.repr fl_pkg in