When I do opam install . it tells me it’s installing camlp5.7.12 even though the git repo I’m sitting in is for version 8.00~alpha01. And I know (or am pretty sure) that it’s not using the modified opam file in the repo, b/c I added a “depexts” that is unsatisfied by the OS (two perl packages that I specifically removed before trying to install).
Is there a way to test the opam file before I actually publish?
ETA: oddly, if I control-C during the build (running with “-v -v -v -v” so I can tell when) I get the expected error-report:
><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build camlp5 7.12
└─
╶─ No changes have been performed
The packages you requested declare the following system dependencies. Please make sure they are installed before retrying:
libipc-system-simple-perl libstring-shellquote-perl
but if I do not control-C (let it run) it builds and installs (the packages are not required for the build, but rather for running the testsuite).
it -does- seem to run the test (though I don’t see any output while it’s doing so)
if I control-C during the build, it -does- complain that the external deps weren’t found
and if I do opam install . for a package that isn’t part of opam, it -does- use the opam file in the repo, and -does- fail (yes, it -does- fail) when the external deps aren’t found.
Unrelated to this issue: Dune users might want to avoid --kind=path until the solution to https://github.com/ocaml/opam/issues/4195 is released (to be included as part of 2.1.0). I did this for a while and ended up losing 80G disk space to duplicated _build directories
If one wants to test the effect of releasing at the current commit, --kind=git might be better.
I believe you need opam install --with-test to get the tests to run as part of the installation process. Additionally passing -vv should show the test output as well.
Opam runs tests using commands supplied in the .opam file. The current .opam file for Camlp5 doesn’t define a {with-test} rune, so I suspect that’s another problem.
the “tests” to which I allude are those run by opam itself, based on the “depext” stanza of the opam file.
I added a depext stanza to the camlp5 opam file, checked it in, etc, and then tried opam install .
when I did the same thing to a package that wasn’t in the opam-repository (a new one I’ve been writing), the depext test was run, failed, and I got the expected error-message.
I tried it again just now (making sure to remove the two Perl packages that I’m looking for an error from), and opam pin add camlp5 . successfully installs. Yep. So no error, even though those two Perl packages are missing.
On the testing before publish mechanism, as adviced in the manual: there is no specific check done by opam, it is only to check that the package installs well so you can check it goes as expected.
See also this issue about testing before publishing.
OK, I see what happened. As I said, I have two packages (camlp5 and pa_ppx). The first is published on opam, the second is not (yet). The first installs, the second does not. When the second fails, it complains about these two OS packages not being present (that are in depexts). I just now carefully read the failure output, and see that in fact, the failure was of my Makefile (that checks for these OS packages being present) and NOT of opam’s check. So Opam was merely making that report, viz.
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build pa_ppx ~dev
└─
╶─ No changes have been performed
The packages you requested declare the following system dependencies. Please make sure they are installed before retrying:
libipc-system-simple-perl libstring-shellquote-perl
and specifically the part at the end, as noise. It means nothing, because nothing was checked by opam before emitting this text.
Opam displays this message when there is a failure in a package actions (build, install), only if the package declares external dependencies. It is present as a hint, it doesn’t necessary mean that the failure origin is the missing external dependency.
It’s only since 2.1.0~alpha that opam embed the internal management of external dependencies. What is you opam version?