GNU bug report logs - #36739
[PATCH] maint: fix issues in syntax-check

Previous Next

Package: coreutils;

Reported by: Akim Demaille <akim.demaille <at> gmail.com>

Date: Sat, 20 Jul 2019 07:29:01 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36739 in the body.
You can then email your comments to 36739 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#36739; Package coreutils. (Sat, 20 Jul 2019 07:29:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Akim Demaille <akim.demaille <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 20 Jul 2019 07:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Akim Demaille <akim.demaille <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: [PATCH] maint: fix issues in syntax-check
Date: Sat, 20 Jul 2019 09:27:54 +0200
Hi!

I was trying to reproduce some error in gnulib's syntax-check, and faced a few issues.

My builddirs are in a separate tree, with symlinks from the src tree to them.  So running git from builddir will never work.

There are other errors, that I was not addressed.

error_quotes
env.c:337:                                     " error at: %s"), str);
ls.c:2780:                          _("error canonicalizing %s"), name);
ls.c:3199:                          _("error canonicalizing %s"), full_name);
maint.mk: Use quote() for error string arguments


Cheers!

From dd4e813ab7ee3a8d9d27ca8f5eb874f991fff9b8 Mon Sep 17 00:00:00 2001
From: Akim Demaille <akim.demaille <at> gmail.com>
Date: Sat, 20 Jul 2019 09:04:00 +0200
Subject: [PATCH] maint: fix issues in syntax-check

* cfg.mk (sc_prohibit_colon_redirection): Don't expect `|` to denote
the pipe character in git grep.
(sc_tests_executable)
(sc_case_insensitive_file_names)
(sc_some_programs_must_avoid_exit_failure)
(sc_prohibit_test_background_without_cleanup_)
(sc_prohibit_test_calls_print_ver_with_irrelevant_argument)
(sc_prohibit_test_ulimit_without_require_)
(sc_prohibit_test_background_without_cleanup_)
(sc_THANKS_in_duplicates)
*sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
Don't expect builddir to be a descendant of srcdir.
(sc_strftime_check): Don't check file size against 0 when "N\nq\n" was
already put in the file.
* THANKS.in: Remove me.
---
 THANKS.in |  1 -
 cfg.mk    | 39 ++++++++++++++++++++++-----------------
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/THANKS.in b/THANKS.in
index 02b8ada1c..23b089754 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -25,7 +25,6 @@ Adam Klein                          aklein <at> debian.org
 Adam Sampson                        ats <at> offog.org
 Adrian Bunk                         bunk <at> stusta.de
 AIDA Shinra                         shinra <at> j10n.org
-Akim Demaille                       demaille <at> inf.enst.fr
 Alain Magloire                      alain <at> qnx.com
 Alan Iwi                            iwi <at> atm.ox.ac.uk
 Alan Jenkins                        alan-jenkins <at> tuffmail.co.uk
diff --git a/cfg.mk b/cfg.mk
index b0b758dd5..b589b40e3 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -121,6 +121,7 @@ sc_tests_list_consistency:
 # Ensure that all version-controlled test scripts are executable.
 sc_tests_executable:
 	@set -o noglob 2>/dev/null || set -f;				   \
+	cd $(srcdir);							   \
 	find_ext="-name '' "`printf -- "-o -name *%s " $(TEST_EXTENSIONS)`;\
 	find $(srcdir)/tests/ \( $$find_ext \) \! -perm -u+x -print	   \
 	  | { sed "s|^$(srcdir)/||"; git ls-files $(srcdir)/tests/; }	   \
@@ -138,8 +139,8 @@ sc_ensure_gl_diffs_apply_cleanly:
 
 # Avoid :>file which doesn't propagate errors
 sc_prohibit_colon_redirection:
