Created attachment 251000 [details] alt-ergo.patch Using the altErgo library with ocamlfind fails due to missing a dependency on Zarith. OCaml version 4.14.2 Enter #help;; for help. # #use "topfind";; - : unit = () Findlib has been successfully loaded. Additional directives: #require "package";; to load a package #list;; to list the available packages #camlp4o;; to load camlp4 (standard syntax) #camlp4r;; to load camlp4 (revised syntax) #predicates "p,q,...";; to set these predicates Topfind.reset();; to force that packages will be reloaded #thread;; to enable threads - : unit = () # #require "alt-ergo";; /usr/local/lib/ocaml/unix.cma: loaded /usr/local/lib/ocaml/nums.cma: loaded /usr/local/lib/ocaml/site-lib/num-top: added to search path /usr/local/lib/ocaml/site-lib/num-top/num_top.cma: loaded /usr/local/lib/ocaml/site-lib/num: added to search path /usr/local/lib/ocaml/site-lib/ocamlgraph: added to search path /usr/local/lib/ocaml/site-lib/ocamlgraph/graph.cma: loaded /usr/local/lib/ocaml/alt-ergo: added to search path # #require "alt-ergo";;t-ergo/altErgo.cmo: loaded Error: The external function `ml_z_pow' is not available $ ocamlobjinfo /usr/local/lib/ocaml/alt-ergo/altErgo.cmo | head -5 File /usr/local/lib/ocaml/alt-ergo/altErgo.cmo Unit name: AltErgo Interfaces imported: 0ef7aa8d9fbb9958a11d71eacb5ac636 AltErgo 517131d07104355def6a245e005d213c Z ... The attached patch fixes the META file, and adds the missing RUN_DEPENDS and LIB_DEPENDS to the alt-ergo package. While at it, the alt-ergo binary gets stripped.
Benjamin, would you to be the maintainer?
Hi zsolt, yes ok I can take on maintainership. Thanks!
Would you like update 2.5.4? And please add TEST_TARGET - as I see it will be "runtest" (https://github.com/OCamlPro/alt-ergo/blob/v2.5.x/Makefile#L124). More information: https://docs.freebsd.org/en/books/porters-handbook/book/#make-test
(In reply to Zsolt Udvari from comment #3) I'll look into updating the patch, thanks.
Created attachment 252883 [details] 0001-devel-ocaml-ppxlib-update-0.32.0-0.33.0.patch
Created attachment 252884 [details] 0002-math-alt-ergo-Update-to-2.5.4.patch
Created attachment 252885 [details] 0003-bump-port-revision-after-ocaml-ppxlib-and-ocaml-yojs.patch
Hi Zsolt, Please find the 3 patches: 1. the first is the patch from 280759, for updating devel/ocaml-ppxlib, it makes sens to apply it first given that the next patch will introduce new dependencies on devel/ocaml-ppxlib. 2. the second is alt-ergo update and all its dependencies, what you asked me to do. 3. the third is a PORTREVISON bump on packages that need it, following 1. and 2.. Note: in 2. some janestreet libraries are imported at v0.16.0 while upstream is at 0.17.0. It is expected: it requires further work to land properly w/o breakage.
(In reply to Benjamin Jacobs from comment #6) Uhh, there are many (17) new ports. Are they all required?
(In reply to Zsolt Udvari from comment #9) Yes, I'm afraid that they all are needed. I've already excluded what I could, some test only dependencies (ocaml-mdx, alcotest IIRC), so it could have been worse... (Yes, I'd like get to those packaged eventually to activate more test on the new packages, but one step at a time...) I hadn't realized that it was going to be that much work... But are talking of an 11 years gap here, so it is quite normal that things did evolve quite a bit since, both at the alt-ergo side and in the broader ocaml ecosystem. FWIW, some of the new ppx dependencies will be used by other packages that I intend to submit later on, so they won't be all for alt-ergo only.
(In reply to Benjamin Jacobs from comment #10) Okay, accept. I'll check the new ports so I need some time. Thanks for your hard work!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=d9c44a62acbfe6ed3268bdf1e3f34e089756ada9 commit d9c44a62acbfe6ed3268bdf1e3f34e089756ada9 Author: Benjamin Jacobs <freebsd@dev.thsi.be> AuthorDate: 2024-10-08 12:44:36 +0000 Commit: Zsolt Udvari <uzsolt@FreeBSD.org> CommitDate: 2024-10-08 12:56:48 +0000 math/alt-ergo: Update to 2.5.4, many new ports Replace GNU configure to dune builds system. Add do-test target. Submitter takes maintainership. Update WWW. Switch to DISTVERSION. The last update of alt-ergo in ports tree was about 10 years ago, the newest version requires many new libraries in ports tree. New ports: devel/ocaml-dolmen devel/ocaml-gen devel/ocaml-hmap devel/ocaml-linol devel/ocaml-lsp devel/ocaml-octavius devel/ocaml-pp_loc devel/ocaml-ppx_blob devel/ocaml-ppx_compare devel/ocaml-ppx_deriving devel/ocaml-ppx_hash devel/ocaml-ppx_js_style devel/ocaml-ppx_yojson_conv devel/ocaml-ppx_yojson_conv_lib devel/ocaml-psmt2-frontend devel/ocaml-trace math/ocaml-farith math/ocaml-ocplib-simplex textproc/ocaml-spelll PR: 279337 devel/Makefile | 16 + devel/ocaml-dolmen/Makefile (new) | 95 +++ devel/ocaml-dolmen/distinfo (new) | 3 + .../ocaml-dolmen/files/patch-src_bin_main.ml (new) | 36 + .../ocaml-dolmen/files/patch-src_lsp_main.ml (new) | 11 + .../files/patch-src_lsp_server.ml (new) | 27 + .../files/patch-src_lsp_state.ml (new) | 20 + devel/ocaml-dolmen/pkg-descr (new) | 7 + devel/ocaml-dolmen/pkg-plist (new) | 867 +++++++++++++++++++++ devel/ocaml-gen/Makefile (new) | 34 + devel/ocaml-gen/distinfo (new) | 3 + devel/ocaml-gen/pkg-descr (new) | 2 + devel/ocaml-gen/pkg-plist (new) | 53 ++ devel/ocaml-hmap/Makefile (new) | 43 + devel/ocaml-hmap/distinfo (new) | 3 + devel/ocaml-hmap/pkg-descr (new) | 2 + devel/ocaml-hmap/pkg-plist (new) | 10 + devel/ocaml-linol/Makefile (new) | 43 + devel/ocaml-linol/distinfo (new) | 3 + devel/ocaml-linol/files/patch-src_server.ml (new) | 35 + devel/ocaml-linol/pkg-descr (new) | 3 + devel/ocaml-linol/pkg-plist (new) | 54 ++ devel/ocaml-lsp/Makefile (new) | 47 ++ devel/ocaml-lsp/distinfo (new) | 3 + devel/ocaml-lsp/pkg-descr (new) | 5 + devel/ocaml-lsp/pkg-plist (new) | 158 ++++ devel/ocaml-ocplib-endian/Makefile | 2 +- devel/ocaml-octavius/Makefile (new) | 37 + devel/ocaml-octavius/distinfo (new) | 3 + devel/ocaml-octavius/pkg-descr (new) | 3 + devel/ocaml-octavius/pkg-plist (new) | 52 ++ devel/ocaml-pp_loc/Makefile (new) | 28 + devel/ocaml-pp_loc/distinfo (new) | 3 + devel/ocaml-pp_loc/pkg-descr (new) | 5 + devel/ocaml-pp_loc/pkg-plist (new) | 23 + devel/ocaml-ppx_blob/Makefile (new) | 40 + devel/ocaml-ppx_blob/distinfo (new) | 3 + devel/ocaml-ppx_blob/pkg-descr (new) | 2 + devel/ocaml-ppx_blob/pkg-plist (new) | 12 + devel/ocaml-ppx_compare/Makefile (new) | 38 + devel/ocaml-ppx_compare/distinfo (new) | 3 + devel/ocaml-ppx_compare/pkg-descr (new) | 5 + devel/ocaml-ppx_compare/pkg-plist (new) | 39 + devel/ocaml-ppx_deriving/Makefile (new) | 45 ++ devel/ocaml-ppx_deriving/distinfo (new) | 3 + devel/ocaml-ppx_deriving/pkg-descr (new) | 3 + devel/ocaml-ppx_deriving/pkg-plist (new) | 104 +++ devel/ocaml-ppx_hash/Makefile (new) | 42 + devel/ocaml-ppx_hash/distinfo (new) | 3 + devel/ocaml-ppx_hash/pkg-descr (new) | 5 + devel/ocaml-ppx_hash/pkg-plist (new) | 31 + devel/ocaml-ppx_js_style/Makefile (new) | 38 + devel/ocaml-ppx_js_style/distinfo (new) | 3 + devel/ocaml-ppx_js_style/pkg-descr (new) | 3 + devel/ocaml-ppx_js_style/pkg-plist (new) | 14 + devel/ocaml-ppx_yojson_conv/Makefile (new) | 48 ++ devel/ocaml-ppx_yojson_conv/distinfo (new) | 3 + devel/ocaml-ppx_yojson_conv/pkg-descr (new) | 4 + devel/ocaml-ppx_yojson_conv/pkg-plist (new) | 39 + devel/ocaml-ppx_yojson_conv_lib/Makefile (new) | 38 + devel/ocaml-ppx_yojson_conv_lib/distinfo (new) | 3 + devel/ocaml-ppx_yojson_conv_lib/pkg-descr (new) | 2 + devel/ocaml-ppx_yojson_conv_lib/pkg-plist (new) | 29 + devel/ocaml-psmt2-frontend/Makefile (new) | 31 + devel/ocaml-psmt2-frontend/distinfo (new) | 3 + devel/ocaml-psmt2-frontend/pkg-descr (new) | 3 + devel/ocaml-psmt2-frontend/pkg-plist (new) | 69 ++ devel/ocaml-trace/Makefile (new) | 47 ++ devel/ocaml-trace/distinfo (new) | 3 + devel/ocaml-trace/pkg-descr (new) | 13 + devel/ocaml-trace/pkg-plist (new) | 96 +++ math/Makefile | 2 + math/alt-ergo/Makefile | 85 +- math/alt-ergo/distinfo | 5 +- .../patch-src_bin_common_parse__command.ml (new) | 190 +++++ math/alt-ergo/pkg-plist | 563 ++++++++++++- math/ocaml-farith/Makefile (new) | 40 + math/ocaml-farith/distinfo (new) | 3 + math/ocaml-farith/pkg-descr (new) | 2 + math/ocaml-farith/pkg-plist (new) | 171 ++++ math/ocaml-ocplib-simplex/Makefile (new) | 43 + math/ocaml-ocplib-simplex/distinfo (new) | 3 + math/ocaml-ocplib-simplex/pkg-descr (new) | 4 + math/ocaml-ocplib-simplex/pkg-plist (new) | 65 ++ textproc/Makefile | 1 + textproc/ocaml-spelll/Makefile (new) | 35 + textproc/ocaml-spelll/distinfo (new) | 3 + textproc/ocaml-spelll/pkg-descr (new) | 8 + textproc/ocaml-spelll/pkg-plist (new) | 13 + 89 files changed, 3807 insertions(+), 35 deletions(-)
Committed, thanks!
Thanks to you! :-)
I notice that the 3rd patch hasn't been applied, and I'd like to reflect a bit on this. The problem is that an ocaml library has a strict dependency mecanism. Instead of providing and depending on a major version of a so-name, as it is the case e.g. with a C libary (I'm probably over-simplifying here...), an ocaml library records the public signature of all the interfaces provided and imported, both in byte-code and the native-code cases, and both at the compilation-time and at run-time (for dynamically loaded libraries). It means that if the signature of an imported library (a dependency) changes following its port update, then any consuming library has to be rebuild or else it becomes unusable (because its dependencies cannot be satisfied anymore since the recorded signatures, or the hashes thereof, do not match anymore). So on one hand I've been trying to prevent that from happening by figuring out what needs to be bumped after an update. But this process is flawed in the following aspects: 1) it is quite complicated to figure out the minimal set of packages to be rebuild 2) as much as I try to delay the submission of some port updates, it is still impossible (for me) to figure out in which order and how the various ports gets updated (e.g. in this instance with ppxlib and yojson) 3) this problem is likely to affect the building of official packages and the usability of those, but it seems to me even more impossible to deduce the state of the builders and to track all released branches. Noting that there a big gun solution, namely to revision-bump all the ocaml ports during the update of any ocaml library, but this too seems very much impractical to me. So on the other hand, I'm tempted to ignore this problem complety. As the number of user is likely to be counted on a singled hand, and those users (if they exist) will have learned that they can fix a broken compilation by deinstalling the broken library and trying again (rinse and repeat). Anyway, this comment is just a side note, any idea welcome. Thanks again for reviewing, tidying and applying the others patches. P.S.: I've been trying to deduce list of packages to be updated by building a graph using the BUILD/RUN/LIB_DEPENDS information with some heuristics, but it is still unclear to me if this approach is sound (and assuming this information to be precisely recorded). P.P.S: Standard poudriere users are most likely able to build any package at any time because poudriere rebuilds all depending packages by default. However, since PORT_REVISION will not be bumped, the systems consuming those packages will get broken. To put in another way, only the packages which are only providing simple binaries will keep on working. Anything relying on ocaml compiler libraries, i.e. other ocaml libraries and executables "dlopen-ing" ocaml libraries, gets broken. P.P.P.S: Debian has a solution to this problem which is alike providing debug-info files containing the signature hashes, suffixing the package version with a hash of the hashes of all the dependencies, and finally using strict version equalities in the package version constraints. It is unclear (to me) if a similar solution could be implemented on the ports system.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9133b766df7c5f71d498d5c5ebe8a3b7e00fdf77 commit 9133b766df7c5f71d498d5c5ebe8a3b7e00fdf77 Author: Benjamin Jacobs <freebsd@dev.thsi.be> AuthorDate: 2024-10-09 05:24:53 +0000 Commit: Zsolt Udvari <uzsolt@FreeBSD.org> CommitDate: 2024-10-09 05:28:31 +0000 */*: Bump PORTREVISIONS after ocaml-ppxlib update Commit ID: 25d9e3539b7ff862de62ea62a5044fc6e5faf953 PR: 279337 converters/ocaml-base64/Makefile | 1 + devel/ocaml-bos/Makefile | 2 +- devel/ocaml-camlp5/Makefile | 2 +- devel/ocaml-cstruct/Makefile | 1 + devel/ocaml-ipaddr/Makefile | 1 + devel/ocaml-logs/Makefile | 2 +- devel/ocaml-lwt/Makefile | 1 + devel/ocaml-ppx_sexp_conv/Makefile | 1 + ftp/ocaml-ocurl/Makefile | 2 +- math/abella/Makefile | 2 +- security/ocaml-lwt_ssl/Makefile | 1 + 11 files changed, 11 insertions(+), 5 deletions(-)
(In reply to Benjamin Jacobs from comment #15) Sorry, I forgot it. And thanks for explanation. About dependencies: in the /usr/ports can run `make index'. This command generates a big INDEX-(freebsd-major-version) file (for example INDEX-14 on my 14.1) - it takes some minutes (depends on your machine). This files contains information of every ports and can parse it (with awk, grep, sed, etc.). I created a small script which list ports which depends on a specified port: #!/bin/sh port=$1 [ -z "${port}" ] && exit 1 indexFile=/usr/ports/INDEX-* awk -F '|' -v searchport=${port} \ '$8 ~ searchport || $9 ~ searchport \ {gsub("/usr/ports/", "", $2) ; print $2}' \ ${indexFile} And can run /usr/ports/Tools/scripts/bump-revision.sh :) Or there is another script: /usr/ports/Tools/scripts/search_lib_depends_and_bump.sh - but it's slow because checks every port with `make -V LIB_DEPENDS' (calls one `make' per port). Or there is a port named `portgrep': can run `portgrep -l foo' (or `portgrep -b foo') to list which ports LIB/BUILDdepends on `foo'.
Ooops, a small typo slipped into the new pkg-plist, this should fix it. Can you fix it? diff --git a/math/alt-ergo/pkg-plist b/math/alt-ergo/pkg-plist index e96f22f4e074..a66a91ea17c7 100644 --- a/math/alt-ergo/pkg-plist +++ b/math/alt-ergo/pkg-plist @@ -554,5 +554,5 @@ bin/alt-ergo %%OCAML_SITELIBDIR%%/alt-ergo-parsers/AltErgoParsers.cmxs %%DATADIR%%/preludes/fpa-theory-2017-01-04-16h00.ae %%DATADIR%%/preludes/fpa-theory-2019-06-14-11h00.ae -%%DATADIR%%/alt-ergo/preludes/fpa-theory-2019-10-08-19h00.ae +%%DATADIR%%/preludes/fpa-theory-2019-10-08-19h00.ae %%MANPAGES%%share/man/man1/alt-ergo.1.gz BTW, thanks for sharing your scripts and tips! Here is a small ocaml tool to do something similar with the index file and math/ocaml-ocamlgraph. It is useful, but not 100% correct to solve the problem that I described above. Sorry for the lack of coment. ports_index_rdepends.ml: --8<--8<---8<---- module G = Graph.Persistent.Digraph.Concrete (String) module O = Graph.Oper.P (G) module T = Graph.Traverse.Dfs (G) module PkgOrigin : sig include Graph.Sig.COMPARABLE with type t = private string val of_path : string -> t val to_string : t -> string end = struct include String let of_path p = String.split_on_char '/' p |> List.rev |> List.to_seq |> Seq.take 2 |> List.of_seq |> List.rev |> String.concat "/" let to_string t = t end module PkgOriginSet = Set.Make(PkgOrigin) module StringSet = Set.Make(String) let parse_index file updated = let module S = Set.Make (String) in let module H = Hashtbl.Make (String) in let roots = ref S.empty in let pkg_origin_map = H.create 34781 in let updated' = List.map PkgOrigin.of_path updated |> PkgOriginSet.of_list in let rec build_graph ic g = let add g port deps = List.fold_left (fun g dep -> G.add_edge g port dep) g ((String.split_on_char ' ' deps) |> List.filter ((<>) String.empty)) in try let line = Stdlib.input_line ic in match String.split_on_char '|' line with | [ port; path; _prefix; _info; _pkg_descr; _maint; _index; b_deps; r_deps; _www; _e_deps; _p_deps; _f_deps ] -> let pkg_origin = PkgOrigin.of_path path in H.add pkg_origin_map port pkg_origin; if PkgOriginSet.mem pkg_origin updated' then roots := S.add port !roots; let g = add g port b_deps in let g = add g port r_deps in build_graph ic g | _ -> failwith "invalid INDEX" with End_of_file -> O.mirror g in let g = build_graph (open_in file) G.empty in let result = S.fold (G.fold_succ (fun v -> PkgOriginSet.add (H.find pkg_origin_map v)) g) !roots PkgOriginSet.empty in PkgOriginSet.iter (fun e -> print_endline @@ PkgOrigin.to_string e) result let main () = match Array.to_list Sys.argv with _arg0 :: index :: updated -> let _g = parse_index index updated in () | _ -> print_endline "usage $0 INDEX ports ..." ;; main () ;; --8<--8<---8<---- dune-project: --8<--8<---8<---- (lang dune 3.7) (name ports_tools) (generate_opam_files false) (license BSD2CLAUSE) (package (name ports_tools)(allow_empty)) --8<--8<---8<---- dune: --8<--8<---8<---- (executable (name ports_index_rdepends) (libraries ocamlgraph)) --8<--8<---8<----
For the record, LIB_DEPENDS is not useable in the ocaml context. The heuristic/approximation is to have both run_depends and build_depends together, although there are many corner cases a subtelties that I have forgotten already...
Fixing typo...
(In reply to Benjamin Jacobs from comment #18) I've tested the alt-ergo building and as I remember it passed. Why doesn't appear an error?
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=71ae64f8655c9d3335eddfa27c7d3261dfed7847 commit 71ae64f8655c9d3335eddfa27c7d3261dfed7847 Author: Benjamin Jacobs <freebsd@dev.thsi.be> AuthorDate: 2024-10-10 06:02:06 +0000 Commit: Zsolt Udvari <uzsolt@FreeBSD.org> CommitDate: 2024-10-10 06:02:49 +0000 math/alt-ergo: Fix typo in pkg-plist PR: 279337 Approved by: submitter is maintainer math/alt-ergo/pkg-plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
(In reply to Zsolt Udvari from comment #21) It does report an error as I found out while testing the fix for PR280761. I'd assume that error has been introduced between your testing and when you (?) fixed the pkg-plist to use %%DATADIR%% (because my original submission did not have it). I can't explain it further than that :) Thanks!