ocaml / opam-repository

Main public package repository for opam, the source package manager of OCaml.
https://opam.ocaml.org
Creative Commons Zero v1.0 Universal
516 stars 1.12k forks source link

Z3 does not build by default on ubuntu 24.04 #25807

Open thomas-lamiaux opened 4 months ago

thomas-lamiaux commented 4 months ago

I tried to install z3 with opam on ubuntu 24.04, which fails with the following error message

opam install z3.4.13.0
[ERROR] Package z3.4.13.0 depends on the unavailable system package
'python3-distutils'. You can use `--no-depexts' to attempt installation
anyway.

It seems that z3 relies on the dependency distutils that is no longer available by default in Python 3.12 and above, as in ubuntu 24.04. Consequently preventing the automatic installation of z3 by opam.

(I was asked to report this issue after discussions on the coq zulip)

arbipher commented 4 months ago

I see. Let me check if z3 (not ocaml-z3) itself works well on Python 3.12 otherwises we can probably require a Python prior to 3.12.

arbipher commented 4 months ago

I found the z3.4.13.0 on homebrew at macos just works fine with Python 3.12. I also tried it on my mac and it obviously has no distutils.

I guess distutils is not necessary for z3 itself on other distros, so it should be safely to remove it. Let me try making a new z3 opamfile and test it on my ubuntu box later.

arbipher commented 4 months ago

I don't think distutil is really used in z3 anymore (asking for confirmation with this issue https://github.com/Z3Prover/z3/issues/7228). Let me just make a new opam by removing this.