Closed kkirstein closed 3 months ago
opam-repository-mingw has a patch for ocamlbuild apparently. I have no idea what it’s supposed to fix but could you give it try to see if it fixes your issue?
@kit-ty-kate You pointed to the right location. Actually I had a mix-up of different versions.
I have both repos upstream opam-repository
from ocaml.org & opam-repository-mingw
from github/fdopen in my opam setup (This is the suggested configuration, as the fdopen repo is deprecated for ordinary packages). I thought opam always takes the packages from the first repo, if available, but it seems to give priority to the highest patchlevel.
Anyway, here is the (corrected) list of ocamlbuild version & observed issue:
0.14.0-patch
(opam-repository-mingw
): works0.14.0
(opam-repository
): observed hygienic issue0.14.1
(opam-repository
): observed hygienic issueSo, it looks like the patch from opam-repository-mingw
is needed for Windows/Cygwin. It would be nice to have that merged into the ocamlbuild
sources. Are there any reasons not to do this? If yes, I would suggest to add a constraint to ocamlbuild.opam
like os != "win32" & os-distribution != "cygwinports"
, so one can not accidently pick up an unpatched version.
Are there any reasons not to do this?
To my knowledge, no one has done the work of submitting the patch upstream (here) yet, and (hopefully) explaining what it does.
@kkirstein if you were interested in getting some of this patch merged, I think that would be very nice! There are some parts that were not intended for upstreaming (they are redundant with other code, etc., not written with maintenability in mind), some parts that could be simplified, some parts whose purpose/effect is unclear, etc. (And of course no tests :-) I think someone would need to split it into separate commits that make sense individually (instead of mixing unrelated things together), and submit PRs. I'm happy to help by reviewing the PRs then, but given that I don't have a Windows machine I cannot help with the testing.
Note: another route for you would be of course to submit an ocamlbuild.14.1 package in opam-repository-mingw, with the same patch as before (I would guess that the rebase would be very easy). That would not help for future versions of reduce the maintenance burden, but it's certainly a good short-term step you could take, hopefully in parallel to my suggestion above.
(For the record, the OCaml Foundation offered funding to fdopen, the author and maintainer of opam-repository-mingw, to keep maintaining the patches and work on upstreaming them in their respective projects, but fdopen's opinion at the time (in addition to a lack of time available to work on this) was that it's less necessary nowadays because more recent packages, in particular those using dune, work fine under Windows, so the repository is getting less and less relevant. That sounds like a reasonable position to me, but I'm not familiar with the Windows situation.)
@gasche I would agree with fdopen that we should keep the number of packages in the mingw repo with special patches small and concentrate of merging Windows-related patches to the upstream repos. I had a (very rough) look at the patch and indeed there seems to quite some stuff in it, where some of it probably is not needed anymore or unrelated to the observed issue. But (at least for me) it is hard to sort that out. In addition, we have to be careful not to break the other target systems, like "pure" Cygwin and "pure" Windows.
Anyway, I will have a closer look at fixing the hygienic/path issue, but I am not sure I can provide something in the near future.
A more general question: What is the roadmap for ocamlbuild
anyway? dune
is getting more and more adoption and has advantage with respect to platform independence. But I also remember some posts on discuss.ocaml.org
of people who want to stick with ocamlbuild
.
Right now ocamlbuild
is in maintenance-mode only, with no new developments planned, and the idea is to encourage people to migrate to dune
. We keep the lights on and write the easy fixes and merge PRs when they look good, but not much more.
So far I still use it in my packages to build my distributions via topkg
. Thanks for keeping the light on !
It looks like an old issue has popped up again in
ocamlbuild
0.14.1
. For some packages on Windows/Cygwin (Mingw toolchain), the hygienic check fails, e.g., formtime
1.3.0
:I am not sure whether the first error message on not finding the build folder is a serious failure. Executing
sanitize.sh
does not help, I guessopam install mtime
regenerates the object files every time.Observed on Windows 10, Cygwin/Mingw (Ocaml for Windows) for OCaml
4.13.1+mingw64
. My current workaround is downgradingocamlbuild
to0.14.0
.