Re: output from $(error) lost with output sync
Oliver Kiddle wrote: Given the following Makefile, the output from the error function is being lost when the gmake 4 output-sync is enabled: [...] With assertions active I even get this error: % make -O make: main.c:3409: die: Assertion `output_context == make_sync' failed. Aborted I tried inserting OUTPUT_UNSET (); in func_error(), case 'e'. This fixes the above problem, but still fails with fatal() called from other functions, e.g.: foo: echo $(wordlist 0, 0, foo) So the problem is more general. ISTM the assumption in die() that output_context is either NULL or make_sync is just not valid, since fatal() can be called from basically anywhere. So I made this change which seems to fix the problem. --- main.c.orig 2014-01-14 05:55:19.0 +0100 +++ make/main.c 2014-01-14 06:14:00.0 +0100 @@ -3406,9 +3406,8 @@ if (output_context) { - assert (output_context == make_sync); + output_close (output_context); OUTPUT_UNSET (); - output_close (make_sync); } output_close (NULL); ___ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make
Re: output from $(error) lost with output sync
I fixed this one locally a couple of days ago; sorry for not pushing. I'll do that shortly. I don't think this change is sufficient because if output_sync != make_sync then make_sync is never dumped with the change below. On Tue, 2014-01-14 at 06:21 +0100, Frank Heckenbach wrote: Oliver Kiddle wrote: Given the following Makefile, the output from the error function is being lost when the gmake 4 output-sync is enabled: [...] With assertions active I even get this error: % make -O make: main.c:3409: die: Assertion `output_context == make_sync' failed. Aborted I tried inserting OUTPUT_UNSET (); in func_error(), case 'e'. This fixes the above problem, but still fails with fatal() called from other functions, e.g.: foo: echo $(wordlist 0, 0, foo) So the problem is more general. ISTM the assumption in die() that output_context is either NULL or make_sync is just not valid, since fatal() can be called from basically anywhere. So I made this change which seems to fix the problem. --- main.c.orig 2014-01-14 05:55:19.0 +0100 +++ make/main.c 2014-01-14 06:14:00.0 +0100 @@ -3406,9 +3406,8 @@ if (output_context) { - assert (output_context == make_sync); + output_close (output_context); OUTPUT_UNSET (); - output_close (make_sync); } output_close (NULL); ___ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make
Re: output from $(error) lost with output sync
Paul Smith wrote: I fixed this one locally a couple of days ago; sorry for not pushing. I'll do that shortly. I don't think this change is sufficient because if output_sync != make_sync then make_sync is never dumped with the change below. I had assumed it wasn't a problem because make_sync is dumped in main.c before recipes are evaluated, but it certainly can't hurt to dump it as well. ___ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make
output from $(error) lost with output sync
Given the following Makefile, the output from the error function is being lost when the gmake 4 output-sync is enabled: foo: $(OBJS) echo $(or $(filter %.o,$^),$(error No input files for library: $@)) % gmake Makefile:2: *** No input files for library: foo. Stop. % gmake -O % With $(info ) and $(warning ), there is no problem. Oliver ___ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make