bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Bruno Haible <bruno@clisp.org>
Cc: Gnulib bugs <bug-gnulib@gnu.org>, Reuben Thomas <rrt@sc3d.org>
Subject: Re: Interference between two installations of gnulib
Date: Sun, 13 Jun 2021 10:41:46 -0700	[thread overview]
Message-ID: <111e3305-4023-415b-3631-653b87a09e2c@cs.ucla.edu> (raw)
In-Reply-To: <43737965.862IWm2pC9@omega>

[-- Attachment #1: Type: text/plain, Size: 2160 bytes --]

On 4/11/21 12:32 PM, Bruno Haible wrote:

> Having two separate configure scripts is undesirable, because that would
> increase the total configure time of the package (and people have already
> complained about the configure time).
> 
> The same problem is seen also in GNU gettext and in GNU poke. I'm fixing it
> through the attached patch set.

Unfortunately this broke getopt-gnu on Solaris 10, because it relies on 
this line in modules/unistd:

	      -e 
's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT)/g' 
\

and substitution went awry in this line, resulting in:

               -e 
's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_GNULIB_GL_UNISTD_H_GETOPT)/g' \

This caused 'make check' to fail because test-getopt-gnu.c was testing 
Solaris getopt rather than the Gnulib substitute.

I discovered the problem after updating GNU grep to use the latest 
Gnulib, and after someone else's buildbots failed on Solaris 10 with 
'grep' and I got notified of their failures:

https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-i386/builds/227
https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/229

I installed the attached patch to work around the problem. The Python 
patch is obviously a hack (and I haven't tested it); suggestions for 
improvements are welcome.

I must say that I am starting to reach my limits in debugging this sort 
of thing. We have quite a pyramid of hacks here, involving more than 
just the usual multilevel combination of make, m4, sh, and sed along 
with Git submodules etc., and now also a duplicate Python implementation 
that I don't offhand know how to test. And 'gnulib-tool', 'configure' 
and 'make check' are so verrryy slow; to find the commit that caused the 
problem, I had to run 'git bisect' overnight because my circa-2005 
Solaris 10 sparc machine is not as fast as modern machines. This is a 
long way from my traditional way of developing where I edited a Makefile 
and typed 'make' (and that was already too slow!).

I don't have a solution to this problem, and to some extent am just venting.

[-- Attachment #2: 0001-getopt-gnu-port-back-to-Solaris-10.patch --]
[-- Type: text/x-patch, Size: 6622 bytes --]

From 3dd3c04d9b5cf70fa454a19c90fa7d9ddd8b0d1c Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 13 Jun 2021 10:31:33 -0700
Subject: [PATCH] getopt-gnu: port back to Solaris 10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnulib-tool (func_emit_lib_Makefile_am)
(func_emit_tests_Makefile_am): Don’t substitute things like
$(GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT),
as this mishandles unistd and getopt-gnu, which breaks
‘make check’ on Solaris 10 with getopt-gnu.
* pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am):
Likewise, albeit hackier since I did not test this and
so went with a trivial hack instead.
---
 ChangeLog            | 12 ++++++++++++
 gnulib-tool          |  8 ++++----
 pygnulib/GLEmiter.py | 12 ++++++++++++
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b48760c6e..084c43017 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2021-06-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+	getopt-gnu: port back to Solaris 10
+	* gnulib-tool (func_emit_lib_Makefile_am)
+	(func_emit_tests_Makefile_am): Don’t substitute things like
+	$(GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT),
+	as this mishandles unistd and getopt-gnu, which breaks
+	‘make check’ on Solaris 10 with getopt-gnu.
+	* pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am):
+	Likewise, albeit hackier since I did not test this and
+	so went with a trivial hack instead.
+
 2021-06-13  Bruno Haible  <bruno@clisp.org>
 
 	ialloc: Put appropriate license notice in source files.
diff --git a/gnulib-tool b/gnulib-tool
index 63a875d4a..1ea6580b3 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -3700,7 +3700,7 @@ func_emit_lib_Makefile_am ()
                 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \
                 -e "$sed_eliminate_LDFLAGS" \
                 -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \
-                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,' \
+                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,' \
                 -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \
                 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \
                 -e "$sed_transform_check_PROGRAMS" \
@@ -3714,7 +3714,7 @@ func_emit_lib_Makefile_am ()
           func_get_automake_snippet_unconditional "$module" |
             LC_ALL=C \
             sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \
-                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,'
+                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,'
         } > "$tmp"/amsnippet2
         # Skip the contents if it's entirely empty.
         if grep '[^	 ]' "$tmp"/amsnippet1 "$tmp"/amsnippet2 > /dev/null ; then
