From: Paul Smith Date: Sun, 22 Sep 2019 21:02:57 +0000 (-0400) Subject: * job.c (child_error): Modify error message string. X-Git-Tag: 4.2.92~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7fbd58cd6bcac3a911833ee5d653ed659ce6b231;p=thirdparty%2Fmake.git * job.c (child_error): Modify error message string. This reverts commit 6264deece3bb77798240a906ceed79097adbcf48. 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. --- diff --git a/src/job.c b/src/job.c index 78dc7e15..0052b0cd 100644 --- a/src/job.c +++ b/src/job.c @@ -557,11 +557,8 @@ child_error (struct child *child, nm = _(""); else { - /* We can't use the standard : 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; } diff --git a/tests/scripts/features/errors b/tests/scripts/features/errors index 06b496a3..f236d517 100644 --- a/tests/scripts/features/errors +++ b/tests/scripts/features/errors @@ -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'); } diff --git a/tests/scripts/features/include b/tests/scripts/features/include index 3df5af0b..0c63c067 100644 --- a/tests/scripts/features/include +++ b/tests/scripts/features/include @@ -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'); diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync index 49d3be2c..35102043 100644 --- a/tests/scripts/features/output-sync +++ b/tests/scripts/features/output-sync @@ -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. diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism index 07fb7580..defa21b3 100644 --- a/tests/scripts/features/parallelism +++ b/tests/scripts/features/parallelism @@ -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); diff --git a/tests/scripts/features/patternrules b/tests/scripts/features/patternrules index 177bb32c..c2a8c985 100644 --- a/tests/scripts/features/patternrules +++ b/tests/scripts/features/patternrules @@ -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"); diff --git a/tests/scripts/features/targetvars b/tests/scripts/features/targetvars index ee9bc0f0..2929b2cc 100644 --- a/tests/scripts/features/targetvars +++ b/tests/scripts/features/targetvars @@ -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'); diff --git a/tests/scripts/features/vpathplus b/tests/scripts/features/vpathplus index 8e723fed..b4857171 100644 --- a/tests/scripts/features/vpathplus +++ b/tests/scripts/features/vpathplus @@ -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)); diff --git a/tests/scripts/misc/general3 b/tests/scripts/misc/general3 index f8cded0d..455027aa 100644 --- a/tests/scripts/misc/general3 +++ b/tests/scripts/misc/general3 @@ -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 diff --git a/tests/scripts/misc/general4 b/tests/scripts/misc/general4 index 007dd93a..eeb8d106 100644 --- a/tests/scripts/misc/general4 +++ b/tests/scripts/misc/general4 @@ -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); diff --git a/tests/scripts/options/dash-k b/tests/scripts/options/dash-k index 24743274..cd78e7f0 100644 --- a/tests/scripts/options/dash-k +++ b/tests/scripts/options/dash-k @@ -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)); diff --git a/tests/scripts/targets/DELETE_ON_ERROR b/tests/scripts/targets/DELETE_ON_ERROR index 6d60287e..f0d9f9b4 100644 --- a/tests/scripts/targets/DELETE_ON_ERROR +++ b/tests/scripts/targets/DELETE_ON_ERROR @@ -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; diff --git a/tests/scripts/targets/POSIX b/tests/scripts/targets/POSIX index b547e491..c44cc500 100644 --- a/tests/scripts/targets/POSIX +++ b/tests/scripts/targets/POSIX @@ -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'; diff --git a/tests/scripts/variables/SHELL b/tests/scripts/variables/SHELL index 4d677efd..4ff1ac25 100644 --- a/tests/scripts/variables/SHELL +++ b/tests/scripts/variables/SHELL @@ -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;