On Sat, Aug 26, 2023 at 02:25:19PM -0600, Theo de Raadt wrote:
> I did not point you in this direction, not at all.

Oh you did. It was not intentional. But I was focused on make variables
instead of trying to catch the error, and you redirected me towards
execv proper.

> I said make execve failure report an accurate error.  Rather than
> requiring a special hook which will report the problem.  Meaning
> if the problem areas were known, they could be coped with.  What
> I'm seeing here appears to be a thing like system(), which will
> punt the problem further along, to a shell, which will also probably
> report the error poorly -- I suspect the more layers you pile on
> top of ARG_MAX and/or E2BIG, the worse this will become.

execve's failure DOES report an accurate error. We show the error
message "Argument list too long" after the exec fails.

and the engine itself is rather specific about the exact job that failed.
(showing the target name and the location in the Makefile)

For now, the locations where the problem occurs in Makefiles is because
there are constructed shell commands which become too long.

Invariably, the commands themselves loop over the long argument list,
or use a builtin like echo.

Now, the actual problem is languages like go and friends which have
gigantic lists of distfiles.  But making that go away cannot happen at
our end.

The current work we've done on reducing stuff a bit means we can probably
last a few years before it overflows ARG_MAX, by which point we might
have bumped ARG_MAX again.

Reply via email to