]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* job.c (child_error): Modify error message string.
authorPaul Smith <psmith@gnu.org>
Sun, 22 Sep 2019 21:02:57 +0000 (17:02 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 22 Sep 2019 21:02:57 +0000 (17:02 -0400)
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.

14 files changed:
src/job.c
tests/scripts/features/errors
tests/scripts/features/include
tests/scripts/features/output-sync
tests/scripts/features/parallelism
tests/scripts/features/patternrules
tests/scripts/features/targetvars
tests/scripts/features/vpathplus
tests/scripts/misc/general3
tests/scripts/misc/general4
tests/scripts/options/dash-k
tests/scripts/targets/DELETE_ON_ERROR
tests/scripts/targets/POSIX
tests/scripts/variables/SHELL

index 78dc7e15f4cda98026ba34ce34ff412e4e8d06b4..0052b0cd1da17a72b991ed88114fc74874c53aa9 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -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;
     }
 
index 06b496a37d6a4d520a77f5b11fdc57845886a172..f236d5172490c3d405287b6b6583c93f12244bba 100644 (file)
@@ -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');
 }
index 3df5af0b42613387e04dee8afc7bee24f76864b5..0c63c067bc656c12db2d99a77776a20929488487 100644 (file)
@@ -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');
 
index 49d3be2c54f06b6686700a4f4a5e4f16c2e4a678..351020436a72d3d5ecc74958f2dc104323821fc1 100644 (file)
@@ -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.
index 07fb7580799c3fd76d4a1758c4af9f6676121c7b..defa21b39a86db91143773d1f94bb1a3a1cfa6cf 100644 (file)
@@ -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);
 
index 177bb32c1a9d026b80b27f2032adacff5fc35b23..c2a8c98533149a1185b395e3d004f9648e11f5ae 100644 (file)
@@ -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");
index ee9bc0f0986ce42c34f696b8da6a0f93d2abebe0..2929b2cc523d2b4800f5ce0be2bc430cca4c6a23 100644 (file)
@@ -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');
index 8e723fed2905be00b633cec362a2a1d624b311ee..b48571716cf818ee5d3dc6b9e815b135629413a2 100644 (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
 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));
index f8cded0d307eb4b2f1c79aeb27da4266888430e1..455027aa0dcb32131c41ea31de24cc752896e009 100644 (file)
@@ -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
 
index 007dd93a796394d837d8ed3247f440b3946caa42..eeb8d106754122f0996f09f48d426d2429cbea60 100644 (file)
@@ -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);
 
index 247432749e2836f9c4acd5eb0d8fde183cccc5a7..cd78e7f00ae8238113797fa5a439532f8ffd5463 100644 (file)
@@ -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));
index 6d60287ea6466ceb4c382749a0756e5f99bdd4a2..f0d9f9b4d63fa61fe288c8c6e63205a81963ffa3 100644 (file)
@@ -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;
index b547e4911a4a8b6b2f3d713332bf14ed4a213a98..c44cc500111e76896a4343084fa70fbb2aa38a2d 100644 (file)
@@ -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';
index 4d677efdca1158bda788cbc80ad87f86ae4f4cfd..4ff1ac256f4ebfaaf310e82e258a3265b40af9a2 100644 (file)
@@ -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;