If ocamlfind prints a warning during build then ocamlbuild fails like this: /usr/local/bin/ocamlfind ocamlc -where > /usr/ports/devel/ocaml-pcre/work/pcre-ocaml-7.0.4/_build/ocamlc.where Command got signal -8. If I run the ocamlfind command manually it works, but it prints a warning too: ocamlfind: [WARNING] Cannot read directory /usr/ports/devel/ocaml-pcre/work/stage/usr/local/lib/ocaml/site-lib/pcre which is mentioned in ld.conf That warnings causes a SIGPIPE in ocamlbuild or somewhere, which causes the signal -8 message to be printed: You can use 'truss -f make' to confirm: 75895: write(2,"ocamlfind: [WARNING] Cannot read"...,146) ERR#32 'Broken pipe' 75895: SIGNAL 13 (SIGPIPE) 75895: process exit, rval = 0 75889: wait4(75895,{ SIGNALED,sig=SIGPIPE },0x0,0x0) = 75895 (0x12877) 75889: write(1,"\r\^[[K",4) = 4 (0x4) + ocamlfind ocamlc -where > /usr/ports/textproc/ocaml-text/work/ocaml-text-0.6/_build/ocamlc.where 75889: write(1,"+ ocamlfind ocamlc -where > /usr"...,103) = 103 (0x67) 75889: close(4) = 0 (0x0) 75889: write(3,"+ ocamlfind ocamlc -where > /usr"...,150) = 150 (0x96) 75889: close(3) = 0 (0x0) 75889: gettimeofday({1399897227.200087 },0x0) = 0 (0x0) Command got signal -8. This is not related to a particular OCaml package, I got this on ocaml-pcre or ocaml-text, but others have encountered this issue elsewhere: https://bugzilla.skylable.com/show_bug.cgi?id=470#c3 https://github.com/the-lambda-church/merlin/issues/193 https://github.com/the-lambda-church/merlin/issues/183 I don't know if this is related to GCC or Clang (my system seems to use Clang), but this appears to be a FreeBSD-specific problem with ocamlbuild (on Linux I've never seen this error). Fix: Run 'ocamlfind ocamlc -where' manually Edit /usr/local/lib/ocaml/ld.conf and remove the lines it complained about How-To-Repeat: Install the ocaml compiler (from source, see other PR as binary package seems to be missing): # cd /usr/ports/lang/ocaml # make install # cd /usr/ports/textproc/ocaml-text # make install [...] Oh this wants to build PCRE, but there's a binary package, ... interrupt the build! [..] ^C Install pcre binary package # pkg install pcre OK lets resume # make install [....] + /usr/local/bin/ocamlfind ocamlc -where > /usr/ports/devel/ocaml-pcre/work/pcre-ocaml-7.0.4/_build/ocamlc.where Command got signal -8. Expected behaviour: ocamlbuild should print the error message from ocamlfind's stderr, instead of dieing on SIGPIPE!
Note: ocamlbuild is part of lang/ocaml in ports.
Maintainer of lang/ocaml, Please note that PR ports/189710 has just been submitted. If it contains a patch for an upgrade, an enhancement or a bug fix you agree on, reply to this email stating that you approve the patch and a committer will take care of it. The full text of the PR can be found at: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/189710 -- Edwin Groothuis via the GNATS Auto Assign Tool edwin@FreeBSD.org
State Changed From-To: open->feedback Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Reassigning to maintainer. This got lost in the transition to bugzilla.
Michael, any idea?
There is a seemingly-related bug-report[1] upstream. It seems that there is a patch for this. I will investigate the issue to reproduce it and see if the patch helps. http://caml.inria.fr/mantis/view.php?id=5371
unrelated, but in 2 weeks the following ports are going to be removed: devel/ocaml-camomile devel/ocaml-equeue devel/ocaml-event devel/ocaml-sdl devel/ocamlweb databases/ocaml-pgocaml lang/metaocaml lang/ocaml-camlidl lang/ocaml-mode You may want to stage and adopt some? I don't know. Just letting you know.
John, thank you for pointing this out, I will take a look at this as well!
Created attachment 146031 [details] Patch for lang/ocaml I applied upstream patch for the issue number 0005371 (upstream issue) and could build and reinstall and OCaml, and was able to build and install textproc/ocaml-text with the corrected ocamlbuild. The patch has git a/b headers, so it might require stripping before applying it in /usr/ports. Suggested commit message: lang/ocaml: Improve jobcontrol in ocamlbuild Apply patch for upstream issue 0005371. It improves jobcontrol in ocamlbuild and fixes some faulty sigpipe affecting ports built with ocamlbuild. PR: 189710 Submitted by: maintainer (Michael Gruenewald) Patch by: glondu
the a/ b/ thing is unfortunate. I have to manually remove those for it to work with svn patch. For regular patch it's no problem, -p 1 fixes it.
A commit references this bug: Author: marino Date: Tue Aug 19 13:55:12 UTC 2014 New revision: 365380 URL: http://svnweb.freebsd.org/changeset/ports/365380 Log: lang/ocaml: Improve jobcontrol in ocamlbuild Apply patch for upstream issue 0005371. It improves job control in ocamlbuild and fixes some faulty sigpipe affecting ports build with ocamlbuild. PR: 189710 Submitted by: edwin (skylable.com) patch by: glondu Approved by: maintainer (Michael Gruenewald) Changes: head/lang/ocaml/Makefile head/lang/ocaml/files/patch-ocamlbuild
Thanks, Michael.
Great! For the a/ b/ thing I am currently using git for my work on ports because I know it quite well and gave up subversion for about 4 or 5 years. So, I am asking, if you would recommend to use subversion for working on ports? Would it be kind of easier to generate patches and stay up-to-date?
(In reply to Michael Grünewald from comment #13) > Great! > > For the a/ b/ thing I am currently using git for my work on ports because > I know it quite well and gave up subversion for about 4 or 5 years. So, I am > asking, if you would recommend to use subversion for working on ports? Would > it be kind of easier to generate patches and stay up-to-date? I think it would be a little easier but not mandatory. Obviously I was able to cope. If you submit diffs without that a/ b/ diff Index stuff (and there must be an option for that) then it wouldn't make a difference at all.