ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.25k stars 359 forks source link

Since update to 2.3.0 all builds using a local opam patch repo fail because patch files are not found any more. #6294

Closed MSoegtropIMC closed 6 hours ago

MSoegtropIMC commented 10 hours ago

In the recent nightly build of Coq Platform, which used opam 2.3.0, all build variants failed because patch files in local opam patch repos are not found any more. This results in errors like:

Error:  Patch file "/home/runner/.opam/CP.2024.10.0~8.19~2024.10/.opam-switch/build/ocamlfind.1.9.5~relocatable/0001-Fix-bug-when-installing-with-a-system-compiler.patch" not found.

See https://github.com/coq/platform/actions/runs/11828794723/job/32959519144#step:5:631

Coq Platform comes with local opam patch repos to do some patches we need. I am aware that for the base opam repo files are now handled in a different way, but I wonder what I am supposed to do with local opam patch repos.

The Coq Platform patch repos are here: https://github.com/coq/platform/tree/main/opam

I am sure this has upfront been discussed - my apologies that I didn't follow relevant discussions as much as I should. Please take this as quality stamp - opam is only rarely a source of problems. I tried to google this but couldn't find it easily.

rjbou commented 9 hours ago

Solution: You need to run opam admin update-extrafiles on your repositories.

Since 2.3.0~alpha1, there is a change about how opam loads repositories, especially regarding files in files/: they are no more silently added on-the-fly to the package, they need to be specified in the opam file with their checksums.

Failing package have patches in file repository, but not in the opam file. Once the repository updated, your CI should be fixed.

MSoegtropIMC commented 6 hours ago

Thank you for the quick response - CI is running. I guess this will solve the issue, so I am closing.

Actually I had extra-files records for patch files for many years but then stoped adding them about 2 years back because they did not seem to be required and it was a bit of effort to add them. With opam admin update-extrafiles the effort is of course minimal.