bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: Zack Weinberg <zackw@panix.com>
Cc: Autoconf <autoconf@gnu.org>, Gnulib bugs <bug-gnulib@gnu.org>
Subject: Re: debugging autoconf tests (was: gl_CACHE_VAL_SILENT)
Date: Sat, 14 Mar 2020 03:49:21 +0100	[thread overview]
Message-ID: <2587919.stUTjd5DOk@omega> (raw)
In-Reply-To: <CAKCAbMjJUSuhv6LdiUZ+HFk=1s3CYKY891OyGKYmVFK4=8AJ3g@mail.gmail.com>

Hi Zack,

> Yeah, most of the time
> that text is just going to scroll by unread, but when something goes
> wrong, the poor schmuck who has to debug it wants to know that it was
> the test for `ceil` (for instance) that hung the build, not the
> unrelated thing that happens to have been tested right before that.

Hanging autoconf tests are rare. And even in that case, looking at
the configure output does not help much, because it won't tell you
whether the compiler is taking hours or whether the test program hangs.
In practice, when something hangs, "ps aux" or "pstree -p" (when available)
is a better starting point for debugging.

In the much more frequent case that an autoconf test produces an unexpected
result, the most efficient debugging technique is:
  1. look at the S[...] and D[...] lines in config.status. This will tell
     you whether the problem is on the configure.ac + *.m4 side or on the
     Makefile.{am,in} side.
  2. If it is on the configure.ac + *.m4 side, rerun the configuration with
     option '-C'. Then look at the config.cache. This will tell you whether
     the problem is inside or outside AC_CACHE_VAL/AC_CACHE_CHECK calls.
  3. If it is inside AC_CACHE_VAL/AC_CACHE_CHECK calls, then look at the
     config.log. This will show you the test programs, the compiler options
     with which they are compiled, and the test programs' exit code.

In this case as well, the configure output is hardly useful.

The only real uses of the configure output, for me who is maintaining hundreds
of autoconf macros in gnulib, are:
  - Compare the configuration results between different platforms (e.g.
    linux-mipseb and linux-mipsel).
  - Look for spurious error messages such as
      test: =: unary operator expected
    that indicate broken shell code.

The other use of this output is, of course, to let the non-expert user
keep patient.

Due to all this, executing a test silently is not as problematic as
you think.

Bruno



  reply	other threads:[~2020-03-14  2:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13 20:57 gl_CACHE_VAL_SILENT won't work correctly with upcoming autoconf 2.70 Zack Weinberg
2020-03-13 21:54 ` Bruno Haible
2020-03-13 22:04   ` Nick Bowler
2020-03-13 23:30     ` Paul Eggert
2020-03-14  0:27       ` Bruno Haible
2020-03-14  1:27       ` Nick Bowler
2020-03-14  1:11   ` Zack Weinberg
2020-03-14  2:49     ` Bruno Haible [this message]
2020-03-14 14:06       ` debugging autoconf tests (was: gl_CACHE_VAL_SILENT) Zack Weinberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2587919.stUTjd5DOk@omega \
    --to=bruno@clisp.org \
    --cc=autoconf@gnu.org \
    --cc=bug-gnulib@gnu.org \
    --cc=zackw@panix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).