As it looks the windows opam repo is lacking patches for the two latest elpi releases 1.11.3 and 1.11.4. See: https://github.com/fdopen/opam-repository-mingw/tree/opam2/packages/elpi. Up to 1.11.2 there are patches.
@Enrico Tassi : are you aware of these patches? They don't look difficult - I think they are about removal of temporary files and probably also would work under other platforms. I am not sure why the author of the opam mingw repo doesn't push these upstream.
I am not sure if 1.11.3 / 1.11.4 needs more changes than this and I am also not so sure how this would be best tested.
I was not aware of that. I'm happy to integrate them upstream.
I'm happy to integrate them upstream.
Thanks, this helps! I am currently doing a Windows test build of 1.11.4 with the same patch as for 1.11.2.
FYI: https://github.com/LPCIC/elpi/pull/88 to have a CI run. I'm merging it in master, but master already contains more changes. If you really need a point release I can make it, otherwise it will wait some time.
thanks for the heads up!
But I don't have a windows CI instance, so your feedback on that platform is welcome
From looking at the patches, what should I look out for when testing?
If it compiles, then it's fine. The patch is only about the compilation.
Also coq-elpi contains a test suite that is compiled by default...
OK - I had only a very quick look and it looked like some temp file auto removal stuff which was automatic on Linux and explicit on Windows, but I looked at only for a 10 seconds.
@Enrico Tassi : There is one more issue on Windows - the good old shasum vs. sha1sum story. The story is: shasum is (on Windows and Linux - need to check macOS) a Perl script. It does exist and works from the shell, but a MinGW app cannot run a Perl script via a OCaml system
. So on Windows sha1sum works, but shasum not - isn't it great? I really need to replace the system command of OCaml on Windows - I have somethign which does she-bang analysis and is reasonably posix compliant.
What would you suggest to do? The options I see are:
1.) Install sha1sum on Mac via MacPorts or homebrew (via an opam conf package and depext)
2.) Hack my Windows build cygwin so that shasum is an executable (I could just copy sha1sum into the priority bin folder)
3.) Use some OCaml OS level preprocessing to choose between sha1sum and shasum depending on OS
2.) is easy but has the disadvnatage that the opam pachage does not work outside of my build environment on Windows then. 3.) is a hack so I tend towards 1.)
Sorry for the mess - I should have tested the shasum patch on Windows but I just tested that it exists and works on the shell.
Now that I think at it, if the problem is portability, then the easiest is to use ocaml's md5 instead. It is part of the standard library, and I need no crypto safety properties, it's just a check the cache is not about an outdated file. You need no "exec" for that, just a call to Digest.file
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Digest.html I can write a patch tomorrow.
Easier done than explained: https://github.com/LPCIC/elpi/pull/89
I'll backport the patch to the released version in a minute
There it is: https://github.com/LPCIC/elpi/commit/652e8a892963949d6d9245c3e5cb252010b14b78
This commit should apply on the tag v1.11.4 and solve your problems. I hope you can apply this via opam.
@Enrico Tassi : thanks for the quick fix - indeed I think that using an OCaml library function makes our lives much easier. It shouldn't be a problem to apply the patch via opam. Shall I push the opam package under the same version number (1.11.4) upstream?
I guess it's fine to keep the same version.
@Enrico Tassi : you didn't add the Windows temp file patch (as far as I can tell). Shall I add it as patch to the main opam repo as well? As far as I can tell with both patches Elip works fine on Windows - at least hierarchy-builder does compile.
Great. No I did not add the patch to the main opam archive. Sorry, I still don't get how the platform builds, I thougt you had a custom repo.
I think I should then call the package 1.11.4-1, Iguess they don't let change an already merged package
I thougt you had a custom repo.
Yes, the platform has a patch repo, but this is only intended for temporary patches until things are merged upstream - without this things would take much longer. So I first put it in the patch repo, test it, if it is fine I do a PR upstream and if this is merged I remove it from the patch repo. Ocaml (non Coq) opam packages like Elpi are more complicated because they also need to be merged to the MinGW fork of the opam repo, which can take a two weeks.
Here the PR: https://github.com/ocaml/opam-repository/pull/17214
Last updated: Apr 20 2024 at 00:02 UTC