unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [PATCH] Add quotes in AS_IF test for gid_t
       [not found] ` <4e0c6b19-07bc-fbc5-4e4c-df2b088db4cb@draconx.ca>
@ 2024-02-07 21:22   ` Paul Eggert
  2024-02-08  5:01     ` Sam James
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggert @ 2024-02-07 21:22 UTC (permalink / raw)
  To: Nick Bowler, Sam James; +Cc: autoconf-patches, Emacs development discussions

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

On 2/6/24 20:37, Nick Bowler wrote:
> On 2024-02-06 22:33, Sam James wrote:
>> Noticed when building Emacs:
>> ```
>> * checking type of array argument to getgroups... ./configure: 42782: test: =: unexpected operator
>> ```

> Oh look, I see this line in emacs-29.2/configure.ac:
> 
>    AC_DEFUN([AC_TYPE_UID_T])
> 
> This is the actual cause of the problem, because AC_TYPE_UID_T is the
> part of Autoconf that would have assigned this variable.  Since Emacs
> has deleted its definition, it has therefore broken other Autoconf
> macros (like AC_TYPE_GETGROUPS) which depend on it.

Thanks for reporting this. I installed the attached patch into Emacs master.

The now-fixed bug in Emacs's generated 'configure' script should be 
harmless on all platforms I know about, as AC_TYPE_GETGROUPS should go 
ahead and do the right thing anyway.

PS. There is a case for quoting all uses of ac_cv_* variables, as their 
values may be corrupted in the cache. This is my usual style elsewhere 
and perhaps Autoconf should adopt it. Of course if we'd done that we 
would likely never have spotted this harmless error in Emacs 
configure.ac....

[-- Attachment #2: 0001-Port-better-to-Autoconf-2.72.patch --]
[-- Type: text/x-patch, Size: 910 bytes --]

From e34ebc0ccc6c27e7e1217baad9ca74dd7bea4c37 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 7 Feb 2024 13:17:57 -0800
Subject: [PATCH] Port better to Autoconf 2.72

* configure.ac: Set ac_cv_type_gid_t=yes to pacify Autoconf 2.72
AC_TYPE_GETGROUPS.  Problem reported by Nick Bowler in:
https://lists.gnu.org/r/autoconf-patches/2024-02/msg00001.html
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index b74eba879ab..847fdbd54d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2337,6 +2337,7 @@ AC_DEFUN
 AC_DEFUN([AC_TYPE_SIZE_T])
 # Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them.
 AC_DEFUN([AC_TYPE_UID_T])
+ac_cv_type_gid_t=yes # AC_TYPE_GETGROUPS needs this in Autoconf 2.72.
 
 # Check for all math.h functions that Emacs uses; on some platforms,
 # -lm is needed for some of these functions.
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add quotes in AS_IF test for gid_t
  2024-02-07 21:22   ` [PATCH] Add quotes in AS_IF test for gid_t Paul Eggert
@ 2024-02-08  5:01     ` Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-02-08  5:01 UTC (permalink / raw)
  To: Paul Eggert
  Cc: Nick Bowler, Sam James, autoconf-patches,
	Emacs development discussions


Paul Eggert <eggert@cs.ucla.edu> writes:

> On 2/6/24 20:37, Nick Bowler wrote:
>> On 2024-02-06 22:33, Sam James wrote:
>>> Noticed when building Emacs:
>>> ```
>>> * checking type of array argument to getgroups... ./configure: 42782: test: =: unexpected operator
>>> ```
>
>> Oh look, I see this line in emacs-29.2/configure.ac:
>>    AC_DEFUN([AC_TYPE_UID_T])
>> This is the actual cause of the problem, because AC_TYPE_UID_T is
>> the
>> part of Autoconf that would have assigned this variable.  Since Emacs
>> has deleted its definition, it has therefore broken other Autoconf
>> macros (like AC_TYPE_GETGROUPS) which depend on it.
>
> Thanks for reporting this. I installed the attached patch into Emacs master.
>
> The now-fixed bug in Emacs's generated 'configure' script should be
> harmless on all platforms I know about, as AC_TYPE_GETGROUPS should go
> ahead and do the right thing anyway.

Thank you Paul!

>
> PS. There is a case for quoting all uses of ac_cv_* variables, as
> their values may be corrupted in the cache. This is my usual style
> elsewhere and perhaps Autoconf should adopt it. Of course if we'd done
> that we would likely never have spotted this harmless error in Emacs
> configure.ac....

Yeah, I had the same thought process and feel a bit torn.

thanks,
sam




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-08  5:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240207033334.1489580-1-sam@gentoo.org>
     [not found] ` <4e0c6b19-07bc-fbc5-4e4c-df2b088db4cb@draconx.ca>
2024-02-07 21:22   ` [PATCH] Add quotes in AS_IF test for gid_t Paul Eggert
2024-02-08  5:01     ` Sam James

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).