mainAutoconf - Support: sr #110435, autoreconf: recognize when...

 
 

sr #110435: autoreconf: recognize when AM_ICONV is used without the rest of gettext

Submitter:  None
Submitted:  Thu 28 Jan 2021 10:58:17 AM UTC
   
 
Priority:  * 3 - Release N+1 Severity:  1 - Wish
Status:  Confirmed Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Open Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 08 Dec 2023 08:08:40 PM UTC, comment #8: 

I think this bug should NOT be fixed.

The reason is that ideally, there should be one and only one tool responsible for installing config.rpath in the developer's package when needed. It's already bad enough that three(!) tools do this: gettextize, autopoint, and gnulib-tool. This creates interdependencies between GNU gettext and GNU gnulib, that fortunately are bearable because GNU gnulib changes are effective immediately - no releases.

If we were to add a fourth tool (autoreconf), we would also have interdependencies between GNU autoconf and GNU gettext. Since GNU autoconf tends to have releases quite infrequently, roughly once every 3 years on average, this would mean that some aspects of GNU gettext could be blocked for several years. (There are also already interdependencies between GNU automake and GNU gettext. We have been lucky that this affects only a warning and nothing is blocked.)

It is better if this bug does not get fixed - this affects few users - than that the development of GNU gettext be partially blocked for years.

The proper way to fix this would be for 'autoreconf' to invoke some program (or shell script) that GNU gettext has installed. So that GNU gettext may evolve even if there are no new GNU autoconf releases for N years. Much like bash does with the bash completions: bash does not include completion logic for a multitude of package, but rather it has a mechanism through which packages can install their completion logic.

Bruno Haible <haible>
Fri 08 Dec 2023 07:32:35 PM UTC, comment #7: 

Yes, I have wrote in the first comment that the custom script which copies config.rpath to current directory and then run autoreconf is a workaround.

I'm looking at autotools now again and seems that config.rpath is copied by autopoint to current dir. But autopoint is called only when configure.ac uses AM_GNU_GETTEXT_VERSION macro. But usage of AM_GNU_GETTEXT_VERSION in configure.ac cause that autoreconf (or its subprocess) installs gettext stuff which are not required for non-gettext projects.

So I think that solution for this problem can be:
Use current autoreconf detection if calling autopoint is needed and call it. If autopoint was not called and configure.ac use AM_ICONV macro then copy config.rpath to current directory.

Anonymous
Fri 08 Dec 2023 07:27:37 PM UTC, comment #6: 

On further investigation it's not that simple after all.  An autogen.sh script is written knowing exactly what is needed for a particular project, but autoreconf needs to detect when a project needs this versus when it needs the full autopoint treatment and when it doesn't need either, and that's complicated enough by itself that I think this needs to wait for the next release after all.  Still, knowing what to do is very helpful.

Bruno, re

> if new files (.m4 files or else) are needed as new dependencies of iconv.m4, this method will not know about it


M4 dependencies should be taken care of by aclocal, shouldn't they?  I do see that new non-M4 dependencies could be a problem.

Zack Weinberg <zackw>
Group administrator
Fri 08 Dec 2023 06:18:02 PM UTC, comment #5: 

Hmm, if it's that simple I'll put it back on the "if we have time" list for 2.72.

Zack Weinberg <zackw>
Group administrator
Fri 08 Dec 2023 05:03:49 PM UTC, comment #4: 

Here is simple autogen.sh script which can be used to avoid this AM_ICONV autoreconf bug:

#!/bin/sh

# Install config.rpath which is needed for AM_ICONV macro
for dir in "$GETTEXT_DIR" /usr/share/gettext /usr/local/share/gettext; do
  if test -f "$dir/config.rpath"; then
    test -f config.rpath || echo "autogen.sh: installing './config.rpath'"
    cp -f "$dir/config.rpath" .
    break
  fi
done

autoreconf --install --force --verbose


Anonymous
Fri 08 Dec 2023 04:47:15 PM UTC, comment #3: 

I don't see any particular reason why autoreconf couldn't be taught to import the gnulib iconv module if it sees AM_ICONV used but not anything else from gettext.  But it's probably not going to be a priority for any of the active maintainers.

Zack Weinberg <zackw>
Group administrator
Sat 30 Jan 2021 11:12:18 AM UTC, comment #2: 

comment #1:

> > https://lists.gnu.org/archive/html/bug-gettext/2011-10/msg00012.html
> > When a project wants to only use AM_ICONV and none of the other gettext autoconf macros
>
> If your package only wants to use iconv() but no support for localized messages, it should use the gnulib module 'iconv'. This module includes the config.rpath file.


Could you show to me (and also to other people) a configure.ac example how to to use it? Yes I just need to use only iconv() library and ICONV_CONST macro in C source code which is provided by autoconf macro AM_ICONV.

> autoreconf deals with gettext for convenience. It does not know about gnulib modules.
>
> > projects which needs to use AM_ICONV started providing their own "autogen.sh" script which copies required file config.rpath to current directory and then run autoreconf.
>
> This is not future-proof: if new files (.m4 files or else) are needed as new dependencies of iconv.m4, this method will not know about it.


I know. But all projects started doing it due to above unfixed bug in autoreconf/autopoint/gettext and it started to be de-facto start way how to workaround above bug. And I'm just following this way.

Anonymous
Sat 30 Jan 2021 10:10:03 AM UTC, comment #1: 


> https://lists.gnu.org/archive/html/bug-gettext/2011-10/msg00012.html
> When a project wants to only use AM_ICONV and none of the other gettext autoconf macros


If your package only wants to use iconv() but no support for localized messages, it should use the gnulib module 'iconv'. This module includes the config.rpath file.

autoreconf deals with gettext for convenience. It does not know about gnulib modules.

> projects which needs to use AM_ICONV started providing their own "autogen.sh" script which copies required file config.rpath to current directory and then run autoreconf.


This is not future-proof: if new files (.m4 files or else) are needed as new dependencies of iconv.m4, this method will not know about it.

Bruno Haible <haible>
Thu 28 Jan 2021 10:58:17 AM UTC, original submission:  

This is old bug which was reported at least 10 years ago, affects more projects and there was no response for it yet. So I'm filling this bug report again.

Here is one of the original reports:
https://lists.gnu.org/archive/html/bug-gettext/2011-10/msg00012.html

Problem is that if autoconf project wants to use AM_ICONV macro without any other gettext macro support, autoreconf does not install required file config.rpath, which leads to broken configure script.

Details with reproducer are in linked bug above.

As a temporary workaround to this issue, projects which needs to use AM_ICONV started providing their own "autogen.sh" script which copies required file config.rpath to current directory and then run autoreconf.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by zackw (Posted a comment)
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-12-08 zackw Priority7 - Release N (Desirable) 3 - Release N+1
        Summaryautoreconf does not recognize AM_ICONV autoreconf: recognize when AM_ICONV is used without the rest of gettext
    2023-12-08 zackw StatusNone Confirmed
    2023-12-08 zackw Priority2 - Eventually 7 - Release N (Desirable)
    2023-12-08 zackw Priority5 - Unprioritized 2 - Eventually
        Severity3 - Normal 1 - Wish

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code