-	@cd $(srcdir)/tests && GIT_PAGER= git grep -n ': *>.*||' \
-	  && { echo '$(ME): '"The leading colon in :> will hide errors" 1>&2; \
+	@cd $(srcdir)/tests && GIT_PAGER= git grep -En ': *>.*\|\|'	\
+	  && { echo '$(ME): '"The leading colon in :> will hide errors" >&2; \
 	       exit 1; }  \
 	  || :
 
@@ -407,7 +408,7 @@ check-programs-vs-x:
 
 # Ensure we can check out on case insensitive file systems
 sc_case_insensitive_file_names: src/uniq
-	@git ls-files | sort -f | src/uniq -Di | grep . && \
+	@git -C $(srcdir) ls-files | sort -f | src/uniq -Di | grep . && \
 	  { echo "$(ME): the above file(s) conflict on case insensitive" \
 	  " file systems" 1>&2; exit 1; } || :
 
@@ -445,20 +446,22 @@ sc_prohibit_stat_macro_address:
 # Ensure that date's --help output stays in sync with the info
 # documentation for GNU strftime.  The only exception is %N and %q,
 # which date accepts but GNU strftime does not.
+#
+# "info foo" fails with error, but not "info foo >/dev/null".
 extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
 sc_strftime_check:
 	@if test -f $(srcdir)/src/date.c; then				\
-	  grep '^  %.  ' $(srcdir)/src/date.c | sort			\
-	    | $(extract_char) > $@-src;					\
-	  { echo N; echo q;						\
-	    info libc date calendar format 2>/dev/null			\
-	      | grep "^ *['\`]%.'$$"| $(extract_char); }| sort >$@-info;\
-	  if test $$(stat --format %s $@-info) != 2; then		\
+	  if info libc date calendar format 2>/dev/null |		\
+		grep "^ *['\`]%.'$$" >$@-tmp; then			\
+	    { echo N; echo q; $(extract_char) $@-tmp; }| sort		\
+	      >$@-info;							\
+	    grep '^  %.  ' $(srcdir)/src/date.c | sort			\
+	      | $(extract_char) > $@-src;				\
 	    diff -u $@-src $@-info || exit 1;				\
 	  else								\
 	    echo '$(ME): skipping $@: libc info not installed' 1>&2;	\
 	  fi;								\
-	  rm -f $@-src $@-info;						\
+	  rm -f $@-info $@-src $@-tmp;					\
 	fi
 
 # Indent only with spaces.
@@ -608,7 +611,8 @@ sc_prohibit_expr_unsigned:
 # Others, use the EXIT_CANCELED, EXIT_ENOENT, etc. macros defined in system.h.
 # In those programs, ensure that EXIT_FAILURE is not used by mistake.
 sc_some_programs_must_avoid_exit_failure:
-	@grep -nw EXIT_FAILURE						\
+	@cd $(srcdir)							\
+	&& grep -nw EXIT_FAILURE					\
 	    $$(git grep -El '[^T]_FAILURE|EXIT_CANCELED' $(srcdir)/src)	\
 	  | grep -vE '= EXIT_FAILURE|return .* \?' | grep .		\
 	    && { echo '$(ME): do not use EXIT_FAILURE in the above'	\
@@ -616,22 +620,23 @@ sc_some_programs_must_avoid_exit_failure:
 
 # Ensure that tests call the get_min_ulimit_v_ function if using ulimit -v
 sc_prohibit_test_ulimit_without_require_:
-	@(git grep -l get_min_ulimit_v_ $(srcdir)/tests;		\
-	  git grep -l 'ulimit -v' $(srcdir)/tests)			\
+	@(git -C $(srcdir) grep -l get_min_ulimit_v_ tests;		\
+	  git -C $(srcdir) grep -l 'ulimit -v' tests)			\
 	  | sort | uniq -u | grep . && { echo "$(ME): the above test(s)"\
 	  " should match get_min_ulimit_v_ with ulimit -v" 1>&2; exit 1; } || :
 
 # Ensure that tests call the cleanup_ function if using background processes
 sc_prohibit_test_background_without_cleanup_:
-	@(git grep -El '( &$$|&[^&]*=\$$!)' $(srcdir)/tests;		\
-	  git grep -l 'cleanup_()' $(srcdir)/tests | sed p)		\
+	@(git -C $(srcdir) grep -El '( &$$|&[^&]*=\$$!)' tests;		\
+	  git -C $(srcdir) grep -l 'cleanup_()' tests | sed p)		\
 	  | sort | uniq -u | grep . && { echo "$(ME): the above test(s)"\
 	  " should use cleanup_ for background processes" 1>&2; exit 1; } || :
 
 # Ensure that tests call the print_ver_ function for programs which are
 # actually used in that test.
 sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
-	@git grep -w print_ver_ $(srcdir)/tests				\
+	@cd $(srcdir)							\
+	&& git -C  grep -w print_ver_ tests				\
 	  | sed 's#:print_ver_##'					\
 	  | { fail=0;							\
 	      while read file name; do					\
@@ -743,7 +748,7 @@ sc_preprocessor_indentation:
 # someone who was initially listed only in THANKS.in later authors a commit,
 # this rule detects that their pair may now be removed from THANKS.in.
 sc_THANKS_in_duplicates:
-	@{ git log --pretty=format:%aN | sort -u;			\
+	@{ git -C $(srcdir) log --pretty=format:%aN | sort -u;		\
 	    cut -b-36 $(srcdir)/THANKS.in				\
 	      | sed '/^$$/,/^$$/!d;/^$$/d;s/  *$$//'; }			\
 	  | sort | uniq -d | grep .					\
-- 
2.22.0






Information forwarded to bug-coreutils <at> gnu.org:
bug#36739; Package coreutils. (Sun, 04 Aug 2019 07:40:01 GMT) Full text and rfc822 format available.

Message #8 received at 36739 <at> debbugs.gnu.org (full text, mbox):

From: Akim Demaille <akim.demaille <at> gmail.com>
To: 36739 <at> debbugs.gnu.org
Subject: maint: fix issues in syntax-check
Date: Sun, 4 Aug 2019 09:38:55 +0200
Ping?




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sun, 04 Aug 2019 18:12:02 GMT) Full text and rfc822 format available.

Notification sent to Akim Demaille <akim.demaille <at> gmail.com>:
bug acknowledged by developer. (Sun, 04 Aug 2019 18:12:02 GMT) Full text and rfc822 format available.

Message #13 received at 36739-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Akim Demaille <akim.demaille <at> gmail.com>, 36739-done <at> debbugs.gnu.org
Subject: Re: bug#36739: maint: fix issues in syntax-check
Date: Sun, 4 Aug 2019 11:11:41 -0700
Thanks, I installed that.




Information forwarded to bug-coreutils <at> gnu.org:
bug#36739; Package coreutils. (Tue, 06 Aug 2019 20:29:02 GMT) Full text and rfc822 format available.

Message #16 received at 36739 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Akim Demaille <akim.demaille <at> gmail.com>, 36739 <at> debbugs.gnu.org
Subject: Re: bug#36739: [PATCH] maint: fix issues in syntax-check
Date: Tue, 6 Aug 2019 22:28:43 +0200
[Message part 1 (text/plain, inline)]
On 7/20/19 9:27 AM, Akim Demaille wrote:
>  # Ensure that tests call the print_ver_ function for programs which are
>  # actually used in that test.
>  sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
> -	@git grep -w print_ver_ $(srcdir)/tests				\
> +	@cd $(srcdir)							\
> +	&& git -C  grep -w print_ver_ tests				\
>  	  | sed 's#:print_ver_##'					\
>  	  | { fail=0;							\
>  	      while read file name; do					\

'git -C' is lacking the SRCDIR argument.
The attached fixes it.

Have a nice day,
Berny
[0001-maint-fix-error-in-syntax-check-checking.patch (text/x-patch, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#36739; Package coreutils. (Tue, 06 Aug 2019 23:12:02 GMT) Full text and rfc822 format available.

Message #19 received at 36739 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>,
 Akim Demaille <akim.demaille <at> gmail.com>, 36739 <at> debbugs.gnu.org
Subject: Re: bug#36739: [PATCH] maint: fix issues in syntax-check
Date: Tue, 6 Aug 2019 16:11:21 -0700
Thanks, I installed that.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 04 Sep 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.