@@ -4058,7 +4058,7 @@ func_emit_tests_Makefile_am ()
                 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \
                 -e "$sed_eliminate_LDFLAGS" \
                 -e 's,lib_\([A-Z][A-Z]*\),libtests_a_\1,g' \
-                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,' \
+                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,' \
                 -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \
                 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \
                 -e "$sed_transform_check_PROGRAMS" \
@@ -4072,7 +4072,7 @@ func_emit_tests_Makefile_am ()
           func_get_automake_snippet_unconditional "$module" |
             LC_ALL=C \
             sed -e 's,lib_\([A-Z][A-Z]*\),libtests_a_\1,g' \
-                -e 's,\$(GNULIB_,$('"${module_indicator_prefix}"'_GNULIB_,'
+                -e 's,\$(\(GNULIB_[A-Z]\),$('"${module_indicator_prefix}"'_\1,'
         } > "$tmp"/amsnippet2
         # Skip the contents if it's entirely empty.
         if grep '[^	 ]' "$tmp"/amsnippet1 "$tmp"/amsnippet2 > /dev/null ; then
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index e6b5a2a72..729862bc1 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -716,8 +716,12 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                 pattern = compiler('lib_([A-Z][A-Z](?:.*?))', re.S | re.M)
                 amsnippet1 = pattern.sub('%s_%s_\\1' %
                                          (libname, libext), amsnippet1)
+                # FIXME: Use regular expression substitution instead
+                # of this hack.
+                amsnippet1 = amsnippet1.replace('$(GNULIB_$', '$(GNULIB!@#$%')
                 amsnippet1 = amsnippet1.replace(
                     '$(GNULIB_', '$(' + module_indicator_prefix + '_GNULIB_')
+                amsnippet1 = amsnippet1.replace('$(GNULIB!@#$%', '$(GNULIB_$')
                 amsnippet1 = amsnippet1.replace(
                     'lib%_LIBRARIES', 'lib_LIBRARIES')
                 amsnippet1 = amsnippet1.replace(
@@ -741,8 +745,12 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                 pattern = compiler('lib_([A-Z][A-Z](?:.*?))', re.S | re.M)
                 amsnippet2 = pattern.sub('%s_%s_\\1' %
                                          (libname, libext), amsnippet2)
+                # FIXME: Use regular expression substitution instead
+                # of this hack.
+                amsnippet2 = amsnippet2.replace('$(GNULIB_$', '$(GNULIB!@#$%')
                 amsnippet2 = amsnippet2.replace(
                     '$(GNULIB_', '$(' + module_indicator_prefix + '_GNULIB_')
+                amsnippet1 = amsnippet2.replace('$(GNULIB!@#$%', '$(GNULIB_$')
                 if type(amsnippet1) is bytes:
                     amsnippet1 = amsnippet1.decode(ENCS['default'])
                 if type(amsnippet2) is bytes:
@@ -1011,8 +1019,12 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                     snippet = pattern.sub('', snippet)
                 pattern = compiler('lib_([A-Z][A-Z](?:.*?))', re.S | re.M)
                 snippet = pattern.sub('libtests_a_\\1', snippet)
+                # FIXME: Use regular expression substitution instead
+                # of this hack.
+                snippet = snippet.replace('$(GNULIB_$', '$(GNULIB!@#$%')
                 snippet = snippet.replace(
                     '$(GNULIB_', '$(' + module_indicator_prefix + '_GNULIB_')
+                snippet = snippet.replace('$(GNULIB!@#$%', '$(GNULIB_$')
                 snippet = snippet.replace('lib%_LIBRARIES', 'lib_LIBRARIES')
                 snippet = snippet.replace(
                     'lib%_LTLIBRARIES', 'lib_LTLIBRARIES')
-- 
2.30.2


  parent reply	other threads:[~2021-06-13 17:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10  7:38 Interference between two installations of gnulib Reuben Thomas
2021-04-11 19:32 ` Bruno Haible
2021-04-12  7:50   ` Reuben Thomas
2021-04-17 15:17   ` Bruno Haible
2021-04-18 11:16     ` Bruno Haible
2021-06-13 17:41   ` Paul Eggert [this message]
2021-06-13 20:55     ` Bruno Haible
2021-06-13 21:11     ` general comments about gnulib Bruno Haible

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=111e3305-4023-415b-3631-653b87a09e2c@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=rrt@sc3d.org \
    /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).