Lukas Fleischer [Wed, 29 Jan 2020 02:32:20 +0000 (18:32 -0800)]
tests: in python tests, do not require .pyo files (for python3)
This change partially fixes automake bug#32088:
https://debbugs.gnu.org/32088
* t/py-compile-basedir.sh: Remove all .pyo checks.
Also, in this test only, allow for either 4 or 6 files resulting
from compilation, as new-enough Python3 results in 6
(per Andreas Huettel, https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32088#17)
* t/py-compile-basic.sh: Remove all .pyo checks.
* t/py-compile-destdir.sh: Likewise.
* t/py-compile-option-terminate.sh: Likewise.
* t/python-virtualenv.sh: Likewise.
* t/python10.sh: Likewise.
* t/python12.sh: Likewise.
* t/python3.sh: Likewise.
Karl Berry [Mon, 27 Jan 2020 02:06:04 +0000 (18:06 -0800)]
doc: clarify build tree location
* doc/automake.texi (VPATH Builds): more words about the build
tree location. Suggestion from Jefferson Carpenter, 31 May 2018:
<https://lists.gnu.org/archive/html/automake-patches/2018-05/msg00003.html>
Karl Berry [Mon, 20 Jan 2020 02:24:28 +0000 (18:24 -0800)]
lint: make syntax-check same as maintainer-check.
* maintainer/syntax-checks.mk (syntax-check): new target,
same as maintainer-check. For consistency with many other
GNU packages.
(.PHONY): add here too.
Karl Berry [Sun, 19 Jan 2020 02:06:23 +0000 (18:06 -0800)]
tests: use find+rm, not perl, to remove temporary directories.
This change fixes automake bug#39078:
https://debbugs.gnu.org/39078
* t/ax/test-lib.sh (rm_rf_): run chmod -R u+rwx and rm -rf,
instead of calling our t/ax/deltree.pl script. This reverses the
change of 2013-05-16. It made sense to write and use deltree
at that point, but unfortunately as of perl-5.28.0
(File::Path.pm version 2.15), rmtree no longer removes a tree with
unreadable subdirectories, such as we (intentionally) have. So we
might as well go back to rm -rf. The unconditional recursive chmod
instead of the previously-used more complex find command will
hopefully prove portable. See the bug report for more details.
Our deltree.pl is not used for anything else, but nevertheless
leaving it in our source tree for now, for ease of reversion
and comparison.
Karl Berry [Thu, 9 Jan 2020 02:21:26 +0000 (18:21 -0800)]
tests: use skip_ consistently.
* t/lisp-loadpath.sh: use skip_ instead of exit 77;
also, notice and reset if the EMACS envvar is simply "t".
* t/uninstall-fail.sh: use skip_ instead of the undefined skip.
Karl Berry [Sun, 5 Jan 2020 01:06:40 +0000 (17:06 -0800)]
automake: Support byte compilation in older Emacsen
* lib/am/lisp.am (am__emacs_byte_compile_setup) [FIRST]: define
new make variable, to use byte-compile-dest-file-function if
available, else byte-compile-dest-file.
(.el.elc): use it.
* t/lisp-loadpath.sh: skip test if emacs version is <= 23,
since their -L ordering is backwards.
* NEWS: update.
Jim Meyering [Mon, 23 Dec 2019 20:13:26 +0000 (12:13 -0800)]
maint: make maintainer-check tests pass
* maintainer/syntax-checks.mk (sc_sanity_gnu_grep): Remove
NUL byte from grep output, to avoid shell diagnostic about
"NUL byte suppressed from expansion."
(automake_diff_no, aclocal_diff_no): Adjust number of expected
diff lines.
Karl Berry [Tue, 17 Dec 2019 02:45:22 +0000 (19:45 -0700)]
automake: Ensure space after $(LISP) in tags dependencies.
This change fixes automake bug#38139.
* bin/automake.in (handle_tags): Concatenate with space in " @config".
* t/tags-lisp-space.sh: New test.
* t/list-of-tests.mk (handwritten_TESTS): Add it.
Add support for using the zstd compression algorithm.
Use a default compression setting of -19, and ".zst" as the suffix.
* bin/automake.in (handle_dist): Add zstd to the list of known dist-
suffixes.
(preprocess_file): Map ZSTD to dist-zstd.
* doc/automake.texi: Document the new option.
* lib/Automake/Options.pm (_is_valid_easy_option): Add dist-zstd.
* lib/am/distdir.am (dist-zstd): New rule.
(?ZSTD?DIST_TARGETS): Add definition.
(distcheck): Add a case for *.tar.zst*.
* t/dist-formats.tap: Add tests.
* NEWS: Mention the change.
Paul Eggert [Mon, 11 Nov 2019 20:07:08 +0000 (12:07 -0800)]
config: add msys support
Requested by Arnold Robbins in:
https://lists.gnu.org/r/bug-gnulib/2019-11/msg00008.html
* lib/ar-lib, lib/compile (func_file_conv):
Treat msys like cygwin.
Gavin Smith [Mon, 26 Aug 2019 04:07:58 +0000 (21:07 -0700)]
automake: do not require @setfilename in Texinfo files
Texinfo no longer requires a @setfilename directive in each
.texi file, so automake now also relaxes its restriction.
* bin/automake.in (scan_texinfo_file): Derive name of info file from
name of input file if no @setfilename line occurs in the file.
* t/txinfo-no-setfilename.sh: New test.
* t/list-of-tests.mk: Add it.
* NEWS: Mention it.
Paul Eggert [Mon, 26 Aug 2019 01:51:26 +0000 (18:51 -0700)]
install-sh: support -s with read-only source
Problem reported by Karl Berry in:
https://lists.gnu.org/r/bug-gnulib/2019-08/msg00067.html
* lib/install-sh: If -s is given, create the temporary file
with $cp_umask so that ‘strip’ can write to it.
Mathieu Lirzin [Sun, 25 Mar 2018 05:29:48 +0000 (07:29 +0200)]
test-driver.scm: Add "--coverage" option
* contrib/test-driver.scm: When 'coverage' option is enabled, run tests
in the debug vm and trace coverage data.
(%options): Add 'coverage'.
(show-help): Display option.
Mathieu Lirzin [Sat, 24 Mar 2018 22:42:16 +0000 (23:42 +0100)]
test-driver.scm: Don't guess script name from "--test-name"
'primitive-load' is used instead of 'load-from-path' since the script is
given as a relative file name. For unknown reason, using 'load' fails
with GNU Mcron test suite when running 'make distcheck'.
* contrib/test-driver.scm: Get the actual script name directly from the
command line. Handle the case where that argument is missing.
Mathieu Lirzin [Tue, 20 Feb 2018 22:18:09 +0000 (23:18 +0100)]
bin: Rely only on the shebang line
Previously ‘automake’ and ‘aclocal’ were handling the case of being
interpreted as a Shell script by using a hack leveraging the fact that
Shell and Perl has a compatible syntax intersection allowing those
scripts to launch ‘perl’ from the shell.
Mathieu Lirzin [Sun, 11 Mar 2018 22:24:55 +0000 (23:24 +0100)]
maint: Post-release administrivia
* NEWS: Add header line for next release.
* configure.ac (AC_INIT): Bump version number to 1.16a.
* m4/amversion.m4: Likewise (auto-updated by "make bootstrap").
Mathieu Lirzin [Sun, 11 Mar 2018 21:24:54 +0000 (22:24 +0100)]
version 1.16.1
* configure.ac (AC_INIT): Bump version number to 1.16.1.
* m4/amversion.m4: Likewise (auto-updated by "make bootstrap").
* NEWS: Record release version.
Pavel Raiskup [Sun, 11 Mar 2018 20:47:54 +0000 (21:47 +0100)]
install-sh: avoid (low risk) race in "/tmp"
Ensure that nobody can cross privilege boundaries by pre-creating
symlink on '$tmpdir' destination directory.
Just testing 'mkdir -p' by creating "/tmp/ins$RANDOM-$$/d" is not safe
because "/tmp" directory is usually world-writeable and
"/tmp/ins$RANDOM-$$" content could be pretty easily guessed by
attacker (at least for shells where $RANDOM is not supported). So, as
the first step, create the "/tmp/ins$RANDOM-$$" without -p. This step
would fail early if somebody wanted catch us.
Systems that implement (and have enabled) fs.protected_symlinks kernel
feature are not affected even without this commit.
Mathieu Lirzin [Sat, 3 Mar 2018 22:50:10 +0000 (23:50 +0100)]
automake: Don't rely on List::Util to provide 'none'
This change fixes automake bug#30631.
This removes the use of List::Util which is not supported by Perl 5.6,
by reimplementing the 'none' subroutine.
* lib/Automake/General.pm (none): New subroutine.
* bin/automake.in (handle_single_transform): Use it.
* t/pm/General.pl: New test.
* t/list-of-tests.mk (perl_TESTS): Add it.
* NEWS: Update.
Mathieu Lirzin [Sat, 3 Mar 2018 11:01:13 +0000 (12:01 +0100)]
python: Support future python version up to 3.9
This change fixes automake bug#28160.
Since AM_PYTHON_PATH macro takes no maximum version argument, there is
no need to generate _AM_PYTHON_INTERPRETER_LIST dynamically, like what
was previously done by the reverted commit 1d60fb72168e62d33fe433380af621de64e22f23. We could rely on M4 to
generate this list statically however this is likely to be a complex
solution that would not improve maintainability.
Paul Eggert [Wed, 7 Mar 2018 04:13:32 +0000 (20:13 -0800)]
maint: write-file-hooks -> before-save-hook
write-file-hooks is obsolete since Emacs 22.1 (released June 2007) and
it's time to use the recommended replacement.
Problem reported by Glenn Morris in:
https://lists.gnu.org/r/bug-gnulib/2018-03/msg00008.html
* contrib/tap-driver.pl, lib/compile, lib/depcomp, lib/install-sh:
* lib/mdate-sh, lib/missing, lib/mkinstalldirs, lib/py-compile:
* lib/tap-driver.sh, lib/test-driver, lib/ylwrap:
Update hook usage for files where Automake is the canonical source.
Mathieu Lirzin [Sun, 25 Feb 2018 21:28:21 +0000 (22:28 +0100)]
maint: Post-release administrivia
* NEWS: Add header line for next release.
* configure.ac (AC_INIT): Bump version number to 1.16a.
* m4/amversion.m4: Likewise (auto-updated by "make bootstrap").
Mathieu Lirzin [Sun, 25 Feb 2018 19:47:15 +0000 (20:47 +0100)]
version 1.16
* configure.ac (AC_INIT, APIVERSION): Bump version number to 1.16.
* m4/amversion.m4: Likewise (auto-updated by "make bootstrap").
* NEWS: Record release version.
Mathieu Lirzin [Sat, 3 Feb 2018 23:09:31 +0000 (00:09 +0100)]
python: Avoid exceeding command-line length limit
With Python implementations following PEP-3174, a large number of files
are installed in the ‘__pycache__’ directory. As a consequence
“t/instmany-python.sh” test was failing due to the
‘uninstall-pythonPYTHON’ target deleting installed files in a single
‘rm’ command. Doing that in multiple steps avoids exceeding the
command-line length limit. This fixes bug#30335.
* lib/am/python.am (uninstall-%DIR%PYTHON): For byte-compiled files
installed in '__pycache__' directory, uninstall them by batch of 40.
[?FIRST?] (am__pep3147_tweak): Adapt.
Mathieu Lirzin [Thu, 18 Jan 2018 10:19:13 +0000 (11:19 +0100)]
tests: Don't check 'Getopt::Long' corner cases
Depending on the installed 'Getopt::Long' perl module, command-line
handling may vary a bit. As a consequence we prefer not to check
command-line corners cases. This change fixes automake bug#29638.
* t/aclocal.sh (am_create_testdir): Don't expect "--versi" to be
interpreted as "--version".
* t/automake-cmdline.tap: Don't expect "--vers" to be interpreted as
"--version" and things after "--" to be interpreted as file arguments.
(do_check): Display the actual command output.
* t/maken3.sh (check_targets): "--force" is not a documented option, so
don't use it.
Mathieu Lirzin [Thu, 1 Feb 2018 12:51:03 +0000 (13:51 +0100)]
python: Generate python interpreter list
_AM_PYTHON_INTERPRETER_LIST is used by AM_PYTHON_PATH to autodetect
Python programs whose names correspond to a specific Python
version (e.g. python3.6). Previously this list was updated manually.
The automatic support of newer versions (up to 4.0 excluded) fixes
bug#28160.
* m4/python.m4 (am_py_min_ver, am_py_max_ver): New macros.
(_AM_PYTHON_INTERPRETER_LIST): Generate this list instead of hard-coding
it. Implementation is taken from GNU Pyconfigure.
Mathieu Lirzin [Thu, 18 Jan 2018 23:41:31 +0000 (00:41 +0100)]
tests: Distribute DEJATOOL files manually
"t/check12.sh" was failing because files declared in DEJATOOL are not
automatically distributed. The test running 'make distcheck' couldn't succeed
since some scripts were not distributed. This fixes automake bug#26738.
* t/check12.sh (Makefile.am): Distribute files from DEJATOOL.
Mathieu Lirzin [Thu, 18 Jan 2018 22:51:49 +0000 (23:51 +0100)]
tests: Fix various 'flex' compilation issues
* t/lex-clean-cxx.sh (parsefoo.lxx): Declare 'yylex':
(mainfoo.cc): Make declaration compatible with C++.
* t/lex-depend-cxx.sh (joe.ll): Declare 'yylex'.
* t/silent-many-languages.sh (Makefile.am, sub/Makefile.am): Link -lfl only
with 'fo2' and 'sub/ba2' which are the only program needing it.
(foo5.l): Define 'isatty'.
(foo6.y): Declare 'yylex'.
Jim Meyering [Thu, 23 Nov 2017 05:07:29 +0000 (21:07 -0800)]
port elisp-compilation support to emacs-23.1 and newer
In May of 2017, emacs.master support for using the long-deprecated
byte-compile-dest-file function was removed, and that removal broke
automake's elisp-compiling rule for any .el file not in the current
directory. In emacs-23.1 (July 2009) byte-compile-dest-file-function
became the recommended way to adjust the byte-compiler's destination.
The removed functionality has been restored for Emacs-26, albeit with
dissuasive diagnostics warning about the imminent removal of this
functionality. It will be removed in Emacs-27.
* lib/am/lisp.am (.el.elc): Use byte-compile-dest-file-function, rather
than byte-compile-dest-file. Also, use "-f batch-byte-compile '$<'"
rather than open-coding it, as suggested by Glenn Morris.
* t/lisp-readonly-srcdir.sh: New file, to test for the above.
* t/list-of-tests.mk (handwritten_TESTS): Add it.
* NEWS (Bugs fixed): Mention this problem.
Jim Meyering [Thu, 20 Mar 2014 19:31:32 +0000 (12:31 -0700)]
"make dist" did not depend on $(BUILT_SOURCES)
* lib/am/distdir.am (distdir-am): New intermediate target.
Interpose this target between $(distdir) and its dependency
on $(DISTFILES), so that we can ensure $(BUILT_SOURCES) are
all created before we begin creating $(DISTFILES).
* t/dist-vs-built-sources.sh: Test for this.
* t/list-of-tests.mk (handwritten_TESTS): Add it.
* NEWS (Bugs fixed): Mention it.
Assaf Gordon reported that "make dist" (after ./configure
from a pristine clone of GNU hello) would fail due to the
absence of configmake.h while compiling lib/localcharset.c.
https://lists.gnu.org/r/bug-hello/2014-03/msg00016.html
Paul Eggert [Sat, 23 Sep 2017 18:03:34 +0000 (11:03 -0700)]
install-sh: do not assume / = //
* lib/install-sh: Do not append / to destination
directory if it already ends in /. This supports
a destination directory of // on hosts where / and //
are distinct directories, as POSIX allows.
Paul Eggert [Sat, 16 Sep 2017 20:03:36 +0000 (13:03 -0700)]
Prefer https: URLs
In Gnulib, Emacs, etc. we are changing ftp: and http: URLs to use
https:, to discourage man-in-the-middle attacks when downloading
software. The attached patch propagates these changes upstream to
Automake. This patch does not affect files that Automake is
downstream of, which I'll patch separately.
Althouth the resources are not secret, plain HTTP is vulnerable to
malicious routers that tamper with responses from GNU servers,
and this sort of thing is all too common when people in some other
countries browse US-based websites. See, for example:
Aceto G, Botta A, Pescapé A, Awan MF, Ahmad T, Qaisar
S. Analyzing internet censorship in Pakistan. RTSI
2016. https://dx.doi.org/10.1109/RTSI.2016.7740626
HTTPS is not a complete solution here, but it can be a significant
help. The GNU project regularly serves up code to users, so we should
take some care here.
Paul Eggert [Sat, 16 Sep 2017 20:03:36 +0000 (13:03 -0700)]
Prefer https: URLs
In Gnulib, Emacs, etc. we are changing ftp: and http: URLs to use
https:, to discourage man-in-the-middle attacks when downloading
software. The attached patch propagates these changes upstream to
Automake. This patch does not affect files that Automake is
downstream of, which I'll patch separately.
Althouth the resources are not secret, plain HTTP is vulnerable to
malicious routers that tamper with responses from GNU servers,
and this sort of thing is all too common when people in some other
countries browse US-based websites. See, for example:
Aceto G, Botta A, Pescapé A, Awan MF, Ahmad T, Qaisar
S. Analyzing internet censorship in Pakistan. RTSI
2016. https://dx.doi.org/10.1109/RTSI.2016.7740626
HTTPS is not a complete solution here, but it can be a significant
help. The GNU project regularly serves up code to users, so we should
take some care here.
'mdate-sh' pretty-prints the modification time of a file. But it's
output can vary depending on the timezone of the caller. Someone in
timezone GMT-12 will get a different result (day) than someone in
timezone GMT+12. As this output is also used to create/update stamp
files, which influence the further build process, the build result can
vary.
* lib/mdate-sh: Set 'TZ' to UTC which ensures reproducible output.
* NEWS: Announce bug fix.
Prototypes allows us to avoid using the '&foo' invocation form when
invoking a subroutine before its definition. Previously those
prototypes were generated to prevent them from falling out-of-sync
with actual definitions. Now we provide a 'check-perl-protos' lint
script to ensure that this is not the case. This has the same
benefits as generating prototypes while simplifying the
bootstrap/build process.
* bin/gen-perl-protos: Remove.
* bin/Makefile.inc: Adapt.
* bootstrap: Likewise.
* bin/aclocal.in: Inline prototypes.
* bin/automake.in: Likewise.
* maintainer/check-perl-protos: New lint script.
* maintainer/syntax-checks.mk (sc_perl_protos): New target.
(syntax_check_rules): Add it.
Mathieu Lirzin [Sun, 27 Aug 2017 15:41:50 +0000 (17:41 +0200)]
build: Add 'pre-inst-env' wrapper script
This script allows someone building Automake from source to easily run
'automake' and 'aclocal' without having to install it or knowing the
existence of "wrapped" scripts in "bin" directory.
* pre-inst-env.in: New script.
* configure.ac: Generate 'pre-inst-env' at configure time.
* Makefile.am (nodist_noinst_SCRIPTS, CLEANFILES): Add it.
automake: Ensure that LIBOBJ_DIR builddir is created
* t/libobj-no-dependency-tracking.sh: New test reproducing the issue
described in automake bug#27781.
* t/list-of-tests.mk (handwritten_TESTS, XFAIL_TESTS): Add it.
check: Make 'check-TESTS' target depend on test dependencies
The 'check' and 'recheck' targets are already depending on the progams
and scripts required to run the test suite. The 'check-TESTS' target
while not in the public API might be used by uninformed users, so it
makes sense to add the same dependency to it. This fixes bug#27186.
Thomas Martitz [Mon, 13 Mar 2017 11:41:59 +0000 (12:41 +0100)]
automake: Shorter object file names under subdir-objects
Combining the 'subdir-objects' option with target-specific flags had
the consequence of producing long object file names. This was done to
preventively ensure the uniqueness of object file names. We are now
using shorter names by default, and handle long names when an actual
conflict is detected. This will hopefully reduce the necessity of
using the 'prog_SHORTNAME' facility.