Subject: Re: bug#74503: Test issues in "make check"
From: Pádraig Brady <[email-masked]>
To: Gordon Steemson <[email-masked]>
Cc: [email-masked]
Date: Tue, 26 Nov 2024 15:05:09 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

On 26/11/2024 04:27, Gordon Steemson wrote:
> Hello again,
> 
>> On Nov 24, 2024, at 5:10 AM, Pádraig Brady <[email-masked]> wrote:
>>
>> On 24/11/2024 05:34, Gordon Steemson wrote:
>>> Setup:  [...]
> 
> I should also have added that the tests were running under the latest Bash 5.2.37 rather than the stock Bash 3.2, though fortunately it doesn't seem to have mattered.
> 
>>>   an error message complaining that “2á != 2á”.
>>
>> I pushed a fix to use æ instead, as that does not have a separate decomposed form.
> 
> I can confirm that works.
> 
>>> - tests/misc/tee.sh [...]
>>
>> The script is OK I think. darwin 9 is old (nearly 20 years old now!),
>> so perhaps its poll vs select behavior is divergent enough with more recent macOS to be problematic.
>> Could you try with this adjustment to the code.
>> [...]
> 
> Got to admit I never would have guessed that one in a million years, but you appear to have been exactly right – your proposed tweak worked perfectly.
> 
> Thank you -- both 'make check' issues I encountered are now resolved.

Thanks for the confirmation.
I'll apply the following to address this.
Marking this as done.

thanks,
Pádraig

commit 4a4377f8697385b0676d08b51d10694afca1d9bf (HEAD -> master)Author: Pádraig Brady <[email-masked]>
Date:   Tue Nov 26 14:04:32 2024 +0000

     tail,tee: fix broken pipe detection on darwin 9

     * src/iopoll.c (): Restrict use of poll() on macOS
     to >= 11 (darwin 20), as it was seen to fail on macOS 10.5.
     Fixes https://bugs.gnu.org/74503

diff --git a/src/iopoll.c b/src/iopoll.c
index 8e5c92dd8..174048639 100644
--- a/src/iopoll.c
+++ b/src/iopoll.c
@@ -21,10 +21,11 @@
  /* poll(2) is needed on AIX (where 'select' gives a readable
     event immediately) and Solaris (where 'select' never gave
     a readable event).  Also use poll(2) on systems we know work
-   and/or are already using poll (linux).  */
-
-#if defined _AIX || defined __sun || defined __APPLE__ || \
-    defined __linux__ || defined __ANDROID__
+   and/or are already using poll (linux).  On macOS we know poll()
+   doesn't work on 10.5, while it does work on >= 11 at least. */
+#if defined _AIX || defined __sun \
+    || defined __linux__ || defined __ANDROID__ \
+    || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 110000
  # define IOPOLL_USES_POLL 1
    /* Check we've not enabled gnulib's poll module
       as that will emulate poll() in a way not