* job.c (child_error): Modify error message string.

This reverts commit 6264deece3.
Further investigation discovers that the real issue is that
GNU Emacs compile mode doesn't have a matching regex for GNU
make error messages generated when targets fail.  I submitted
a patch to GNU Emacs adding a matcher for compile mode.
This commit is contained in:
Paul Smith 2019-09-22 17:02:57 -04:00
parent 3ede0b96ac
commit 7fbd58cd6b
14 changed files with 30 additions and 33 deletions

View File

@ -557,11 +557,8 @@ child_error (struct child *child,
nm = _("<builtin>"); nm = _("<builtin>");
else else
{ {
/* We can't use the standard <FILE>:<LINENO> syntax here because
Emacs misinterprets it and matches a bogus filename in the compile
buffer. */
char *a = alloca (strlen (flocp->filenm) + 6 + INTSTR_LENGTH + 1); char *a = alloca (strlen (flocp->filenm) + 6 + INTSTR_LENGTH + 1);
sprintf (a, "%s;%lu", flocp->filenm, flocp->lineno + flocp->offset); sprintf (a, "%s:%lu", flocp->filenm, flocp->lineno + flocp->offset);
nm = a; nm = a;
} }

View File

@ -10,13 +10,13 @@ two:
\texit 1 \texit 1
\texit 0 \texit 0
!, !,
"one", "exit 1\n#MAKE#: [#MAKEFILE#;3: one] Error 1 (ignored)\nexit 0\n"); "one", "exit 1\n#MAKE#: [#MAKEFILE#:3: one] Error 1 (ignored)\nexit 0\n");
# TEST #1 # TEST #1
# ------- # -------
run_make_test(undef, " -i two", run_make_test(undef, " -i two",
"exit 1\n#MAKE#: [#MAKEFILE#;6: two] Error 1 (ignored)\nexit 0\n"); "exit 1\n#MAKE#: [#MAKEFILE#:6: two] Error 1 (ignored)\nexit 0\n");
# TEST #2 # TEST #2
# ------- # -------
@ -29,7 +29,7 @@ all:
\t\@echo there \t\@echo there
\t\@exit 1 \t\@exit 1
!, !,
'', "hi\nthere\n#MAKE#: *** [#MAKEFILE#;5: all] Error 1", 512); '', "hi\nthere\n#MAKE#: *** [#MAKEFILE#:5: all] Error 1", 512);
# TEST #3 # TEST #3
# ------- # -------
@ -43,7 +43,7 @@ my $err = $ERR_no_such_file;
run_make_test(qq! run_make_test(qq!
one: ; -$unk xx yy one: ; -$unk xx yy
!, !,
'one', "$unk xx yy\n#MAKE#: $unk: $err\n#MAKE#: [#MAKEFILE#;2: one] Error 127 (ignored)\n"); 'one', "$unk xx yy\n#MAKE#: $unk: $err\n#MAKE#: [#MAKEFILE#:2: one] Error 127 (ignored)\n");
# TEST #4 # TEST #4
# ------- # -------
@ -51,13 +51,13 @@ one: ; -$unk xx yy
run_make_test(qq! run_make_test(qq!
two: ; $unk aa bb two: ; $unk aa bb
!, 'two -i', !, 'two -i',
"$unk aa bb\n#MAKE#: $unk: $err\n#MAKE#: [#MAKEFILE#;2: two] Error 127 (ignored)\n"); "$unk aa bb\n#MAKE#: $unk: $err\n#MAKE#: [#MAKEFILE#:2: two] Error 127 (ignored)\n");
# TEST #5 # TEST #5
# ------- # -------
run_make_test(undef, 'two', run_make_test(undef, 'two',
"$unk aa bb\n#MAKE#: $unk: $err\n#MAKE#: *** [#MAKEFILE#;2: two] Error 127\n", 512); "$unk aa bb\n#MAKE#: $unk: $err\n#MAKE#: *** [#MAKEFILE#:2: two] Error 127\n", 512);
# SV #56918 : Test the unknown command as the second recipe line # SV #56918 : Test the unknown command as the second recipe line
@ -66,7 +66,7 @@ three:
\t\@echo one \t\@echo one
\t$unk qq rr \t$unk qq rr
!, 'three', !, 'three',
"one\n$unk qq rr\n#MAKE#: $unk: $err\n#MAKE#: *** [#MAKEFILE#;4: three] Error 127\n", 512); "one\n$unk qq rr\n#MAKE#: $unk: $err\n#MAKE#: *** [#MAKEFILE#:4: three] Error 127\n", 512);
# Try failing due to non-executable file # Try failing due to non-executable file
@ -78,7 +78,7 @@ if ($ERR_nonexe_file) {
one: ; -$noexe xx yy one: ; -$noexe xx yy
two: ; $noexe aa bb two: ; $noexe aa bb
!, !,
'one', "$noexe xx yy\n#MAKE#: $noexe: $ERR_nonexe_file\n#MAKE#: [#MAKEFILE#;2: one] Error 127 (ignored)\n"); 'one', "$noexe xx yy\n#MAKE#: $noexe: $ERR_nonexe_file\n#MAKE#: [#MAKEFILE#:2: one] Error 127 (ignored)\n");
unlink($noexe); unlink($noexe);
} }
@ -92,12 +92,12 @@ if ($ERR_exe_dir) {
PATH := . PATH := .
all: ; sd all: ; sd
!, !,
'', "sd\n#MAKE#: sd: $ERR_exe_dir\n#MAKE#: *** [#MAKEFILE#;3: all] Error 127", 512); '', "sd\n#MAKE#: sd: $ERR_exe_dir\n#MAKE#: *** [#MAKEFILE#:3: all] Error 127", 512);
run_make_test(q! run_make_test(q!
all: ; ./sd all: ; ./sd
!, !,
'', "./sd\n#MAKE#: ./sd: $ERR_exe_dir\n#MAKE#: *** [#MAKEFILE#;2: all] Error 127", 512); '', "./sd\n#MAKE#: ./sd: $ERR_exe_dir\n#MAKE#: *** [#MAKEFILE#:2: all] Error 127", 512);
rmdir('sd'); rmdir('sd');
} }

