[RFC] More informative errors when Ccomp.command exits with status 127#1727
[RFC] More informative errors when Ccomp.command exits with status 127#1727trefis merged 1 commit intoocaml:trunkfrom
Conversation
|
This looks like a good change, although it's a bit annoying that it can't be more specific with the error message. Unfortunately, this isn't fixable without reimplementing I suppose the best option would be to reimplement |
|
Thanks for looking at this @stedolan ! Unless someone has another opinion on the matter I will merge this in a few days. |
|
I'm curious: in the end, what error message is shown to the user? At any rate, I'm in favor of merging this, since it cannot be worse than the error message currently displayed... |
|
In my case, something like this: (where "..." is, obviously, fairly long) You can test it out with |
|
To confirm, the strace output when this happened was: |
|
That's a scary error message... but better than nothing. Please go ahead with the merge. |
|
Any opinion on whether this should be backported to 4.07? |
|
Meh. If there was clearly no risk of regression for anyone's workflow, I would say "why not", but the fact that I'm not knowledgeable enough about the horrible things that people do with return codes is giving me pause. |
|
Ack. |
I spent a non-zero amount of time recently trying to understand the following output (reproduced in full) from ocamlopt (which exited with -1):
As it turns out, the command line used by ocamlopt to invoke the linker was bigger than
ARG_MAX.In such cases,
Sys.commandwon't print anything to stderr or stdout, and return127on Linux (windows apparently returns-1).I think it would be a nice to print something when that happens (even though we can't be sure whether our call silently failed, or the command itself exited with
127; I don't think we should be worrying too much about the added noise however).I initially wanted
Ccomp.commandto print something along the lines of:which seems like a nice hint.
But I noticed that
caml_sys_system_commandraisesSys_errorwhen-1is returned and figured that I could do that too in this case as well and that it would probably be enough.For the record: the invocation of ocamlopt was hidden by a build system, so
Sys_errorwith the faulty cmdline would most likely have made the issue obvious.Any opinion?