GNU bug report logs - #79847
[PATCH 1/1] 31.0.50; xwidgets: pacify macOS compiler warnings

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Alexander Adolf <alexander.adolf@HIDDEN>; Keywords: patch; dated Sun, 16 Nov 2025 17:32:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 79847 <at> debbugs.gnu.org:


Received: (at 79847) by debbugs.gnu.org; 17 Nov 2025 12:27:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 17 07:27:15 2025
Received: from localhost ([127.0.0.1]:51027 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKyKB-0002hK-8l
	for submit <at> debbugs.gnu.org; Mon, 17 Nov 2025 07:27:15 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:59230)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vKyK9-0002h2-0P
 for 79847 <at> debbugs.gnu.org; Mon, 17 Nov 2025 07:27:13 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1vKyK3-0005ok-7c; Mon, 17 Nov 2025 07:27:07 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ql+nhe5uCd5JSfpYo+tV53sz+OXOLBxuJivBO2JNwl0=; b=mxSmjrW/Jdbs
 4Krdsvx6+ynYe6YwNPys/laTxIJqnAjbYDssZ7YuCpGQaKaXHYTHzbOTmqRawr2h3l0FfuNMxh3+f
 sJirtGxBbhs1lBRMs7pmeyRDmxSuByl4NuET1DKYYR06w9hdP4jD5X9mDMsxPVG4FddSJ1iI3A+a9
 GZM1ZIndYRD5l2tlzCn3bao0f8FZyk5AzFup8zEbHSluge0g2v905rB77l+Ry4nF3ZIRLYUZRbREw
 wZ10p9SI+CogQeFyOt6W+PIqnoXZojzW0WejeN8SFbDeX92GozIpYrh+dJYe0MxM1HXKZQgFd0hYR
 ugtRK+4IprDwjB/Dp7Nf9g==;
Date: Mon, 17 Nov 2025 14:27:02 +0200
Message-Id: <86o6p0lu95.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alexander Adolf <alexander.adolf@HIDDEN>
In-Reply-To: <9573bce6939f36b65835ff52094e2684@HIDDEN>
 (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#79847: [PATCH 1/1] 31.0.50;
 xwidgets: pacify macOS compiler warnings
References: <9573bce6939f36b65835ff52094e2684@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79847
Cc: 79847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sun, 16 Nov 2025 18:31:22 +0100
> From:  Alexander Adolf via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> on macOS, when including --with-xwidgets in the configure options, but
> without having the wxwidgets library installed (e.g. homebrew), so that
> the build uses the WebKit from macOS, I get the same compiler warning
> for a lengthy list of C files, with dispnew.c being the first one:
> 
> clang: warning: no such include directory: '/System/Library/Frameworks/WebKit.framework/Headers' [-Wmissing-include-dirs]
> 
> The executable resulting from such a build does work as expected,
> however. It seems that the Xcode tools employ some further magic to do
> the right thing.
> 
> The reason for the compiler warnings is that the hard-coded path for the
> macOS WebKit header files in configure.ac may or may not be usable.
> Several SDK versions may be installed in parallel, each one providing
> its own set of development headers. Usually, the safest bet is to query
> for the correct path to SDK files using the xcrun command.
> 
> That is what the attached patch does.
> 
> It also keeps the original hard-coded path as a fallback in case xcrun
> should fail to deliver meaningful results.
> 
> 
> Hoping to have helped, and looking forward to your thoughts,

Thanks.  Could someone who can build Emacs on macOS please test the
patch in the various variants, and provide feedback?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#79847; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Nov 2025 17:31:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 16 12:31:40 2025
Received: from localhost ([127.0.0.1]:46222 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKgbE-0006wa-4l
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 12:31:40 -0500
Received: from lists.gnu.org ([2001:470:142::17]:39226)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <alexander.adolf@HIDDEN>)
 id 1vKgbB-0006wK-2b
 for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 12:31:37 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <alexander.adolf@HIDDEN>)
 id 1vKgb5-0004HU-An
 for bug-gnu-emacs@HIDDEN; Sun, 16 Nov 2025 12:31:31 -0500
Received: from www191.your-server.de ([188.40.2.11])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <alexander.adolf@HIDDEN>)
 id 1vKgb3-0002QB-GV
 for bug-gnu-emacs@HIDDEN; Sun, 16 Nov 2025 12:31:31 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=condition-alpha.com; s=default2503; h=Content-Type:MIME-Version:Date:
 Subject:To:From:Message-Id:Sender:Reply-To:Cc:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References;
 bh=XxehayQTaM8M7/8in/Y1CZo6Oo0GB/Fd6JaSiiXjf+k=; b=G7r/oDHxh8NwiAJjqiMqmPZwCL
 VmY1hUVGsXajoPeQ4m+co4gAXhfgQ1mAsqtnosgjRdcTzzLpEKh3kB7A6af90gAWyhalgGMiHEHOV
 sIO1/15083DCBD/Akq3ZQxwNhgyafJvwoxbXllkIiLbF48RhZJhMlirWApGYVVwsNbn0bZNyQhzWT
 ORRNE3TISf0OrHlnuIhbROZ04QsVx5ND5I6w2QYHnPz9SZbQTJ6zQ4ynlYIWpER+jYELUs77nuC8i
 0JMeuzkdflt/lj7uubtdaTUq4UYMEz1XlQpCwrYO3HfOKpSvCIr5bU5hUWV7HBQw/7quOEiPr9ggv
 t3CbCnDg==;