View File

@ -221,7 +221,7 @@ include inc1
inc1: foo; echo > $@ inc1: foo; echo > $@
foo:; exit 1 foo:; exit 1
!, !,
'', "exit 1\n#MAKEFILE#:3: inc1: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#;5: foo] Error 1\n", 512); '', "exit 1\n#MAKEFILE#:3: inc1: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#:5: foo] Error 1\n", 512);
rmfiles('inc1'); rmfiles('inc1');

View File

@ -206,9 +206,9 @@ bar: end
#MAKE#[1]: Entering directory '#PWD#/foo' #MAKE#[1]: Entering directory '#PWD#/foo'
foo-fail: start foo-fail: start
foo-fail: end foo-fail: end
#MAKE#[1]: *** [Makefile;23: foo-fail] Error 1 #MAKE#[1]: *** [Makefile:23: foo-fail] Error 1
#MAKE#[1]: Leaving directory '#PWD#/foo' #MAKE#[1]: Leaving directory '#PWD#/foo'
#MAKE#: *** [#MAKEFILE#;4: make-foo-fail] Error 2\n", #MAKE#: *** [#MAKEFILE#:4: make-foo-fail] Error 2\n",
512); 512);
# Test the per-job synchronization. # Test the per-job synchronization.
@ -326,7 +326,7 @@ run_make_test(qq!
all: t1 all: t1
t1: ; -\@\$(MAKE) -f $m1 t1: ; -\@\$(MAKE) -f $m1
!, !,
"-j -Oline", "#MAKE#[1]: Entering directory '#PWD#'\nd1 stderr\nd1 stdout\n$m1:3: *** d1 failed. Stop.\n#MAKE#[1]: Leaving directory '#PWD#'\n#MAKE#: [#MAKEFILE#;3: t1] Error 2 (ignored)\n"); "-j -Oline", "#MAKE#[1]: Entering directory '#PWD#'\nd1 stderr\nd1 stdout\n$m1:3: *** d1 failed. Stop.\n#MAKE#[1]: Leaving directory '#PWD#'\n#MAKE#: [#MAKEFILE#:3: t1] Error 2 (ignored)\n");
rmfiles($m1); rmfiles($m1);
@ -343,7 +343,7 @@ if ($port_type ne 'W32') {
run_make_test(q! run_make_test(q!
all:: ; @./foo bar baz all:: ; @./foo bar baz
!, !,
'-O', "#MAKE#: ./foo: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#;2: all] Error 127\n", 512); '-O', "#MAKE#: ./foo: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#:2: all] Error 127\n", 512);
} }
# This tells the test driver that the perl test script executed properly. # This tells the test driver that the perl test script executed properly.

View File

@ -114,12 +114,12 @@ ok:
> \@$sleep_command 4 > \@$sleep_command 4
> \@echo Ok done", > \@echo Ok done",
'-rR -j5', "Fail '-rR -j5', "Fail
#MAKE#: *** [#MAKEFILE#;10: fail.1] Error 1 #MAKE#: *** [#MAKEFILE#:10: fail.1] Error 1
#MAKE#: *** Waiting for unfinished jobs.... #MAKE#: *** Waiting for unfinished jobs....
Fail Fail
#MAKE#: *** [#MAKEFILE#;10: fail.2] Error 1 #MAKE#: *** [#MAKEFILE#:10: fail.2] Error 1
Fail Fail
#MAKE#: *** [#MAKEFILE#;10: fail.3] Error 1 #MAKE#: *** [#MAKEFILE#:10: fail.3] Error 1
Ok done", Ok done",
512); 512);

