From: Bruno Haible <bruno@clisp.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Paul Eggert <eggert@cs.ucla.edu>,
bug-gnulib@gnu.org, emacs-devel@gnu.org
Subject: Re: MinGW build on master broken by Gnulib update
Date: Fri, 06 Sep 2024 11:52:20 +0200 [thread overview]
Message-ID: <7918236.WG90pMdilM@nimes> (raw)
In-Reply-To: <86r09x1dmf.fsf@gnu.org>
Replying to the thread that started at
<https://lists.gnu.org/archive/html/emacs-devel/2024-09/msg00131.html>.
I agree with everything that Paul wrote in this thread, except for the
typo where we wrote "MSVC port of Emacs" but meant "mingw port of Emacs".
Eli Zaretskii replied to Paul Eggert:
> > ... Callers shouldn't do
> > that. They are supposed to include <signal.h> to declare sig2str.
> > sig2str.h is for something else: it's for defining SIGNUM_BOUND, and it
> > includes signal.h only to be backwards-compatible with older Gnulib
> > versions.
>
> Then document this and be done. I don't see how is this a big
> problem.
We already document this, in the module description of the 'sig2str' module:
Include:
<signal.h>
"sig2str.h" /* for SIGNUM_BOUND */
It is a bit terse, but it means:
- Callers should use '#include <signal.h>' for the general part.
- Callers should additionally use '#include "sig2str.h"' if they need the
SIGNUM_BOUND macro.
> > >> Instead, how about adjusting Emacs's MinGW shims to supply the missing
> > >> declarations? Something like the attached patch, say. (I don't use MinGW
> > >> so can't easily test this.)
> > >
> > > This might solve the Emacs problem (and is not very clean even in that
> > > case), but will not help other projects that use Gnulib.
> >
> > That's not something we need to worry about.
>
> That is strange to hear, since Gnulib is supposed to care about all
> GNU projects, not just about Emacs.
Gnulib cares about all GNU packages. Emacs is one of them, which is why
we are discussing here. You are arguing that there are or might be other
GNU packages that have the same problem as Emacs. This is not the case.
Emacs uses the --avoid option far more extensively than other packages
that use Gnulib. And when a packages uses the --avoid option, the documentation
<https://www.gnu.org/software/gnulib/manual/html_node/Initial-import.html>
says:
"If you want to cut a dependency, i.e., not add a module although one
of your requested modules depends on it, you may use the option
‘--avoid=module’ to do so. Multiple uses of this option are possible.
Of course, you will then need to implement the same interface as the
removed module."
The patch that Paul suggested in
<https://lists.gnu.org/archive/html/emacs-devel/2024-09/msg00169.html>
is exactly the right thing: Since you decided that you don't want the
signal-h module, but sig2str needs this module for providing the declaration
of the two functions, you need to provide the declaration of these two
functions elsewhere.
> I have neither time nor energy for this Gnulib politics, so I went
> ahead and installed a workaround for this. (If I had more free time,
> which I don't, I'd stopped using the Gnulib sig2str.c altogether to
> avoid the issue in the first place, but things being as they are, I
> installed an easier cop-out.) If the Gnulib folks (CC'ed) are ready
> to reconsider, I will be happy to remove the workaround.
Adapting Gnulib to one's package can be done in multiple ways:
- through the --avoid option for selected modules,
- through the --local-dir option and *.diff files, which is
roughly equivalent to applying patches after running gnulib-tool,
- by upstreaming specific requirements to Gnulib.
Among these possibilities, use of the --local-dir option has the highest
maintenance cost, especially for a file such as signal.in.h. It would
break several times a year. Patching a rarely-modified file such as
sig2str.h, like you did, is going to work for some time, but will break
when on the Gnulib side we decide to add more declarations to this .h file.
In other words, adapting Gnulib to one's package is an art; it's a series
of continuing compromises with maintainability in mind. Paul Eggert masters
this art perfectly. You can 100% trust him in these matters.
Bruno
prev parent reply other threads:[~2024-09-06 9:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 5:43 MinGW build on master broken by Gnulib update Eli Zaretskii
2024-09-05 16:28 ` Paul Eggert
2024-09-05 18:02 ` Eli Zaretskii
2024-09-05 18:49 ` Paul Eggert
2024-09-06 6:48 ` Eli Zaretskii
2024-09-06 9:52 ` Bruno Haible [this message]
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://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7918236.WG90pMdilM@nimes \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).