* lib/am/clean.am: In here, about the need to break too long lists
of files to be cleaned in order to avoid exceeding command line
limits. We already do that successfully!
* t/spy-pattern-rules.sh : Fix heading comments to be more faithful
about what the test really checks. Add more tests checking that, in
case of overlapping pattern rules, the one "more specific", i.e.,
with the shortest target stem, wins.
[ng] automake: new function &almost_verbatim (small refactoring)
* automake.in (almost_verbatim): New function, thin wrapper around
'&preprocess_file'. It requires just the name of the fragment to
preprocess (assuming it is one provided by automake, and thus taking
care to prepend the "$libdir/am/" path and append the ".am" extension
automatically), and then automatically append the processed content
to the '$output_verbatim' global variable.
(handle_all_and_check, handle_install, handle_texinfo): Adjust to use
'&almost_verbatim' instead of '&preprocess_file'.
* automake.in (generate_makefile): In here, about the generated
Makefile baling out if '$(am__seen_error)' has been set by some
previous function call.
* t/longline.sh: Use "$i", not bare "i", to reference the value of
the shell variable 'i' in a $((...)) expression. Issue revealed by
a failure with dash 0.5.2.
* t/dist-many2.sh: We don't fake the command line length for the shell
at "max 2000 chars", but at at "max 4000 chars". Adjust heading comment
accordingly.
[ng] vars: names for internal make variables: 'am.foo' and 'am.foo.bar-baz'
That is the new preferred naming scheme: 'am.foo' where we would
have previously used something like 'am__foo', and 'am.foo.bar-baz'
where we would have previously used something like 'am__foo_bar_baz'
or 'am__foo__bar_baz'.
We should start using the new naming to do so in future commits. But
we should also avid a sweeping rename for now, to minimize conflicts
with the mainline Automake codebases, which (for portability reason)
must still limit itself to the use of the 'am__' prefix.
* HACKING: Adjust. Also, remove now-irrelevant advice about the
problem of an old vendor make (NEWS-OS 4.2R) with variables whose
name start with an underscore.
* ng/dist-many:
[ng] dist: do not exceed command line length limits, even with many files
[ng] coverage: distributing lots of files
[ng] dist: memoize some internal variables
* master: (23 commits)
fixup: delete "# serial" line in m4/amversion.in
news: update about recent ylwrap changes and fixes
m4: get rid of "# serial" lines
configure: ${#param} must be supported by the shell for the testsuite
yacc tests: fix a spurious failure with parallel make
ylwrap: use proper quoting inside a `...` substitution
ylwrap: don't uselessly reset the exit status in case of failure
ylwrap: fix C++ support for Bison
ylwrap: refactor: move loop invariant
ylwrap: refactoring: don't rely on the file order
tests: upgrade and fix Bison test case
tests: fix bison input file
ylwrap: comment changes
ylwrap: modernize idioms
ylwrap: rename header inclusion in generated parsers
ylwrap: simplify the list of renamings
ylwrap: refactor: less duplication
news: mention fixed testsuite weaknesses
news: bump, for future 1.12.3
tests: verify the shell test scripts are syntactically valid
tests: don't use C instead of C++ compiler on case-insensitive platforms
tests: avoid spurious TAP errors on Mac OS X 10.7
tests: fix spurious failure in aclocal7.sh on fast machines
* maint:
fixup: delete "# serial" line in m4/amversion.in
news: update about recent ylwrap changes and fixes
m4: get rid of "# serial" lines
configure: ${#param} must be supported by the shell for the testsuite
yacc tests: fix a spurious failure with parallel make
ylwrap: use proper quoting inside a `...` substitution
ylwrap: don't uselessly reset the exit status in case of failure
ylwrap: fix C++ support for Bison
ylwrap: refactor: move loop invariant
ylwrap: refactoring: don't rely on the file order
tests: upgrade and fix Bison test case
tests: fix bison input file
ylwrap: comment changes
ylwrap: modernize idioms
ylwrap: rename header inclusion in generated parsers
ylwrap: simplify the list of renamings
ylwrap: refactor: less duplication
* yacc-work:
news: update about recent ylwrap changes and fixes
yacc tests: fix a spurious failure with parallel make
ylwrap: use proper quoting inside a `...` substitution
ylwrap: don't uselessly reset the exit status in case of failure
ylwrap: fix C++ support for Bison
ylwrap: refactor: move loop invariant
ylwrap: refactoring: don't rely on the file order
tests: upgrade and fix Bison test case
tests: fix bison input file
ylwrap: comment changes
ylwrap: modernize idioms
ylwrap: rename header inclusion in generated parsers
ylwrap: simplify the list of renamings
ylwrap: refactor: less duplication
The "#serial" lines are only considered by aclocal for the system-wide
third-party '.m4' files, not for the Automake-provided ones. So they
serve no real purpose in the Automake '.m4' files.
In addition, now that we use git and topic branches, and that we are also
writing the Automake-NG fork, the "#serial" lines are becoming more and
more unreliable (e.g., different version of the same file in different
branches can easily end up having the same serial numbers).
So let's just nuke all the "#serial" lines. See also automake bug#11932.
ylwrap: don't uselessly reset the exit status in case of failure
* lib/ylwrap: Here. In case of a failure in the wrapped yacc/lex
invocation, '$ret' (holding the final exit status of ylwrap) was
being uselessly reset to '1' in the later if/else.
The current logic of ylwrap is to call yacc in a sub directory, and
pull out of it all the files that were requested on its command line.
Reverse this approach: export *all* the files created in the
subdirectory, but rename them according to what the command says.
This way, extra files, such as position.hh, location.hh and stack.hh
for C++ parsers, but also parser.xml or parser.dot if XML or Dot
output is enabled, will be preserved.
* lib/ylwrap (pairlist): Remove.
(main loop): Don't loop over pairlist, but over the files in the
temporary directory.
* t/list-of-tests.mk (XFAIL_TESTS): Fixes t/yacc-bison-skeleton-cxx.sh.
* THANKS (James Bostock): Add, he reported bug#7648.
* t/yacc-bison-skeleton-cxx.sh: Request locations, to be
even more stressful.
Use %union to make sure the %{...%} is inserted where appropriate.
Fix some indentation/coding style issues.
Do not provide implementations in the %{...%} section, especially if the
header is included elsewhere, since then the linker will complain about
multiple definitions.
Reported by Stefano Lattarini,
<http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00126.html>.
* t/yacc-bison-skeleton.sh (zardoz.y): Define yylex and yyerror in the
epilogue.
ylwrap: rename header inclusion in generated parsers
Some types of Bison parsers, such as the GLR ones, generate a header
file that they include. ylwrap, which renames the generated files,
does not rename the included file. Fix this shortcoming, reported
for instance here:
<http://lists.gnu.org/archive/html/bug-bison/2012-06/msg00033.html>.
Fixes t/yacc-bison-skeleton.sh, see Automake bug#7648 and PR automake/491.
* lib/ylwrap (quote_for_sed): Accept arguments.
Catch more special characters.
(rename_sed): New.
Improve the previous renaming sed commands using quote_for_sed.
Suggested by Stefano Lattarini here:
<http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00095.html>.
(main loop): Use rename_sed to rename the dependencies to other files.
* t/yacc-d-basic.sh: Exercise this case, even if bison/yacc was
not issuing such an include.
* t/list-of-tests.mk (XFAIL_TESTS): Adjust.
* lib/ylwrap (pairwise): Instead of being a straightforward copy from
the command line arguments, and having to deal with y.tab vs. y_tab
later, let pairwise store the real file names to process, y_tab
conversion included when needed.
(main loop): Use $to instead of $2, for symmetry with $from.
* maint:
news: mention fixed testsuite weaknesses
news: bump, for future 1.12.3
tests: verify the shell test scripts are syntactically valid
tests: don't use C instead of C++ compiler on case-insensitive platforms
tests: avoid spurious TAP errors on Mac OS X 10.7
tests: fix spurious failure in aclocal7.sh on fast machines
tests: verify the shell test scripts are syntactically valid
Fixes automake bug#11898.
This measure of extra safety is mostly motivated by the fact that some
shells (at least some versions of Bash in the 3.x release series, one
of which serves as /bin/sh on Mac OS X 10.7, as well as Bash 4.0 and the
/usr/xpg4/bin/sh shell from Solaris 10) erroneously exit with exit status
0 upon encountering a syntax error, if an exit trap is sett (as it is in
our test scripts).
* Makefile.am (check-tests-syntax): New, check that the shell test
scripts listed in $(TESTS) are syntactically correct.
(.PHONY, check-local): Depend on it.
* t/self-check-exit.tap : Remove checks verifying that a script exits
with non-zero status upon encountering a syntax error; as explained
above, we can't depend on that.
[ng] dist: do not exceed command line length limits, even with many files
* lib/am/distdir.am (am.mkdir-for-dist, am.write-list-of-distfiles): New
internal functions.
(distdir): Using them and the 'am.xargs-map' function, in a way that
should prevent failures due to excessive command line lengths.
With this, the tests 'dist-many.sh' and 'dist-many2.sh' pass on the
systems where we verified they were previously failing.
* t/dist-many.sh: New test, try distributing ~ 30 thousands files.
Currently fails on several systems (e.g., Linux 2.6.30 on i686,
Solaris 10 on i86pc).
* t/dist-many2.sh: New test, check that our distribution rules do not
hit errors due to an exceeded command line length when there are
many files to distribute; it does so by faking a very low command
line length limit for 'mkdir' (max 50 arguments) and the shell (max
4000 characters). Currently failing.
tests: don't use C instead of C++ compiler on case-insensitive platforms
This change fixes automake bug#11893 and bug#10766.
On at least Cygwin and Mac OS X 10.7, the file system where the system
compilers are located can be case-insensitive, so that looking for a
program named 'CC' might actually find the C compiler in /usr/bin/cc.
Now, the Automake configure script looks for a C++ compiler named 'CC'
before looking for more obvious names like c++ or g++ (that is done to
increase testsuite "coverage in the wild", e.g., preferring, on Solaris,
the Sun Studio C++ compiler /usr/bin/CC over the GNU C++ compiler).
Since the checks done in AC_PROG_CXX are apparently not strict enough
to rule out C compilers like those from GCC or Clang (which are smart
enough to recognize if a file has a C++ extension, passing it to the
C++ front end) the testsuite might end up using a C compiler where a
C++ one is expected, with some subtle bad consequences.
* configure.ac: Don't look for a C++ compiler named 'CC' if the
"top-level" file system(s) (where /bin and /usr/bin are) are detected
to be case-insensitive.
Reported-by: Peter Rosin <peda@lysator.liu.se> Reported-by: Max Horn <max@quendi.de> Helped-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* t/suffix8.tap: The libtool bug#11895 was causing the ./configure script
to output a stray "ok" string on a line of its own, confusing the TAP
driver into thinking this was an extra test result (which resulted in the
next, real test results being flagged as "OUT-OF-ORDER"). Fix this by
protecting configure output.
* t/suffix10.tap: Likewise, and for the "make distcheck" output as well.
* THANKS: Update.
* t/aclocal7.sh: Since aclocal rewrites aclocal.m4 unless the input files
are all older than the existing aclocal.m4, so we must sleep to ensure
somedefs.m4 has an older timestamp than the aclocal.m4 the next aclocal
call will generate.
Merge branch 'master' into ng/master (with fix for CVE-2012-3386)
This makes the fix for a locally-exploitable security vulnerability
(CVE-2012-3386) available to the Automake master branch.
* master:
sync: update files from upstream with "make fetch"
news: improve wording in entry about CVE-2012-3386
maint: post-release minor version bump
release: stable release 1.12.2
distcheck: never make part of $(distdir) world-writable
compat: automake should substitute @mkdir_p@, for backward compatibility
fixup: t/README: it's ./runtest, not ./t/ax/runtest
This makes the fix for a locally-exploitable security vulnerability
(CVE-2012-3386) available to the Automake master branch.
* maint:
sync: update files from upstream with "make fetch"
news: improve wording in entry about CVE-2012-3386
maint: post-release minor version bump
release: stable release 1.12.2
distcheck: never make part of $(distdir) world-writable
compat: automake should substitute @mkdir_p@, for backward compatibility
fixup: t/README: it's ./runtest, not ./t/ax/runtest
distcheck: never make part of $(distdir) world-writable
This fixes a locally-exploitable security vulnerability (CVE-2012-3386).
In the 'distcheck' rule, we used to make the just-extracted (from
the distribution tarball) $(distdir) directory and all its files and
subdirectories read-only; then, in order to create the '_inst' and
'_build' subdirectories in there (used by the rest of the recipe) we
made the top-level $(distdir) *world-writable* for an instant (the
time to create those two directories) before making it read-only
again.
Making that directory world-writable (albeit only briefly) introduced a
locally exploitable race condition for those who run "make distcheck" with
a non-restrictive umask (e.g., 022) in a directory that is accessible by
others. A successful exploit would result in arbitrary code execution
with the privileges of the user running "make distcheck" -- game over.
Jim Meyering wrote a proof-of-concept script showing that such exploit is
easily implemented.
This issue is similar to the CVE-2009-4029 vulnerability:
<http://lists.gnu.org/archive/html/automake/2009-12/msg00012.html>
* lib/am/distdir.am (distcheck): Don't make $(distdir) world-writable,
not even for an instant; make it user-writable instead, which is enough.
Helped-By: Jim Meyering <jim@meyering.net> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* ng/clean-many:
[ng] clean: do not exceed command line length limits, even with many files
[ng] $(am__newline): will not be stripped unexpectedly
[ng] coverage: $(am__newline) should never be stripped off
[ng] am.xargs-map: be usable with huge lists
[ng] am.xargs-map: new internal make function
[ng] coverage: cleaning rules with lots of files to clean
[ng] clean: do not exceed command line length limits, even with many files
* lib/am/clean.am (.am.rm-f, .am.rm-rf): New internal functions.
(.am.clean-cmd.f, .am.clean-cmd.d): Rewritten using them and the
'am.xargs-map' function, in a way that should prevent failures
due to excessive command line lengths.
[ng] $(am__newline): will not be stripped unexpectedly
Not even if placed at the end of another macro's expansion.
* lib/am/header-vars.am (am__newline): Improve definition, and
update comments.
* t/internals.sh: Update: some previously xfailing checks are
now passing.
compat: automake should substitute @mkdir_p@, for backward compatibility
That has been unwittingly broken by commit v1.12-19-g7a1eb9f of 2012-04-28,
"AM_PROG_MKDIR_P: deprecate, to be removed in Automake 1.13". We thought it
wasn't a big deal, but Jim Meyering reported that @mkdir_p@ is used in
gettext's Makefile.in.in template:
<http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
* master:
tests: move 'runtest' into the top-level directory
cosmetics: rename t/ax/test-runner => t/ax/runtest
fixup: another "make recheck" failure with BSD make
test runner: work correctly in VPATH setups
compat: automake should define $(mkdir_p), for backward compatibility
coverage: test that AM_PROG_MKDIR_P and $(mkdir_p) still works
tests init: don't automatically re-execute tests with a POSIX shell
yacc tests: fix spurious failure with parallel make
tests: ignore minor 'recheck' regression for BSD make
tests: don't clutter the top-level dir with temporary test directories
tests: avoid spurious failures when @MKDIR_P@ points to "install-sh -d"
lisp: better support of VPATH builds
news: fixlets and updates
* t/built-sources.sh (Makefile.am): In a recipe, use 'printf', not 'echo',
to print a string containing a "\n" sequence, because that is interpreted
like a newline by the echo built-in of NetBSD 5.1 /bin/ksh.
* t/maken.sh: Don't expect the timestamp of the current directory to be
unchanged after "make -n" is run in it; this doesn't hold on NetBSD 5.1.
Instead, make the current directory unwritable before running "make -n",
to ensure attempts to modify the directory fail.
The previous implementation could eat all memory if the given list was
really huge -- but this function will be needed to operate on potentially
huge lists! (i.e., list of tests or files which can exceed the command-line
length limit of the system).
As a drawback, the function cannot recursively invoke itself anymore (not
even indirectly), but this is an acceptable limitation for its intended
uses.
* lib/am/header-vars.am (am.xargs-map): Reimplemented.
(am.max-cmdline-args): Redefine, as its semantics have changed.
(am.max-cmdline-args+1): Remove, no more needed.
It will be useful in future changes, to help us to fend of errors
about "exceeded command line length" in our recipes.
* lib/am/header-vars.am (am.xargs-map): New internal function.
(am.max-cmdline-args, am.max-cmdline-args+1): New internal
auxiliary make variables.
* t/am-xargs-map.sh: New test.
[ng] coverage: cleaning rules with lots of files to clean
* t/clean-many.sh: New test, try cleaning ~ 130 thousands files.
Currently fails on some systems (e.g., NetBSD 5.1).
* t/clean-many2.sh: New test, check that our cleaning rules do not
hit errors due to an exceeded command line length when there are
many files to clean; it does so by faking a very low command line
length limit for 'rm' (max 50 arguments). Currently failing.
tests: move 'runtest' into the top-level directory
Move our wrapper script 'runtest' (meant to allow the execution of
Automake test cases from the command line) from the 't/ax/' directory
to the top-level one. This makes the script easier to find and to
invoke. Much more importantly, our DejaGNU-checking test cases won't
try anymore to use that script instead of the 'runtest' program provided
by DejaGNU (that happened because '$(srcdir)/t/ax/' is automatically
added early to the $PATH variable in our test cases), which was causing
spurious SKIPs.