Received: from sslproxy02.your-server.de ([78.47.166.47])
 by www191.your-server.de with esmtpsa  (TLS1.3) tls TLS_AES_256_GCM_SHA384
 (Exim 4.96.2) (envelope-from <alexander.adolf@HIDDEN>)
 id 1vKgax-0009WE-1H for bug-gnu-emacs@HIDDEN;
 Sun, 16 Nov 2025 18:31:23 +0100
Received: from localhost ([127.0.0.1])
 by sslproxy02.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384
 (Exim 4.96) (envelope-from <alexander.adolf@HIDDEN>)
 id 1vKgaw-0003Vq-2V for bug-gnu-emacs@HIDDEN;
 Sun, 16 Nov 2025 18:31:23 +0100
Message-Id: <9573bce6939f36b65835ff52094e2684@HIDDEN>
From: Alexander Adolf <alexander.adolf@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH 1/1] 31.0.50; xwidgets: pacify macOS compiler warnings
Date: Sun, 16 Nov 2025 18:31:22 +0100
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Virus-Scanned: Clear (ClamAV 1.0.9/27822/Fri Nov 14 10:08:05 2025)
Received-SPF: pass client-ip=188.40.2.11;
 envelope-from=alexander.adolf@HIDDEN; helo=www191.your-server.de
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

--=-=-=
Content-Type: text/plain

Hello,

on macOS, when including --with-xwidgets in the configure options, but
without having the wxwidgets library installed (e.g. homebrew), so that
the build uses the WebKit from macOS, I get the same compiler warning
for a lengthy list of C files, with dispnew.c being the first one:

clang: warning: no such include directory: '/System/Library/Frameworks/WebKit.framework/Headers' [-Wmissing-include-dirs]

The executable resulting from such a build does work as expected,
however. It seems that the Xcode tools employ some further magic to do
the right thing.

The reason for the compiler warnings is that the hard-coded path for the
macOS WebKit header files in configure.ac may or may not be usable.
Several SDK versions may be installed in parallel, each one providing
its own set of development headers. Usually, the safest bet is to query
for the correct path to SDK files using the xcrun command.

That is what the attached patch does.

It also keeps the original hard-coded path as a fallback in case xcrun
should fail to deliver meaningful results.


Hoping to have helped, and looking forward to your thoughts,

  --alexander



--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-xwidgets--pacify-macOS-compiler-warnings.patch
Content-Description: [PATCH 1/1] ; xwidgets: pacify macOS compiler warnings

From 95fbd6eb3cc849cdcc878afaebeced77a084c134 Mon Sep 17 00:00:00 2001
From: Alexander Adolf <alexander.adolf@HIDDEN>
Date: Sun, 16 Nov 2025 17:59:02 +0100
Subject: [PATCH 1/1] ; xwidgets: pacify macOS compiler warnings

* configure.ac: when the WebKit header files are not available
in the hard-coded location, query for the location of the
currently active SDK, and resort to the header files there
---
 configure.ac | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 44d9cae1e7e..23690eabb40 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4454,7 +4454,16 @@ AC_DEFUN
     dnl FIXME: Check framework WebKit2
     dnl WEBKIT_REQUIRED=M.m.p
     WEBKIT_LIBS="-Wl,-framework -Wl,WebKit"
-    WEBKIT_CFLAGS="-I/System/Library/Frameworks/WebKit.framework/Headers"
+    WEBKIT_HEADERS="/System/Library/Frameworks/WebKit.framework/Headers"
+    if test -z "$xcsdkdir" -a -n "$XCRUN" -a ! -d "${WEBKIT_HEADERS}"; then
+      dnl WebKit headers not found.  Try Xcode SDK dir if it is sane.
+      xcsdkdir=`$XCRUN --show-sdk-path 2>/dev/null`
+      case $xcsdkdir in
+	*[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+	xcsdkdir="" ;;
+      esac
+    fi
+    WEBKIT_CFLAGS="-I${xcsdkdir}${WEBKIT_HEADERS}"
     HAVE_WEBKIT="yes"
     HAVE_XWIDGETS=$HAVE_WEBKIT
     XWIDGETS_OBJ="xwidget.o"
-- 
2.50.1 (Apple Git-155)


--=-=-=--




Acknowledgement sent to Alexander Adolf <alexander.adolf@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#79847; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 17 Nov 2025 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.