When using gnulib-tool --create-testdir, the option --single-configure is
most useful, because
- it cuts down the time to 'configure' the testdir,
- it makes the testdir closer to
'gnulib-tool --tests-base=... --with-tests --import ...'
invocations.
With this patch, '--single-configure' becomes active by default.
2025-06-16 Bruno Haible <[email protected]>
gnulib-tool: Default to --single-configure. New option --two-configures.
* gnulib-tool.sh: single_configure now defaults to false. New option
--two-configures. Stop documenting option --single-configure.
* pygnulib/GLInfo.py (GLInfo.usage): Document option --two-configures.
Stop documenting option --single-configure.
* pygnulib/GLTestDir.py (GLTestDir.execute): Update comment.
* pygnulib/main.py (main): single_configure now defaults to false.
New option --two-configures.
* doc/transversal.texi: Update.
* HACKING: Update.
diff --git a/HACKING b/HACKING
index f31ed70cc3..e8bbc49c1a 100644
--- a/HACKING
+++ b/HACKING
@@ -117,7 +117,7 @@ Maintaining high quality
========================
It is a good idea to occasionally create a testdir of all of Gnulib:
- $ rm -rf ../testdir-all; ./gnulib-tool --create-testdir --dir=../testdir-all
--with-c++-tests --without-privileged-tests --single-configure `./all-modules`
+ $ rm -rf ../testdir-all; ./gnulib-tool --create-testdir --dir=../testdir-all
--with-c++-tests --without-privileged-tests `./all-modules`
and test this directory on various platforms:
- Linux/glibc systems,
- Linux/musl systems,
diff --git a/doc/transversal.texi b/doc/transversal.texi
index 6c814a9a8f..9140753540 100644
--- a/doc/transversal.texi
+++ b/doc/transversal.texi
@@ -29,7 +29,8 @@
single @code{configure} file. This is because the question ``is module
B present?'' does not have a unique answer in such situations.
@code{gnulib-tool} has support for these techniques in the situation of
-@code{--create-testdir --single-configure}, which basically has two
+@code{--create-testdir} (without option @code{--two-configures}),
+which basically has two
@code{gnulib-tool} invocations, one for a set of modules that end up in
@code{gllib}, and one for the set of modules that end up in
@code{gltests}. But you should be aware that this does not cover the
diff --git a/gnulib-tool.sh b/gnulib-tool.sh
index 040bfb4eb0..e0a8cbba82 100755
--- a/gnulib-tool.sh
+++ b/gnulib-tool.sh
@@ -323,8 +323,8 @@ Options for --import, --add/remove-import:
Options for --create-[mega]testdir, --[mega]test:
- --single-configure Generate a single configure file, not a separate
- configure file for the tests directory.
+ --two-configures Generate a separate configure file for the tests
+ directory, not a single configure file.
Options for --import, --add/remove-import, --update,
--create-[mega]testdir, --[mega]test:
@@ -1145,7 +1145,7 @@ func_determine_path_separator
# otherwise
# - excl_unportable_tests true if --without-unportable-tests was given, blank
# otherwise
-# - single_configure true if --single-configure was given, false otherwise
+# - single_configure false if --two-configures was given, true otherwise
# - avoidlist list of modules to avoid, from --avoid
# - cond_dependencies true if --conditional-dependencies was given, false if
# --no-conditional-dependencies was given, blank otherwise
@@ -1195,7 +1195,7 @@ func_determine_path_separator
excl_longrunning_tests=
excl_privileged_tests=
excl_unportable_tests=
- single_configure=false
+ single_configure=
avoidlist=
cond_dependencies=
lgpl=
@@ -1239,7 +1239,7 @@ func_determine_path_separator
--create-megatestdir | --create-megatestdi | --create-megatestd |
--create-megatest | --create-megates | --create-megate | --create-megat |
--create-mega | --create-meg | --create-me | --create-m )
mode=create-megatestdir
shift ;;
- --test | --tes | --te | --t )
+ --test | --tes | --te )
mode=test
shift ;;
--megatest | --megates | --megate | --megat | --mega | --meg | --me |
--m )
@@ -1392,6 +1392,9 @@ func_determine_path_separator
--without-unportable-tests | --without-unportable-test |
--without-unportable-tes | --without-unportable-te | --without-unportable-t |
--without-unportable- | --without-unportable | --without-unportabl |
--without-unportab | --without-unporta | --without-unport | --without-unpor |
--without-unpo | --without-unp | --without-un | --without-u)
excl_unportable_tests=true
shift ;;
+ --two-configures | --two-configure | --two-configur | --two-configu |
--two-config | --two-confi | --two-conf | --two-con | --two-co | --two-c |
--two- | --two | --tw)
+ single_configure=false
+ shift ;;
--single-configure | --single-configur | --single-configu |
--single-config | --single-confi | --single-conf | --single-con | --single-co |
--single-c | --single- | --single | --singl | --sing | --sin | --si)
single_configure=true
shift ;;
@@ -1553,7 +1556,7 @@ func_determine_path_separator
if case "$mode" in import | add-import | remove-import) true;; *) false;;
esac; then
if test -n "$excl_cxx_tests" || test -n "$excl_longrunning_tests" \
|| test -n "$excl_privileged_tests" || test -n "$excl_unportable_tests"
\
- || test "$single_configure" != false; then
+ || test -n "$single_configure"; then
echo "gnulib-tool: invalid options for '$mode' mode" 1>&2
echo "Try 'gnulib-tool --help' for more information." 1>&2
func_exit 1
@@ -1616,6 +1619,10 @@ func_determine_path_separator
esac
# Now the only possible values of "$inctests" are true and false
# (or blank but then it is irrelevant).
+ # Canonicalize the single_configure variable.
+ if test -z "$single_configure"; then
+ single_configure=true
+ fi
# Determine the minimum supported autoconf version from the project's
# configure.ac.
@@ -6571,8 +6578,8 @@ func_create_testdir ()
# Canonicalize the list of specified modules.
specified_modules=`for m in $specified_modules; do echo $m; done | LC_ALL=C
sort -u`
- # Test modules which invoke AC_CONFIG_FILES cannot be used with
- # --with-tests --single-configure. Avoid them.
+ # Test modules which invoke AC_CONFIG_FILES cannot be used with --with-tests
+ # (without --two-configures). Avoid them.
if $inctests && $single_configure; then
avoidlist="$avoidlist havelib-tests"
fi
diff --git a/pygnulib/GLInfo.py b/pygnulib/GLInfo.py
index e99613ea98..76c6f23aa6 100644
--- a/pygnulib/GLInfo.py
+++ b/pygnulib/GLInfo.py
@@ -302,8 +302,8 @@ def usage(self) -> str:
Options for --create-[mega]testdir, --[mega]test:
- --single-configure Generate a single configure file, not a separate
- configure file for the tests directory.
+ --two-configures Generate a separate configure file for the tests
+ directory, not a single configure file.
Options for --import, --add/remove-import, --update,
--create-[mega]testdir, --[mega]test:
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index 50b54aae07..3410d0bfb7 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -169,8 +169,8 @@ def execute(self) -> None:
modules.add(module)
specified_modules = sorted(modules)
- # Test modules which invoke AC_CONFIG_FILES cannot be used with
- # --with-tests --single-configure. Avoid them.
+ # Test modules which invoke AC_CONFIG_FILES cannot be used with
--with-tests
+ # (without --two-configures). Avoid them.
inctests = self.config.checkInclTestCategory(TESTS['tests'])
if inctests and self.config.checkSingleConfigure():
self.config.addAvoid('havelib-tests')
diff --git a/pygnulib/main.py b/pygnulib/main.py
index 77eed3d4ff..e0f088c907 100644
--- a/pygnulib/main.py
+++ b/pygnulib/main.py
@@ -482,7 +482,11 @@ def main(temp_directory: str) -> None:
dest='vc_files',
default=None,
action='store_false')
- # single-configure
+ # two-configures, single-configure
+ parser.add_argument('--two-configures',
+ dest='single_configure',
+ default=None,
+ action='store_false')
parser.add_argument('--single-configure',
dest='single_configure',
default=None,
@@ -703,7 +707,7 @@ def main(temp_directory: str) -> None:
if ((mode in ['import', 'add-import', 'remove-import']
and (cmdargs.excl_cxx_tests or cmdargs.excl_longrunning_tests
or cmdargs.excl_privileged_tests or cmdargs.excl_unportable_tests
- or cmdargs.single_configure))
+ or cmdargs.single_configure != None))
or (mode == 'update'
and (cmdargs.localpath != None or cmdargs.libname != None
or cmdargs.sourcebase != None or cmdargs.m4base != None
@@ -853,6 +857,9 @@ def main(temp_directory: str) -> None:
copymode = cmdargs.copymode
lcopymode = cmdargs.lcopymode
single_configure = cmdargs.single_configure
+ # Canonicalize the single_configure variable.
+ if single_configure == None:
+ single_configure = True
# Create pygnulib configuration.
config = GLConfig(