View File

@ -110,7 +110,7 @@ $(dir)/foo.bar:
', ',
"dir=$dir", "dir=$dir",
"#MAKE#: *** [#MAKEFILE#;6: $dir/foo.bar] Error 1", "#MAKE#: *** [#MAKEFILE#:6: $dir/foo.bar] Error 1",
512); 512);
unlink("$dir/foo.bar"); unlink("$dir/foo.bar");

View File

@ -276,7 +276,7 @@ run_make_test(qq!
all: PATH := .. all: PATH := ..
all: ; $sname all: ; $sname
!, !,
'', "$sname\n#MAKE#: $sname: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#;3: all] Error 127", 512); '', "$sname\n#MAKE#: $sname: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#:3: all] Error 127", 512);
unlink("sd/$sname"); unlink("sd/$sname");
rmdir ('sd'); rmdir ('sd');

View File

@ -83,7 +83,7 @@ cat ${VP}foo.c bar.c > foo.b 2>/dev/null || exit 1
$answer = "not creating notarget.c from notarget.d $answer = "not creating notarget.c from notarget.d
cat notarget.c > notarget.b 2>/dev/null || exit 1 cat notarget.c > notarget.b 2>/dev/null || exit 1
$make_name: *** [$makefile;13: notarget.b] Error 1 $make_name: *** [$makefile:13: notarget.b] Error 1
"; ";
&compare_output($answer,&get_logfile(1)); &compare_output($answer,&get_logfile(1));

View File

@ -313,7 +313,7 @@ foo bar
hi hi
foo bar'); foo bar');
run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#;1: x] Error 1 (ignored)\n"); run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#:1: x] Error 1 (ignored)\n");
# Slow path with odd setups # Slow path with odd setups

View File

@ -100,7 +100,7 @@ run_make_test(qq!
PATH := .. PATH := ..
all: ; $sname all: ; $sname
!, !,
'', "$sname\n#MAKE#: $sname: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#;3: all] Error 127", 512); '', "$sname\n#MAKE#: $sname: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#:3: all] Error 127", 512);
unlink("sd/$sname"); unlink("sd/$sname");
rmdir('sd'); rmdir('sd');
@ -114,7 +114,7 @@ run_make_test(qq!
PATH := .. PATH := ..
all: ; $sname all: ; $sname
!, !,
'', "$sname\n#MAKE#: $sname: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#;3: all] Error 127", 512); '', "$sname\n#MAKE#: $sname: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#:3: all] Error 127", 512);
unlink($sname); unlink($sname);

View File

@ -92,7 +92,7 @@ close(MAKEFILE);
&run_make_with_options($makefile2, "-k", &get_logfile, $error_code); &run_make_with_options($makefile2, "-k", &get_logfile, $error_code);
$answer = "exit 1 $answer = "exit 1
$make_name: *** [$makefile2;9: foo.o] Error 1 $make_name: *** [$makefile2:9: foo.o] Error 1
$make_name: Target 'all' not remade because of errors.\n"; $make_name: Target 'all' not remade because of errors.\n";
&compare_output($answer, &get_logfile(1)); &compare_output($answer, &get_logfile(1));

View File

@ -8,7 +8,7 @@ run_make_test('
.DELETE_ON_ERROR: .DELETE_ON_ERROR:
all: ; exit 1 > $@ all: ; exit 1 > $@
', ',
'', "exit 1 > all\n#MAKE#: *** [#MAKEFILE#;3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512); '', "exit 1 > all\n#MAKE#: *** [#MAKEFILE#:3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
run_make_test(' run_make_test('
.DELETE_ON_ERROR: .DELETE_ON_ERROR:
@ -16,7 +16,7 @@ all: foo.x ;
%.x : %.q ; echo > $@ %.x : %.q ; echo > $@
%.q : ; exit 1 > $@ %.q : ; exit 1 > $@
', ',
'', "exit 1 > foo.q\n#MAKE#: *** [#MAKEFILE#;5: foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512); '', "exit 1 > foo.q\n#MAKE#: *** [#MAKEFILE#:5: foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512);
# This tells the test driver that the perl test script executed properly. # This tells the test driver that the perl test script executed properly.
1; 1;

View File

@ -17,7 +17,7 @@ run_make_test(qq!
.POSIX: .POSIX:
all: ; \@$script all: ; \@$script
!, !,
'', "#MAKE#: *** [#MAKEFILE#;3: all] Error $err\n", 512); '', "#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
# User settings must override .POSIX # User settings must override .POSIX
$flags = '-xc'; $flags = '-xc';

View File

@ -107,6 +107,6 @@ run_make_test(qq!
.SHELLFLAGS = $flags .SHELLFLAGS = $flags
all: ; \@$script all: ; \@$script
!, !,
'', "$out#MAKE#: *** [#MAKEFILE#;3: all] Error $err\n", 512); '', "$out#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
1; 1;