mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-01-27 01:27:58 +00:00
* 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:
parent
3ede0b96ac
commit
7fbd58cd6b
14 changed files with 30 additions and 33 deletions
|
@ -557,11 +557,8 @@ child_error (struct child *child,
|
|||
nm = _("<builtin>");
|
||||
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);
|
||||
sprintf (a, "%s;%lu", flocp->filenm, flocp->lineno + flocp->offset);
|
||||
sprintf (a, "%s:%lu", flocp->filenm, flocp->lineno + flocp->offset);
|
||||
nm = a;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ two:
|
|||
\texit 1
|
||||
\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
|
||||
# -------
|
||||
|
||||
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
|
||||
# -------
|
||||
|
@ -29,7 +29,7 @@ all:
|
|||
\t\@echo there
|
||||
\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
|
||||
# -------
|
||||
|
@ -43,7 +43,7 @@ my $err = $ERR_no_such_file;
|
|||
run_make_test(qq!
|
||||
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
|
||||
# -------
|
||||
|
@ -51,13 +51,13 @@ one: ; -$unk xx yy
|
|||
run_make_test(qq!
|
||||
two: ; $unk aa bb
|
||||
!, '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
|
||||
# -------
|
||||
|
||||
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
|
||||
|
||||
|
@ -66,7 +66,7 @@ three:
|
|||
\t\@echo one
|
||||
\t$unk qq rr
|
||||
!, '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
|
||||
|
||||
|
@ -78,7 +78,7 @@ if ($ERR_nonexe_file) {
|
|||
one: ; -$noexe xx yy
|
||||
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);
|
||||
}
|
||||
|
@ -92,12 +92,12 @@ if ($ERR_exe_dir) {
|
|||
PATH := .
|
||||
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!
|
||||
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');
|
||||
}
|
||||
|
|
|
@ -221,7 +221,7 @@ include inc1
|
|||
inc1: foo; echo > $@
|
||||
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');
|
||||
|
||||
|
|
|
@ -206,9 +206,9 @@ bar: end
|
|||
#MAKE#[1]: Entering directory '#PWD#/foo'
|
||||
foo-fail: start
|
||||
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#: *** [#MAKEFILE#;4: make-foo-fail] Error 2\n",
|
||||
#MAKE#: *** [#MAKEFILE#:4: make-foo-fail] Error 2\n",
|
||||
512);
|
||||
|
||||
# Test the per-job synchronization.
|
||||
|
@ -326,7 +326,7 @@ run_make_test(qq!
|
|||
all: t1
|
||||
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);
|
||||
|
||||
|
@ -343,7 +343,7 @@ if ($port_type ne 'W32') {
|
|||
run_make_test(q!
|
||||
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.
|
||||
|
|
|
@ -114,12 +114,12 @@ ok:
|
|||
> \@$sleep_command 4
|
||||
> \@echo Ok done",
|
||||
'-rR -j5', "Fail
|
||||
#MAKE#: *** [#MAKEFILE#;10: fail.1] Error 1
|
||||
#MAKE#: *** [#MAKEFILE#:10: fail.1] Error 1
|
||||
#MAKE#: *** Waiting for unfinished jobs....
|
||||
Fail
|
||||
#MAKE#: *** [#MAKEFILE#;10: fail.2] Error 1
|
||||
#MAKE#: *** [#MAKEFILE#:10: fail.2] Error 1
|
||||
Fail
|
||||
#MAKE#: *** [#MAKEFILE#;10: fail.3] Error 1
|
||||
#MAKE#: *** [#MAKEFILE#:10: fail.3] Error 1
|
||||
Ok done",
|
||||
512);
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ $(dir)/foo.bar:
|
|||
|
||||
',
|
||||
"dir=$dir",
|
||||
"#MAKE#: *** [#MAKEFILE#;6: $dir/foo.bar] Error 1",
|
||||
"#MAKE#: *** [#MAKEFILE#:6: $dir/foo.bar] Error 1",
|
||||
512);
|
||||
|
||||
unlink("$dir/foo.bar");
|
||||
|
|
|
@ -276,7 +276,7 @@ run_make_test(qq!
|
|||
all: PATH := ..
|
||||
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");
|
||||
rmdir ('sd');
|
||||
|
|
|
@ -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
|
||||
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));
|
||||
|
|
|
@ -313,7 +313,7 @@ foo bar
|
|||
hi
|
||||
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
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ run_make_test(qq!
|
|||
PATH := ..
|
||||
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");
|
||||
rmdir('sd');
|
||||
|
@ -114,7 +114,7 @@ run_make_test(qq!
|
|||
PATH := ..
|
||||
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);
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ close(MAKEFILE);
|
|||
&run_make_with_options($makefile2, "-k", &get_logfile, $error_code);
|
||||
|
||||
$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";
|
||||
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
|
|
@ -8,7 +8,7 @@ run_make_test('
|
|||
.DELETE_ON_ERROR:
|
||||
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('
|
||||
.DELETE_ON_ERROR:
|
||||
|
@ -16,7 +16,7 @@ all: foo.x ;
|
|||
%.x : %.q ; echo > $@
|
||||
%.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.
|
||||
1;
|
||||
|
|
|
@ -17,7 +17,7 @@ run_make_test(qq!
|
|||
.POSIX:
|
||||
all: ; \@$script
|
||||
!,
|
||||
'', "#MAKE#: *** [#MAKEFILE#;3: all] Error $err\n", 512);
|
||||
'', "#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
|
||||
|
||||
# User settings must override .POSIX
|
||||
$flags = '-xc';
|
||||
|
|
|
@ -107,6 +107,6 @@ run_make_test(qq!
|
|||
.SHELLFLAGS = $flags
|
||||
all: ; \@$script
|
||||
!,
|
||||
'', "$out#MAKE#: *** [#MAKEFILE#;3: all] Error $err\n", 512);
|
||||
'', "$out#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
|
||||
|
||||
1;
|
||||
|
|
Loading…
Reference in a new issue