GNU bug report logs - #80094
31.0.50; [PATCH] Emacs executable unusable with --disable-ns-self-contained and --with-native-compilation

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: Yavor Doganov <yavor@HIDDEN>; Keywords: patch; dated Mon, 29 Dec 2025 14:34:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 80094) by debbugs.gnu.org; 12 Jan 2026 12:27:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 12 07:27:09 2026
Received: from localhost ([127.0.0.1]:60251 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vfH0m-0006Rl-Jq
	for submit <at> debbugs.gnu.org; Mon, 12 Jan 2026 07:27:08 -0500
Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]:58466)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1vfH0k-0006Rc-D2
 for 80094 <at> debbugs.gnu.org; Mon, 12 Jan 2026 07:27:06 -0500
Received: by mail-ej1-x644.google.com with SMTP id
 a640c23a62f3a-b87018f11e3so218839466b.0
 for <80094 <at> debbugs.gnu.org>; Mon, 12 Jan 2026 04:27:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1768220825; x=1768825625; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=/x1wp6Ci05k5rDstv6cB5jGVAPnsF7tEpCyTnLjNmh4=;
 b=g1w0DlRm6wddLXh9/aR/FPirqStYqHutoYmHqorCYtyagDuBKZ4y/J1bJPG3g4HZLf
 2oDAtkoJfTr2pEuoO9E7TD3jWyjUEWTHnjIXgi9jRROIqFEj6YD/mU4s46+Zcu78lNrP
 konB0bC2QKmfTCVw47MXGpKQh0+94cRLzdFasXYPTo0vbV5H0IodIFJ13zXO4a7D8dax
 PZpUBsAtCoh8zi+r2w0Q3DVGe9paJ5me3VBmo8CutB19MJparZvMGFxDPNb3mmV7Bxat
 I2tigphaR9I4ygJVTXLElY+uDNpuJo1fDXEMzJJ282LmVpjv8ICqnRmP2gVwNZrd/yQB
 T3Ew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1768220825; x=1768825625;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=/x1wp6Ci05k5rDstv6cB5jGVAPnsF7tEpCyTnLjNmh4=;
 b=uegPrnzA/5ho1auLRxe9qbAQlg2tJO+LAC5PycRWQpp7giugmrw09B/BkMPji1M61o
 v7Rnmev1fBfmdU34jzqOa+CA4LrXSFH2Jbn6z6wLVp1D83DVeaQkiK57nmyTrFV2TVBd
 HgmaJuCqKwaZ0PjGuQUuMQNTgXxDZ07AbH+RKGRW+OJ4yq5Iv8PM85cDPD14KxwpNGZu
 hXzT57DbHITl3P4WmJodqlzOwAtZfOu6CToUVfLHyNYmgANpmglgBPsw2Il0fCy4miNM
 AMudADZ6NyopEIrauIpdy4MQOPGbvEYmQckejd1+oqtutRvsLueb25YEqz+XTA/fl22Y
 GNOA==
X-Forwarded-Encrypted: i=1;
 AJvYcCVkHkvSGpoBxvEVTcC57y/lam+bgAhcWVcrbpRy7viNhZsIdSikBvYMxdANLVKEw3vmLt3SkA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxWMFe/xVkt5T+XzW0D8mvucJAP9mo3ZCCbRl9QNbGBmyZjvU0q
 SnOYsFH6/gedSZqOhe79ibRohWAob9JX/VZEdbq1yqaiBN1165RqKEgZ
X-Gm-Gg: AY/fxX6W3U9TtOBEetPNzk3uC1Yu6m3KMpRxPa1DuinpyngJWLBft5BYeqWZVPL/F+O
 Xpsbs437m/NxRTUeI/MyxNL5/PL4XHWj9n++OulKse93faSlD+pypR/e4DAS9oMgj57g7HGrofR
 9q7M2PO6SF2uWuNc6sE5Y8gy7Xd5XSEMtFiuJWtaIbkZUeHEjL1yvMDNtEsf8JLcpwQkUdSI67b
 q+XhluEEYYPJnJ0ydLV139x+9LR64Pe5yvD6S9qO7fGcv3O0uR5sXYdumi6My9m4e4qO2gHGt4x
 ZD/jxwTw6JQVUVuxMwZnIjgNPlZBhXRdWK0s4WF/9vquOrPBnelLHLXqzxGn6+Z+P55ESm2LU1d
 RGMuFoUZAWo1nFeOQZmssFS+YTgD1v182VqFlN6UJSnHwgBZseo5w8VUbedlvRoKnlWYIaWdfEg
 HyuPPRttgx5CaHk0fuPtqLfutlC20kwOM2DzlA/6z468YfTJ8bTPkXGgo/5J4RRIp5q2+unTW3l
 elMRZx8VKHPZPhU8EcQbTzTpxGds5H+YA==
X-Google-Smtp-Source: AGHT+IF1SkeRQDCfZd/lCnYh4vJVi85V8WE8gXj8o62jtG1NRCTrnkKfAST4/TAdioOXucANSrjLBQ==
X-Received: by 2002:a17:907:dab:b0:b87:322d:a8c0 with SMTP id
 a640c23a62f3a-b87322da9ebmr4499966b.45.1768220824642; 
 Mon, 12 Jan 2026 04:27:04 -0800 (PST)
Received: from pro4 (p200300e0b7206c00f83d4e38e5923d55.dip0.t-ipconnect.de.
 [2003:e0:b720:6c00:f83d:4e38:e592:3d55])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-b871b5e60dasm284687666b.63.2026.01.12.04.27.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Jan 2026 04:27:04 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: =?utf-8?Q?St=C3=A9phane?= Marks <shipmints@HIDDEN>
Subject: Re: bug#80094: 31.0.50; [PATCH] Emacs executable unusable with
 --disable-ns-self-contained and --with-native-compilation
In-Reply-To: <CAN+1HbomAcBXaYcR_8HGhBGzf8i8_o5aARc07zsVD9Dig2TbpA@HIDDEN>
References: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN>
 <86v7h98zd7.fsf@HIDDEN> <87fr8bnjd6.GNU's_not_UNIX!-yavor@HIDDEN>
 <CAN+1HbomAcBXaYcR_8HGhBGzf8i8_o5aARc07zsVD9Dig2TbpA@HIDDEN>
Date: Mon, 12 Jan 2026 13:27:03 +0100
Message-ID: <m24ior584o.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 80094
Cc: 80094 <at> debbugs.gnu.org, Yavor Doganov <yavor@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, Alan Third <alan@HIDDEN>
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: -1.0 (-)

St=C3=A9phane Marks <shipmints@HIDDEN> writes:

> On Mon, Jan 12, 2026 at 6:48=E2=80=AFAM Yavor Doganov <yavor@HIDDEN> wro=
te:
>
>  On Sat, 10 Jan 2026 13:45:56 +0200,
>  Eli Zaretskii wrote:
>  > > From: Yavor Doganov <yavor@HIDDEN>
>  > > Starting the executable from the app bundle results in:
>  > >=20
>  > > $ /usr/local/lib/GNUstep/Applications/Emacs.app/Emacs -Q
>  > > Error using execdir /usr/local/lib/GNUstep/Applications/Emacs.app/:
>  > > emacs:
>  /usr/local/lib/GNUstep/Applications/Emacs.app/../native-lisp/31.0.50-90d=
61443/preloaded/window-0d1b8b93-2d794cce.eln:
>  cannot open shared object file: No such file or directory
>  >
>  > I have nothing against installing something like this, although I'd
>  > prefer not to define unneeded variables like emacs_in_bundle, and
>  > instead have all the bundle-related code under a preprocessor
>  > conditional.
>
>  Revised patch attached (I hope I understood you correctly).
>
>  Gerd M=C3=B6llmann wrote:
>  > I've never seen an OSX/macOS app not using an aoo bundle.
>
>  The NS port is always using the app bundle, both on macOS and GNUstep.
>
> Not "always."  On macOS, I run my emacs from the src directory and do not=
 explicitly disable the bundle.  I run configure with no
> arguments (unless making a debug build).

Which is, BTW, only possible because of=20

nsterm.m:
 6397   if ([NSApp activationPolicy] =3D=3D NSApplicationActivationPolicyPr=
ohibited) {
 6398     /* Set the app's activation policy to regular when we run outside
 6399        of a bundle.  This is already done for us by Info.plist when we
 6400        run inside a bundle.  */
 6401     [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
 6402     [NSApp setApplicationIconImage:
 6403              [EmacsImage
 6404                allocInitFromFile:
 6405                  build_string("icons/hicolor/128x128/apps/emacs.png")=
]];
 6406   }





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

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


Received: (at 80094) by debbugs.gnu.org; 12 Jan 2026 12:17:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 12 07:17:48 2026
Received: from localhost ([127.0.0.1]:60229 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vfGrj-00060z-NY
	for submit <at> debbugs.gnu.org; Mon, 12 Jan 2026 07:17:48 -0500
Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]:43437)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1vfGrg-00060p-IO
 for 80094 <at> debbugs.gnu.org; Mon, 12 Jan 2026 07:17:45 -0500
Received: by mail-ej1-x641.google.com with SMTP id
 a640c23a62f3a-b87003e998bso236491466b.1
 for <80094 <at> debbugs.gnu.org>; Mon, 12 Jan 2026 04:17:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1768220263; x=1768825063; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=nbpUK8u1LezZVM+9+YxgfKxKixG3RMhu6ElDzM8muL0=;
 b=MgLexAZk8y8yvF+dZv30bacgLl0gbkKAnfW5aHlWxYoTXGmjVc2y/RxSThf+nFezlJ
 9Giu8+jzfrYnO5aOzvob2rFRx1yhDH/0Gp9OXbTGAIJ8/1gmAnIxgIvmXQAy3YdYKSdR
 6+TJiRDRCR3nIzsWIOb1Z05brf8ocwD9xJRHgmylz2sUHZAEW6bTr4U8Lct/ammmR+UA
 ZoaafXrbPVGu4BXpacovzAnwNzvm+ZjYCJIZtzIYvJ1uv7kIIKLkp95UsdOiU0kNNWAU
 oISZurIficfLZ4CzQXPMtxTy77k8hPMnnCiW55NDmkebLF0dyp7rXwqQ/K5gr5ME8Dxy
 nN1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1768220263; x=1768825063;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=nbpUK8u1LezZVM+9+YxgfKxKixG3RMhu6ElDzM8muL0=;
 b=dtk0YY0Bn/N2F2tShJAW0jdJrb7aE2b1IQRqkKb0NiVP7HEucNC7XSG3KFZ8104SUN
 4ubtNMbTPHjFwKAZmRnxyL4QJAbcaGW+IhSywE3ZPWTKklb0e3caW85PhtFN2KjZWdpN
 uc/cwUl9ibQQQrthftTicy63IvBR6oRwTofliMtNOkhK4Gj3kobRepJCCZvDBtVeBCTF
 fIY7S5jRj6cxy71UEnjasgFFHwDVFKU88xRdofaMfErYmg6DCw84yAo0zgxh+/4oz1tV
 aM2fMtzcYmtDZxGTjgrZejsQK5/AA/LS4ekt/s5nrVkrs7RBsx5dpt3gnPaF0PQa8EhD
 DfQQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCWQSWVspVTwYIkpTpumIA7KGWkyQhD8s0ms9noSSzW1jV32QB/+48I1I9SIOq7ai0R58DlRmQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyXFjF1qvLUwJu6TFdww9ZN8CHnpF65MjuRV0qGD3YClaYtuIOQ
 Z77C92RxXURkzSHIbhFvi14mhUpAhEsnLk0NX7Wlo34JNS8yqn1to44hfSLiVBF6BiU=
X-Gm-Gg: AY/fxX495bjMPo56PtcN9Q3vK/TSXNP+Zn8/pOBILDHqTcwE8/WuYEE/QgvmIaSd/Rx
 XZI+HtAWYZlMOqODrgCHdJWFnLzaHXPbm553XvFJ8K/aVSp8NR2/7Qe4iK0QNyW6ZaJtjmtQbhd
 0OdAbutBhBVN0vumawT02S2HQ1Hvts4Ev6KI/7pfXzb4UboagnAOAlftgj9MW8qFMqXUVkzqPkT
 q0qbf/XvaqfS/LAvcLLrK2rl5UL+J0uutAVMNO5Xx9e5hr+sAzLLcpDAnUGT+i4CzldIrvlHEVr
 7zAuJyNshFjGWt2Ny86JvGS/YIt58bnX5PoM8WISy1kw+rfneQNzteU0Suxm/0t/fTFZrnDTTI2
 OE4PQ8a8gntVqlCzEXBQO5qXemY3ZPaAlsKRq4l5UUAlIBi+vT8GIIuKAo+p3b346OHezCKb07x
 I+tO8Vq+Sb4I2II74jeqzXhYrooen99h9K5lVxcZ3jDTwRDzeOtOOAlNxipGy9O+NfHfsDKgLip
 fmEoYgk+WVEepbZHNgmGZ0=
X-Google-Smtp-Source: AGHT+IEziffBdpP5dskeo6vJBQC8px3qjGnIXoeEqQ2Gf+SGdbWuQNkmzH8CFS9oi7+yLM6YTP0UkQ==
X-Received: by 2002:a17:907:8dc3:b0:b87:1755:99da with SMTP id
 a640c23a62f3a-b8717559b97mr317608166b.9.1768220262520; 
 Mon, 12 Jan 2026 04:17:42 -0800 (PST)
Received: from pro4 (p200300e0b7206c00f83d4e38e5923d55.dip0.t-ipconnect.de.
 [2003:e0:b720:6c00:f83d:4e38:e592:3d55])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-b8713416418sm396064966b.49.2026.01.12.04.17.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Jan 2026 04:17:42 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Yavor Doganov <yavor@HIDDEN>
Subject: Re: bug#80094: 31.0.50; [PATCH] Emacs executable unusable with
 --disable-ns-self-contained and --with-native-compilation
In-Reply-To: <87fr8bnjd6.GNU's_not_UNIX!-yavor@HIDDEN>
References: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN>
 <86v7h98zd7.fsf@HIDDEN> <87fr8bnjd6.GNU's_not_UNIX!-yavor@HIDDEN>
Date: Mon, 12 Jan 2026 13:17:41 +0100
Message-ID: <m28qe358ka.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 80094
Cc: 80094 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Alan Third <alan@HIDDEN>
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: -1.0 (-)

Yavor Doganov <yavor@HIDDEN> writes:

> On Sat, 10 Jan 2026 13:45:56 +0200,
> Eli Zaretskii wrote:
>> > From: Yavor Doganov <yavor@HIDDEN>
>> > Starting the executable from the app bundle results in:
>> >=20
>> > $ /usr/local/lib/GNUstep/Applications/Emacs.app/Emacs -Q
>> > Error using execdir /usr/local/lib/GNUstep/Applications/Emacs.app/:
>> > emacs: /usr/local/lib/GNUstep/Applications/Emacs.app/../native-lisp/31=
.0.50-90d61443/preloaded/window-0d1b8b93-2d794cce.eln: cannot open shared o=
bject file: No such file or directory
>>
>> I have nothing against installing something like this, although I'd
>> prefer not to define unneeded variables like emacs_in_bundle, and
>> instead have all the bundle-related code under a preprocessor
>> conditional.
>
> Revised patch attached (I hope I understood you correctly).
>
> Gerd M=C3=B6llmann wrote:
>> I've never seen an OSX/macOS app not using an aoo bundle.
>
> The NS port is always using the app bundle, both on macOS and GNUstep.
>
> The configure option --disable-ns-self-contained creates a barebone
> app bundle containing only the Emacs executable, the app icon and the
> .plist file.  All other files are installed in the standard
> directories as per the GCS, relevant to the specified --prefix.
>
> I don't know whether this option makes sense on macOS but on some
> GNU/Linux distros it is a must because common files (whether
> architecture-independent or not) are shared among different Emacs
> flavors built from the same source package (P/GTK, Lucid, NS, etc).

Thanks. I should probably have written "normal" app bundle or something.
The other one I've never seen used on macOS/OSX.




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

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


Received: (at 80094) by debbugs.gnu.org; 12 Jan 2026 11:55:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 12 06:55:11 2026
Received: from localhost ([127.0.0.1]:60201 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vfGVr-0004zR-75
	for submit <at> debbugs.gnu.org; Mon, 12 Jan 2026 06:55:11 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:38004)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yavor@HIDDEN>) id 1vfGVo-0004xe-Uh
 for 80094 <at> debbugs.gnu.org; Mon, 12 Jan 2026 06:55:09 -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 <yavor@HIDDEN>)
 id 1vfGVi-0005oA-QX; Mon, 12 Jan 2026 06:55:02 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Subject:To:From:
 Date; bh=TwP7lxoo6FAEYJCKYkQQKMfU0efylvzTxAZ/1zxo428=; b=r8gvXAIcrubXQb9WQKy4
 7lKADtY1FwS88EzaABbq5jB6r7Qn4jvVAXQX09OYZluqxWkWCM4uma72DKwTEDsKWQDB+c7hqbXgO
 nGak3u0/eXtFWZ5O4lo8LdVmC7MlDPuDkqLgFD5ZItgT+iKwQVs3APnHcDYTfPb0HDTUDnVfQth/0
 NKK4jLmrk5eE0Hx2YUPo443l/yC9URbmX5YEoWluFD4O0gYUOqZXX9F9lHpXc071/W5mbiIEL0ZbM
 b7OvzzVTIFQH089WL8v0Aw04ftidAftZycwgXCxsfRfYrsBCAsKc+yYt25xxU6EZemGfDX+urCFuz
 3kgAZ63BMEQfpw==;
Date: Mon, 12 Jan 2026 13:54:58 +0200
Message-ID: <87ecnvnizx.GNU's_not_UNIX!-yavor@HIDDEN>
From: Yavor Doganov <yavor@HIDDEN>
To: Alan Third <alan@HIDDEN>, Yavor Doganov <yavor@HIDDEN>,
 80094 <at> debbugs.gnu.org, eliz@HIDDEN
Subject: Re: bug#80094: 31.0.50;
 [PATCH] Emacs executable unusable with --disable-ns-self-contained
 and --with-native-compilation
In-Reply-To: <aWJXAxkQ8XErvsCh@HIDDEN>
References: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN>
 <aWJXAxkQ8XErvsCh@HIDDEN>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
 FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.2
 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
Organization: The GNU Emacs Church (Bulgarian Eparchy)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset=US-ASCII
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 80094
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 (---)

On Sat, 10 Jan 2026 15:41:23 +0200,
Alan Third wrote:
> I can't really remember how any of this works now, but if you haven't
> already, it might be worth your while looking into ns_relocate in
> nsterm.m and the epaths.h file, which IIRC is generated by configure
> or make. I know there's something somewhere that edits the paths for
> NS, but I can't find it right now.

I looked at ns_relocate when I encountered this issue.  It does its
job fine but only for the NS_SELF_CONTAINED case.

> FWIW, I believe this sort of behaviour is supported on macOS too,
> there's a comment in one of the NS port readme files about it.

I also think it's supported although apparently not used very much.




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

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


Received: (at 80094) by debbugs.gnu.org; 12 Jan 2026 11:52:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 12 06:52:47 2026
Received: from localhost ([127.0.0.1]:60195 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vfGTX-0004sw-FD
	for submit <at> debbugs.gnu.org; Mon, 12 Jan 2026 06:52:47 -0500
Received: from mail-vs1-xe29.google.com ([2607:f8b0:4864:20::e29]:43251)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1vfGTV-0004sk-SK
 for 80094 <at> debbugs.gnu.org; Mon, 12 Jan 2026 06:52:46 -0500
Received: by mail-vs1-xe29.google.com with SMTP id
 ada2fe7eead31-5ef31a77afbso2064136137.0
 for <80094 <at> debbugs.gnu.org>; Mon, 12 Jan 2026 03:52:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1768218765; x=1768823565; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=RNhjHGQPlIcJEWayyHykgmYO1tr0dgOs98juF2nCFiU=;
 b=W5eXe3Pej7LnuoIbWCZsCAkGYbaAOrmNp8gsMyju7bX2VQKRDVP+jzHdjEg9C4dXzp
 pEIhNekKVT5wy0+LP0AiowVWcYm7G1qbirkfWwOX4HmgdSKppNo7EsXkJmQaVrPSBur7
 tBQ4RXjiF401oWdXnHhnTmtpViacLtJsRCApawNOzd/fQjDfCu1rtyFz6ytcE6qkmDqK
 Sy+L11s8c9QfCBGOmgOOiB7+UijeEjAV6zXLYv3wDNXE4c5uz/gPv+HFPb77bMJ3FdhN
 DYHfnFvioKlEZLQ2CzU3hCIXDsYE2kpj1wiy7+SQ3n5KY3M4fsz0+KyrrlVh7jHxpxJr
 AZPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1768218765; x=1768823565;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=RNhjHGQPlIcJEWayyHykgmYO1tr0dgOs98juF2nCFiU=;
 b=Qf8jEr59u6mi/6Bph9TlJimZNJiEcuCIsc1XMXsiSvSuAbBGdXVHbEa1+IhfToPTg8
 hN2z92Oo+EwtYaHjZjQsInMZXmNH0mgpTUN/+OCmyxKfbdgwTgukmiF8AqzCjAhh1fwL
 7Ys+f+og3lPRL60Y+zC2Nnw3WI6DqDrMDrPURRUiqbeWQShMysvHMt/iorpOnGkQ+UBf
 shUCYgsdsMjmD7fJIR4Wxh2XBlLNu8uQWnhSenwurF7GWOM6KrO3j9EjC81T941+P9tj
 7aphrbCuidbgswkBlYP2Zpou9ArxSoJsu5WivyrBSqsqJ2ecBT8r3F6+UCN4Evcj/wA5
 168A==
X-Forwarded-Encrypted: i=1;
 AJvYcCU5dqE74cUbhGpvR4q4KcXB6sHPZTDoRJ03h+V7NOB58BjhpbihuTsoa9U9xwRrC0gGaajm3w==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyRcvKnPjYTJ0O9dCIUdl7tVZr3bQU7ainYEgtOdaI/XsR18Sf/
 p6cJFEL52DhY+BIBS/DHEiHEupHMHLHyQIeeYDq7dN5LDgGQwxDIlAAM8wrUSHEg5kKZfY4HaOL
 fWw0q87y1QNKd+ttixbAT3Ww/Qdenrvk=
X-Gm-Gg: AY/fxX6KkmKNhl3uJ0jtEk+vp20S1RTENzwL7OhtRI9g4TUkkqvd4utmh/d5q8r3WCN
 2Is+gkV0bMg+Gnw8R3o5huyT7pyBsRs1LTSaqvaRVtHDS7A3sJWhDmwECA0UHp/ahBeJNB/PYKx
 vfCpLDWQIxIt9l3yTt1XP/n7mmjRRq+bq+eYPJ/lJfKV6F9TE/qTsAeySUBGEK9zrx6njWP/BZw
 2Gd32d6cwnAA8KV6N4C+bMc0fAad7DMPXp6gPvnTZKU7+JTjeiBDYYL4l0JSkyU5pXbB9E=
X-Google-Smtp-Source: AGHT+IF6xLCzR8cW7jsrt9sEMPDVBxx+gIU/+crTlVqjTXv5rXBX4qWfYNdK4vSBjQJ3xEaIWrUuBdgxlIMJVYx0dWg=
X-Received: by 2002:a05:6102:f0d:b0:5ef:a312:e70c with SMTP id
 ada2fe7eead31-5efa312eaa9mr3907380137.20.1768218765091; Mon, 12 Jan 2026
 03:52:45 -0800 (PST)
MIME-Version: 1.0
References: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN> <86v7h98zd7.fsf@HIDDEN>
 <87fr8bnjd6.GNU's_not_UNIX!-yavor@HIDDEN>
In-Reply-To: <87fr8bnjd6.GNU's_not_UNIX!-yavor@HIDDEN>
From: =?UTF-8?Q?St=C3=A9phane_Marks?= <shipmints@HIDDEN>
Date: Mon, 12 Jan 2026 06:52:33 -0500
X-Gm-Features: AZwV_QivcDDxb9K2mh0jC83KacHBAmxDL-sonEiXuBdV6coh5FkuQ7VAubTKM_U
Message-ID: <CAN+1HbomAcBXaYcR_8HGhBGzf8i8_o5aARc07zsVD9Dig2TbpA@HIDDEN>
Subject: Re: bug#80094: 31.0.50; [PATCH] Emacs executable unusable with
 --disable-ns-self-contained and --with-native-compilation
To: Yavor Doganov <yavor@HIDDEN>
Content-Type: multipart/alternative; boundary="00000000000060e88006482f8345"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 80094
Cc: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>,
 80094 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Alan Third <alan@HIDDEN>
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: -1.0 (-)

--00000000000060e88006482f8345
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Jan 12, 2026 at 6:48=E2=80=AFAM Yavor Doganov <yavor@HIDDEN> wrote=
:

> On Sat, 10 Jan 2026 13:45:56 +0200,
> Eli Zaretskii wrote:
> > > From: Yavor Doganov <yavor@HIDDEN>
> > > Starting the executable from the app bundle results in:
> > >
> > > $ /usr/local/lib/GNUstep/Applications/Emacs.app/Emacs -Q
> > > Error using execdir /usr/local/lib/GNUstep/Applications/Emacs.app/:
> > > emacs:
> /usr/local/lib/GNUstep/Applications/Emacs.app/../native-lisp/31.0.50-90d6=
1443/preloaded/window-0d1b8b93-2d794cce.eln:
> cannot open shared object file: No such file or directory
> >
> > I have nothing against installing something like this, although I'd
> > prefer not to define unneeded variables like emacs_in_bundle, and
> > instead have all the bundle-related code under a preprocessor
> > conditional.
>
> Revised patch attached (I hope I understood you correctly).
>
> Gerd M=C3=B6llmann wrote:
> > I've never seen an OSX/macOS app not using an aoo bundle.
>
> The NS port is always using the app bundle, both on macOS and GNUstep.
>

Not "always."  On macOS, I run my emacs from the src directory and do not
explicitly disable the bundle.  I run configure with no arguments (unless
making a debug build).

--00000000000060e88006482f8345
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">=
On Mon, Jan 12, 2026 at 6:48=E2=80=AFAM Yavor Doganov &lt;<a href=3D"mailto=
:yavor@HIDDEN">yavor@HIDDEN</a>&gt; wrote:</span></div></div><div class=
=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">On Sat, 10 Jan 2026 13:45:56 +0200,<br>
Eli Zaretskii wrote:<br>
&gt; &gt; From: Yavor Doganov &lt;<a href=3D"mailto:yavor@HIDDEN" target=
=3D"_blank">yavor@HIDDEN</a>&gt;<br>
&gt; &gt; Starting the executable from the app bundle results in:<br>
&gt; &gt; <br>
&gt; &gt; $ /usr/local/lib/GNUstep/Applications/Emacs.app/Emacs -Q<br>
&gt; &gt; Error using execdir /usr/local/lib/GNUstep/Applications/Emacs.app=
/:<br>
&gt; &gt; emacs: /usr/local/lib/GNUstep/Applications/Emacs.app/../native-li=
sp/31.0.50-90d61443/preloaded/window-0d1b8b93-2d794cce.eln: cannot open sha=
red object file: No such file or directory<br>
&gt;<br>
&gt; I have nothing against installing something like this, although I&#39;=
d<br>
&gt; prefer not to define unneeded variables like emacs_in_bundle, and<br>
&gt; instead have all the bundle-related code under a preprocessor<br>
&gt; conditional.<br>
<br>
Revised patch attached (I hope I understood you correctly).<br>
<br>
Gerd M=C3=B6llmann wrote:<br>
&gt; I&#39;ve never seen an OSX/macOS app not using an aoo bundle.<br>
<br>
The NS port is always using the app bundle, both on macOS and GNUstep.<br><=
/blockquote><div><br></div><div><div class=3D"gmail_default" style=3D"font-=
family:monospace">Not=C2=A0&quot;always.&quot;=C2=A0 On macOS, I run my ema=
cs from the src directory and do not explicitly disable the bundle.=C2=A0 I=
 run configure with=C2=A0no arguments (unless making a debug build).</div><=
/div></div></div>

--00000000000060e88006482f8345--




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

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


Received: (at 80094) by debbugs.gnu.org; 12 Jan 2026 11:47:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 12 06:47:18 2026
Received: from localhost ([127.0.0.1]:60184 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vfGOE-0004es-1c
	for submit <at> debbugs.gnu.org; Mon, 12 Jan 2026 06:47:18 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:38004)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yavor@HIDDEN>) id 1vfGOB-0004ef-A2
 for 80094 <at> debbugs.gnu.org; Mon, 12 Jan 2026 06:47:16 -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 <yavor@HIDDEN>)
 id 1vfGO5-000541-8c; Mon, 12 Jan 2026 06:47:09 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Subject:To:From:
 Date; bh=fGpZVpUHmldMk6OjVfWUMpJQBjhjWslQQl6SLIYTGHE=; b=gN3QaLEJF8MpB8cpAmCd
 TPj06pUUw2nkwWteNTfW9Tldb96w6f1IeySOPNgU0nP8U7EK+stnTv8xCLchJ4e8YZpTuEPScE02i
 Z1jkYPgZiEGjru9JOSaIHC+JqdNAVuEd1JJWuvKlhhAuev0ZstYKhRjHHn3FYDrlL8I+LmuYBHDhO
 XISfwHVsZsNKJ1ZqaXE7LvgjRSVnrGO8IFqJ6/lZToGwVPaeljioRD/AjvojTKMwkhj8phzc8pfUz
 X7vmqIQ68TjSY6SsoKDpEJxQnkH52V9+5yFzH4o1mIyf2fYb3DBuETKAWyopnF16n5y+xWHBYy72j
 h+OmclKhnrmWFQ==;
Date: Mon, 12 Jan 2026 13:47:01 +0200
Message-ID: <87fr8bnjd6.GNU's_not_UNIX!-yavor@HIDDEN>
From: Yavor Doganov <yavor@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#80094: 31.0.50;
 [PATCH] Emacs executable unusable with --disable-ns-self-contained
 and --with-native-compilation
In-Reply-To: <86v7h98zd7.fsf@HIDDEN>
References: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN> <86v7h98zd7.fsf@HIDDEN>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
 FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.2
 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
Organization: The GNU Emacs Church (Bulgarian Eparchy)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: multipart/mixed; boundary="Multipart_Mon_Jan_12_13:47:01_2026-1"
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 80094
Cc: Gerd =?UTF-8?B?TcO2bGxtYW5u?= <gerd.moellmann@HIDDEN>,
 80094 <at> debbugs.gnu.org, Yavor Doganov <yavor@HIDDEN>,
 Alan Third <alan@HIDDEN>
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 (---)

--Multipart_Mon_Jan_12_13:47:01_2026-1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On Sat, 10 Jan 2026 13:45:56 +0200,
Eli Zaretskii wrote:
> > From: Yavor Doganov <yavor@HIDDEN>
> > Starting the executable from the app bundle results in:
> > 
> > $ /usr/local/lib/GNUstep/Applications/Emacs.app/Emacs -Q
> > Error using execdir /usr/local/lib/GNUstep/Applications/Emacs.app/:
> > emacs: /usr/local/lib/GNUstep/Applications/Emacs.app/../native-lisp/31.0.50-90d61443/preloaded/window-0d1b8b93-2d794cce.eln: cannot open shared object file: No such file or directory
>
> I have nothing against installing something like this, although I'd
> prefer not to define unneeded variables like emacs_in_bundle, and
> instead have all the bundle-related code under a preprocessor
> conditional.

Revised patch attached (I hope I understood you correctly).

Gerd Möllmann wrote:
> I've never seen an OSX/macOS app not using an aoo bundle.

The NS port is always using the app bundle, both on macOS and GNUstep.

The configure option --disable-ns-self-contained creates a barebone
app bundle containing only the Emacs executable, the app icon and the
.plist file.  All other files are installed in the standard
directories as per the GCS, relevant to the specified --prefix.

I don't know whether this option makes sense on macOS but on some
GNU/Linux distros it is a must because common files (whether
architecture-independent or not) are shared among different Emacs
flavors built from the same source package (P/GTK, Lucid, NS, etc).

--Multipart_Mon_Jan_12_13:47:01_2026-1
Content-Type: text/plain; type=patch; charset=US-ASCII
Content-Disposition: attachment; filename="0001-NS-Fix-startup-with-HAVE_NATIVE_COMP-NS_SELF_CONTAIN.patch"
Content-Transfer-Encoding: 8bit

From 4f018efda3d1f995772adbb4b671a280cde6c439 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor@HIDDEN>
Date: Mon, 12 Jan 2026 12:51:11 +0200
Subject: [PATCH] NS: Fix startup with HAVE_NATIVE_COMP && !NS_SELF_CONTAINED
 (Bug#80094)

* src/pdumper.c (pdumper_set_emacs_execdir): Add workaround for
!NS_SELF_CONTAINED so that launching Emacs from the app bundle
works flawlessly when built with native compilation.
* configure.ac: Define BINDIR.
* src/conf_post.h: Define NS_BUNDLED conditionally.
---
 configure.ac    |  3 +++
 src/conf_post.h |  6 ++++++
 src/pdumper.c   | 22 +++++++++++++++++-----
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5be2588600d..0c1c1e2d789 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7200,6 +7200,9 @@ AC_DEFUN
 AC_SUBST([GNU_OBJC_CFLAGS])
 AC_SUBST([OTHER_FILES])
 
+AS_IF([test $prefix = "NONE"], [_prefix=/usr/local], [_prefix=$prefix])
+AC_DEFINE_UNQUOTED([BINDIR], ["${_prefix}/bin/"], [Executables directory.])
+
 if test -n "${term_header}"; then
     AC_DEFINE_UNQUOTED([TERM_HEADER], ["${term_header}"],
         [Define to the header for the built-in window system.])
diff --git a/src/conf_post.h b/src/conf_post.h
index 826face9f74..a2edfdd7073 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -61,6 +61,12 @@ Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2026 Free Software
 typedef bool bool_bf;
 #endif
 
+#if HAVE_NS && !NS_SELF_CONTAINED
+#define NS_BUNDLED "Emacs"
+#else
+#define NS_BUNDLED ""
+#endif
+
 /* A substitute for __has_attribute on compilers that lack it.
    It is used only on arguments like cleanup that are handled here.
    This macro should be used only in #if expressions, as Oracle
diff --git a/src/pdumper.c b/src/pdumper.c
index 6ab350fb2dd..d0479b19b3f 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -5648,11 +5648,23 @@ pdumper_set_emacs_execdir (char *emacs_executable)
 	 && !IS_DIRECTORY_SEP (p[-1]))
     --p;
   eassert (p > emacs_executable);
-  emacs_execdir = xpalloc (emacs_execdir, &execdir_size,
-			   p - emacs_executable + 1 - execdir_size, -1, 1);
-  memcpy (emacs_execdir, emacs_executable, p - emacs_executable);
-  execdir_len = p - emacs_executable;
-  emacs_execdir[execdir_len] = '\0';
+
+  if (strcmp (basename (emacs_executable), NS_BUNDLED))
+    {
+      emacs_execdir = xpalloc (emacs_execdir, &execdir_size,
+			       p - emacs_executable + 1 - execdir_size, -1, 1);
+      memcpy (emacs_execdir, emacs_executable, p - emacs_executable);
+      execdir_len = p - emacs_executable;
+      emacs_execdir[execdir_len] = '\0';
+    }
+  else
+    {
+      /* This is the Emacs executable from the non-self-contained app
+	 bundle which can be anywhere on the system.  Fortunately, the
+	 location of the lisp resources is known.  */
+      emacs_execdir = (char *) BINDIR;
+      execdir_len = strlen (BINDIR);
+    }
 }
 #endif
 
-- 
2.51.0


--Multipart_Mon_Jan_12_13:47:01_2026-1--




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

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


Received: (at 80094) by debbugs.gnu.org; 10 Jan 2026 13:41:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 10 08:41:34 2026
Received: from localhost ([127.0.0.1]:55861 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1veZDh-0008JX-Rw
	for submit <at> debbugs.gnu.org; Sat, 10 Jan 2026 08:41:34 -0500
Received: from dane.soverin.net ([185.233.34.11]:43197)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <alan@HIDDEN>) id 1veZDe-0008JE-Ts
 for 80094 <at> debbugs.gnu.org; Sat, 10 Jan 2026 08:41:31 -0500
Received: from smtp.soverin.net (unknown [10.10.4.100])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by dane.soverin.net (Postfix) with ESMTPS id 4dpKYJ4spKz1Sxp;
 Sat, 10 Jan 2026 13:41:24 +0000 (UTC)
Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.100]) by
 soverin.net (Postfix) with ESMTPSA id 4dpKYJ2qB2zJM; 
 Sat, 10 Jan 2026 13:41:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin;
 t=1768052484; bh=T4dADIw1Z49M+fTTKoiPpwUmDS4PchCbQXGu21p0c5Q=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
 b=onGp7N3sm4WQH6iV9s+oi26kgxSaD0ChpFTMc7qnHimhSIel+VEEF5MlEBvFi6I6m
 Te5PtyG5xwizyrX90OlcJ+whlMtlrG8DTez/Fc9BKwxygoxOHJDenepfm2K3rzodvp
 zlVVMTm8kuEEu4sb2TjoczEymx7uZlfQi8aC5rP+SLkEdt8VRXf5G9pZUrgbM27SsM
 jcxihBIURkG+h7Fbi1vY/wTGAg382O+kdUlnquN0unMrUnn4PAyDar74KOFDOb8nJD
 8XbI/DAcUFCxZtkwzLaZRLHeLZuiE1AjqQo8w1IoxYPpgnVrAZ+3bfZyA6fTqlEqMS
 NrJRoL0lCT7Pw==
X-CM-Envelope: MS4xfKSPzotOKu1uOKkZ5b2Oo+MM6XVsvwR40T3pDCHH3RIsA9ZfR5DfigjicBF1o8dhlsuQj3IJ85Mj5/8q/Njff9JOCYdoGAxBNDz7fo5w4if0rgjh5Kjy
 hl+f4pAyw6oRpC8EBHPn9YRyzhqDZoq4eKTIUZiouUePSgJ27F6qyDcT/SHMqHs8+xWHOhv2ua//2LycW05J/dVkwxgMtMKbb7Tc82VKAWmis91bN9EgdyAV
 PQkDNMCebppE1d7iObITow==
X-Soverin-Id: 019ba823-e7a0-7a1b-b669-739472f94923
Received: from localhost (namib [local])
 by namib (OpenSMTPD) with ESMTPA id 5a160a78;
 Sat, 10 Jan 2026 13:41:24 +0000 (UTC)
Date: Sat, 10 Jan 2026 13:41:23 +0000
From: Alan Third <alan@HIDDEN>
To: Yavor Doganov <yavor@HIDDEN>
Subject: Re: bug#80094: 31.0.50; [PATCH] Emacs executable unusable with
 --disable-ns-self-contained and --with-native-compilation
Message-ID: <aWJXAxkQ8XErvsCh@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>,
 Yavor Doganov <yavor@HIDDEN>, 80094 <at> debbugs.gnu.org
References: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN>
X-Spampanel-Class: ham
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 80094
Cc: 80094 <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: -1.0 (-)

On Mon, Dec 29, 2025 at 04:33:04PM +0200, Yavor Doganov wrote:
> The build process creates two identical executables: src/emacs, which
> "make install" installs in bindir, and nextstep/Emacs.app/Emacs, which
> the user is supposed to move manually (taking into account that the
> app bundle is not self-contained).
>
<snip>
>
> I'm willing to rework the patch and do the required testing if there's
> a better way to address this problem; just let me know.

I can't really remember how any of this works now, but if you haven't
already, it might be worth your while looking into ns_relocate in
nsterm.m and the epaths.h file, which IIRC is generated by configure
or make. I know there's something somewhere that edits the paths for
NS, but I can't find it right now.

FWIW, I believe this sort of behaviour is supported on macOS too,
there's a comment in one of the NS port readme files about it.
-- 
Alan Third




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

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


Received: (at 80094) by debbugs.gnu.org; 10 Jan 2026 12:25:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 10 07:25:38 2026
Received: from localhost ([127.0.0.1]:55547 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1veY2E-0001rF-2Y
	for submit <at> debbugs.gnu.org; Sat, 10 Jan 2026 07:25:38 -0500
Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:57577)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1veY2C-0001r4-8Z
 for 80094 <at> debbugs.gnu.org; Sat, 10 Jan 2026 07:25:37 -0500
Received: by mail-wr1-x443.google.com with SMTP id
 ffacd0b85a97d-42fb2314eb0so4092694f8f.2
 for <80094 <at> debbugs.gnu.org>; Sat, 10 Jan 2026 04:25:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1768047934; x=1768652734; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=6LVmsZMHAsIqYnGWau/dUpGVnnepBhHZbLZTE6VpzEs=;
 b=bILLEmTZ9GpiZWsw5trXPzT09AKk3KVLMPR5SnxxvfBACyT5RFiswCI3EyyNTHmF2C
 azE7m2zNvput6iBk10MGIf9rTguxXgfr3tpkKs0LaAFIwvaILeOVSVpfC97oONjR2byL
 QOO9h0B4XROTPE5eWwsoAPbiaYV47ISN2f1fng9yJ9hnPpxGnGtXy0TqTdKESZ1a6P6a
 O293uJs2/UXiIOr18FSZ6PgaHFwq3m4gFUWebcY0bPSrQO0eyobGs/KaAheXtps4RwZJ
 eftbw6sQyNR4/nzfSqWm+PxQF/Y+Yp2J2OjXmCPg2XQDKitR2RjRQOn4Z8ptEqWEXg2P
 mp0Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1768047934; x=1768652734;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
 :date:message-id:reply-to;
 bh=6LVmsZMHAsIqYnGWau/dUpGVnnepBhHZbLZTE6VpzEs=;
 b=BHqMUDGyKi9uXlQOFmSm1e2XnDTgjflrYuWGxrt+0cz3iI+vfQ4kfQivrj+t9wx358
 SPZPFzPOqQJhM8CEPIgDfbiJnNT1aHHmQmr0NIwu3uxZ5UAiDlgC/7ohN8VCp39r6c7I
 d7JzHIA8EqwQ1CqVF9eAuGRmvY1S5uu8YfNO+Gyae7Whj389Qa6aE65TS4vLuaJL/EdO
 b6Ptt635hC9xpLr9i1fOd6h4+kS7A/vPi6If2TrJ6RHuHmv6/XSaUNwGE7tUBO5sL0vP
 TvC1I1SvSoaX8ZsQcaefUZ426VVTdar4zNmgHKq7B5LfwDgs6nrWDOLNIUiGirOm6u3E
 S1+A==
X-Forwarded-Encrypted: i=1;
 AJvYcCXXuBubM6Bw/bXjEffpdu2jXXcdjRAPascP7nXuV+xDaKr94ETBCVO0xgwLOygO21/hfFmVbw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzHio1nQlQzsJxGeO5DZIo3j/tTTfsFz/I6jhCGAeKq/C4KVuDF
 oiuICSkkfpl1VSQvtpnQsyXMLXQbkiThwQ9/EQcUzTeVdAxSbZMpRhLwLr+ELfEZGVA=
X-Gm-Gg: AY/fxX64D3PXr4wk+uo73lRY0Pfcsgoqtw3qtnUjGb6uv0gYjewWPzzRmRIOEJycIgQ
 YVPhObUw+ogoA4hJralrGNBd5MflW2xnkq2AFA4amMi4PidN7cr4xEdyCkY4hGmioBWTWU8V4yO
 k9P3cLtSJe4J+YYPmgQwrwggp34CBDzORemfvDXSgLRGieUxh6H4VnKyBx0TnXyAivXuadO9njN
 a6SUyfKyYpTzLm4ANACB2jJZCk09tOoYGP0ZRiBuaV4nhk4iH60Zk3qWVgbmKcCERs+qEJ2E+CK
 YRjbuykRlVniFfzCX/ZC7WqFdlj9fQwVSNFmKpkge1dGqr6QOB5U4NzR4HyPZw60vcXL+Jm3frc
 MWj7MaXlgUuhnUTCtHoU+tO56r4ALUf8JtTmuEcfv8/XxdLDz9/L3WuBqPzkjzp9M7sG19H074n
 mMnf9jL15JYqCvbWhnBLH/IBt3TDlNU5kw5uMDrcdPxz/rlPDDknI7RcfmNILDHDWhBWzVSsV9S
 Wb4ayqH++BUzz+Gcn6qLA==
X-Google-Smtp-Source: AGHT+IHQqVKm1r1h7qayKuCrttadJWvHWnbYKcqFSqlh3wvsesdzASB+j2OyIcekbiCrbH4LCdTvpA==
X-Received: by 2002:a05:6000:2511:b0:431:48f:f78f with SMTP id
 ffacd0b85a97d-432c378a79emr14389227f8f.1.1768047933918; 
 Sat, 10 Jan 2026 04:25:33 -0800 (PST)
Received: from pro4 (p200300e0b710510011649d5bf1eb0bf0.dip0.t-ipconnect.de.
 [2003:e0:b710:5100:1164:9d5b:f1eb:bf0])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-432bd5df939sm27314352f8f.21.2026.01.10.04.25.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 10 Jan 2026 04:25:33 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#80094: 31.0.50; [PATCH] Emacs executable unusable with
 --disable-ns-self-contained and --with-native-compilation
In-Reply-To: <86v7h98zd7.fsf@HIDDEN>
References: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN> <86v7h98zd7.fsf@HIDDEN>
Date: Sat, 10 Jan 2026 13:25:32 +0100
Message-ID: <m2ms2l1woz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 80094
Cc: 80094 <at> debbugs.gnu.org, Yavor Doganov <yavor@HIDDEN>,
 Alan Third <alan@HIDDEN>
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: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> I'm willing to rework the patch and do the required testing if there's
>> a better way to address this problem; just let me know.
>
> I have nothing against installing something like this, although I'd
> prefer not to define unneeded variables like emacs_in_bundle, and
> instead have all the bundle-related code under a preprocessor
> conditional.  But before we install something like that, I'd like
> people who use macOS to review this.  Gerd and Alan, would you please
> take a look and comment?

I'm afraid I can't contribute much. I've never seen an OSX/macOS app not
using an aoo bundle. Until Alan told me, I didn't even know what was
meant with that "self-contained".






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

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


Received: (at 80094) by debbugs.gnu.org; 10 Jan 2026 11:46:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 10 06:46:08 2026
Received: from localhost ([127.0.0.1]:55323 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1veXPz-0008LJ-N5
	for submit <at> debbugs.gnu.org; Sat, 10 Jan 2026 06:46:08 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:41038)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1veXPx-0008KU-I4
 for 80094 <at> debbugs.gnu.org; Sat, 10 Jan 2026 06:46:06 -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 1veXPr-00056p-DE; Sat, 10 Jan 2026 06:45:59 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=HdXNGd/QgfObnmadwdLKq+3aX/MkKPp409s7Ccyh/cY=; b=BfjGTMSMkaCybzYzwxLq
 MQoV0PbXX8YOI/4W5ZmzDSvHn6ToHl5WyuZZbgs5iVUn40VU6WCjJm/422sdrtqXOlfZNLYvHlCqF
 oyxRcg+Vg5pF0+c+CCQjtdAuCQWrxeDoglcLnu+EKkpyvSMxlNboTOY4iuYcEWsTkIHQDVPrGKy37
 WmhJ9ifdYBqT0Bvr+aqCJAk3DRNaTPbUMQV9NAURZH9f30xNc1qN42rrO3L8uSqY7FHz8mYMtdZwv
 zs8/uoA8PgK1y0sGjQRlsfb9JU3WKtc8cpGB3bGKh7s9oJQBrxDY+U90Bg99lqvpw/pBgZjUBLkwy
 aqEXzxPKHY1GCA==;
Date: Sat, 10 Jan 2026 13:45:56 +0200
Message-Id: <86v7h98zd7.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yavor Doganov <yavor@HIDDEN>,
 =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>,
 Alan Third <alan@HIDDEN>
In-Reply-To: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN> (message from Yavor
 Doganov on Mon, 29 Dec 2025 16:33:04 +0200)
Subject: Re: bug#80094: 31.0.50;
 [PATCH] Emacs executable unusable with --disable-ns-self-contained
 and --with-native-compilation
References: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 80094
Cc: 80094 <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 (---)

> Cc: yavor@HIDDEN
> Date: Mon, 29 Dec 2025 16:33:04 +0200
> From: Yavor Doganov <yavor@HIDDEN>
> 
> The build process creates two identical executables: src/emacs, which
> "make install" installs in bindir, and nextstep/Emacs.app/Emacs, which
> the user is supposed to move manually (taking into account that the
> app bundle is not self-contained).
> 
> Using the default prefix (for simplicity):
> 
> $ ./configure --with-ns --disable-ns-self-contained
> $ make
> # make install
> ;; Corresponds to GNUSTEP_LOCAL_APPS when gnustep-make is configured
> ;; with the fhs, debian or debian-multiarch layouts.
> # mkdir -p /usr/local/lib/GNUstep/Applications
> # cp -a nextstep/Emacs.app/ /usr/local/lib/GNUstep/Applications/
> 
> Starting /usr/local/bin/emacs works and it is fully functional, except
> that it doesn't know anything about the app bundle, cannot find its
> (GNUstep) resources and therefore there is no app icon, the .plist
> file is not parsed so the About dialog is empty, there are no GNUstep
> services, etc.
> 
> Starting the executable from the app bundle results in:
> 
> $ /usr/local/lib/GNUstep/Applications/Emacs.app/Emacs -Q
> Error using execdir /usr/local/lib/GNUstep/Applications/Emacs.app/:
> emacs: /usr/local/lib/GNUstep/Applications/Emacs.app/../native-lisp/31.0.50-90d61443/preloaded/window-0d1b8b93-2d794cce.eln: cannot open shared object file: No such file or directory
> 
> Note that some GNUstep users launch GNUstep applications from the
> corresponding GNUSTEP_*_APPS directory in GWorkspace (where app
> bundles appear with their icons and the Resources directory is
> hidden), so it is a valid scenario to attempt to launch Emacs from the
> app bundle.
> 
> Furthermore, gnustep-make (when configured with the layouts enumerated
> above) creates a symlink in bindir pointing to the real executable in
> the app bundle (since there is no point to install two identical
> executables).  So if Emacs is packaged as a GNUstep package, it ought
> to support this as well.
> 
> I have tested the attached (admittedly ugly) patch on Debian with
> Emacs 30.2 for more than a month, where
> 
> 1. prefix=/usr
> 2. /usr/bin/emacs is a symlink managed by dpkg's alternatives system,
>    pointing to /usr/bin/emacs-ns
> 3. /usr/bin/emacs-ns is a symlink pointing to the real executable
>    /usr/lib/x86_64-linux-gnu/GNUstep/Applications/Emacs.app/Emacs
> 4. /usr/lib/x86_64-linux-gnu/GNUstep/Applications/Emacs.app/Resources
>    is a symlink pointing to /usr/share/GNUstep/Emacs.app (because of
>    the FHS requirement to disallow images in /usr/lib)
> 5. Lisp resources, other programs, documentation, etc. come from
>    Debian's dedicated packages emacs-common, emacs-bin-common, etc.
> 
> I'm willing to rework the patch and do the required testing if there's
> a better way to address this problem; just let me know.

I have nothing against installing something like this, although I'd
prefer not to define unneeded variables like emacs_in_bundle, and
instead have all the bundle-related code under a preprocessor
conditional.  But before we install something like that, I'd like
people who use macOS to review this.  Gerd and Alan, would you please
take a look and comment?

TIA




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

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


Received: (at submit) by debbugs.gnu.org; 29 Dec 2025 14:33:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 29 09:33:47 2025
Received: from localhost ([127.0.0.1]:37180 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vaEJe-00068B-MO
	for submit <at> debbugs.gnu.org; Mon, 29 Dec 2025 09:33:47 -0500
Received: from lists.gnu.org ([2001:470:142::17]:56446)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yavor@HIDDEN>) id 1vaEJa-00067o-GP
 for submit <at> debbugs.gnu.org; Mon, 29 Dec 2025 09:33:44 -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 <yavor@HIDDEN>) id 1vaEJR-0000Eq-6D
 for bug-gnu-emacs@HIDDEN; Mon, 29 Dec 2025 09:33:33 -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 <yavor@HIDDEN>) id 1vaEJP-0005Ah-9A
 for bug-gnu-emacs@HIDDEN; Mon, 29 Dec 2025 09:33:31 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Subject:To:From:Date:in-reply-to:
 references; bh=9u7N2Vxp4bqXa0K5AGV6pOhvkz57LHWgIwRI+2pAB+Y=; b=IzFroVZcMsQxZ4
 DHk9CT3ucYuae5uZ2Vmzy/uOIwn7q+8iUx7jeNpMHo5ufkFw2wYAEWF4BiqXh8BsaqdsFYqBrIXDE
 y9BImDOX5qcB/nVN74Jq1p6Rzr8KyLk6xgckHVeLMGUWhZbTAzfO6KL4fPK84mNanBck9krP2Ag/m
 spzzMk+jtF/V9+vya3agvwwJu0YcC/t2Xb04r6r4khDFGP53+FSYk127ZfIo8x8Mk6qME47DUOF3b
 zwMdfzDZToamNn9VbvAu8KnobYaTf1tb11O9pK5gNuogKKQzQh/KvolZ+oC0Iq5/OjFotYcMJkQSi
 3hRcpcELxxWJ5Lbe3bqQ==;
Date: Mon, 29 Dec 2025 16:33:04 +0200
Message-ID: <87a4z1qrxb.GNU's_not_UNIX!-yavor@HIDDEN>
From: Yavor Doganov <yavor@HIDDEN>
To: bug-gnu-emacs@HIDDEN
X-Debbugs-CC: yavor@HIDDEN
Subject: 31.0.50;
 [PATCH] Emacs executable unusable with --disable-ns-self-contained
 and --with-native-compilation
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
 FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.2
 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
Organization: The GNU Emacs Church (Bulgarian Eparchy)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: multipart/mixed; boundary="Multipart_Mon_Dec_29_16:33:03_2025-1"
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
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: -1.0 (-)

--Multipart_Mon_Dec_29_16:33:03_2025-1
Content-Type: text/plain; charset=US-ASCII

The build process creates two identical executables: src/emacs, which
"make install" installs in bindir, and nextstep/Emacs.app/Emacs, which
the user is supposed to move manually (taking into account that the
app bundle is not self-contained).

Using the default prefix (for simplicity):

$ ./configure --with-ns --disable-ns-self-contained
$ make
# make install
;; Corresponds to GNUSTEP_LOCAL_APPS when gnustep-make is configured
;; with the fhs, debian or debian-multiarch layouts.
# mkdir -p /usr/local/lib/GNUstep/Applications
# cp -a nextstep/Emacs.app/ /usr/local/lib/GNUstep/Applications/

Starting /usr/local/bin/emacs works and it is fully functional, except
that it doesn't know anything about the app bundle, cannot find its
(GNUstep) resources and therefore there is no app icon, the .plist
file is not parsed so the About dialog is empty, there are no GNUstep
services, etc.

Starting the executable from the app bundle results in:

$ /usr/local/lib/GNUstep/Applications/Emacs.app/Emacs -Q
Error using execdir /usr/local/lib/GNUstep/Applications/Emacs.app/:
emacs: /usr/local/lib/GNUstep/Applications/Emacs.app/../native-lisp/31.0.50-90d61443/preloaded/window-0d1b8b93-2d794cce.eln: cannot open shared object file: No such file or directory

Note that some GNUstep users launch GNUstep applications from the
corresponding GNUSTEP_*_APPS directory in GWorkspace (where app
bundles appear with their icons and the Resources directory is
hidden), so it is a valid scenario to attempt to launch Emacs from the
app bundle.

Furthermore, gnustep-make (when configured with the layouts enumerated
above) creates a symlink in bindir pointing to the real executable in
the app bundle (since there is no point to install two identical
executables).  So if Emacs is packaged as a GNUstep package, it ought
to support this as well.

I have tested the attached (admittedly ugly) patch on Debian with
Emacs 30.2 for more than a month, where

1. prefix=/usr
2. /usr/bin/emacs is a symlink managed by dpkg's alternatives system,
   pointing to /usr/bin/emacs-ns
3. /usr/bin/emacs-ns is a symlink pointing to the real executable
   /usr/lib/x86_64-linux-gnu/GNUstep/Applications/Emacs.app/Emacs
4. /usr/lib/x86_64-linux-gnu/GNUstep/Applications/Emacs.app/Resources
   is a symlink pointing to /usr/share/GNUstep/Emacs.app (because of
   the FHS requirement to disallow images in /usr/lib)
5. Lisp resources, other programs, documentation, etc. come from
   Debian's dedicated packages emacs-common, emacs-bin-common, etc.

I'm willing to rework the patch and do the required testing if there's
a better way to address this problem; just let me know.

In GNU Emacs 31.0.50 (build 2, x86_64-pc-linux-gnu, NS
 gnustep-gui-0.32.0) of 2025-12-29 built on patilan
Repository revision: 29dea9ff4620127e9fa65aaa3374ce7c205cc059
Repository branch: master
Windowing system distributor 'GNU', version 10.3.32
System Description: Debian GNU/Linux forky/sid

Configured using:
 'configure --with-ns --disable-ns-self-contained'

Configured features:
ACL DBUS GIF GLIB GMP GNUTLS GPM JPEG LCMS2 LIBSELINUX LIBSYSTEMD
LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY NS PDUMPER PNG RSVG SECCOMP
SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB

Important settings:
  value of $LANG: bg_BG.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-nonselected-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr compile comint ansi-osc ansi-color ring comp-run
bytecomp byte-compile comp-common rx emacsbug lisp-mnt message mailcap
yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache
epa derived epg rfc6068 epg-config gnus-util text-property-search
time-date subr-x mm-decode mm-bodies mm-encode mailabbrev gmm-utils
mailheader cl-loaddefs cl-lib sendmail mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify gnustep ns lcms2 multi-tty make-network-process
tty-child-frames native-compile emacs)

Memory information:
((conses 16 54714 11386) (symbols 48 6850 0) (strings 32 16194 5041)
 (string-bytes 1 438682) (vectors 16 11724)
 (vector-slots 8 134846 11780) (floats 8 21 3) (intervals 56 242 0)
 (buffers 1064 11))

--Multipart_Mon_Dec_29_16:33:03_2025-1
Content-Type: text/plain; type=patch; charset=US-ASCII
Content-Disposition: attachment; filename="0001-NS-Fix-Emacs-startup-with-disable-ns-self-contained-.patch"
Content-Transfer-Encoding: 8bit

From 5e375710740a93c3cc1e4186682519d878d4e2d0 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor@HIDDEN>
Date: Mon, 29 Dec 2025 16:11:27 +0200
Subject: [PATCH] NS: Fix Emacs startup with --disable-ns-self-contained and
 native lisp comp

* src/pdumper.c (pdumper_set_emacs_execdir): Add workaround for
!NS_SELF_CONTAINED so that launching Emacs from the app bundle
works flawlessly when built with native compilation.
* configure.ac: Define BINDIR.
---
 configure.ac  |  3 +++
 src/pdumper.c | 26 +++++++++++++++++++++-----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9d113be88d5..e35d2ca8287 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7195,6 +7195,9 @@ AC_DEFUN
 AC_SUBST([GNU_OBJC_CFLAGS])
 AC_SUBST([OTHER_FILES])
 
+AS_IF([test $prefix = "NONE"], [_prefix=/usr/local], [_prefix=$prefix])
+AC_DEFINE_UNQUOTED([BINDIR], ["${_prefix}/bin/"], [Executables directory.])
+
 if test -n "${term_header}"; then
     AC_DEFINE_UNQUOTED([TERM_HEADER], ["${term_header}"],
         [Define to the header for the built-in window system.])
diff --git a/src/pdumper.c b/src/pdumper.c
index 876065929e0..e2170305a9e 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -5642,17 +5642,33 @@ dump_do_all_emacs_relocations (const struct dump_header *const header,
 static void
 pdumper_set_emacs_execdir (char *emacs_executable)
 {
+  const char *emacs_in_bundle = "";
+#if HAVE_NS && !NS_SELF_CONTAINED
+  emacs_in_bundle = "Emacs";
+#endif
   char *p = emacs_executable + strlen (emacs_executable);
 
   while (p > emacs_executable
 	 && !IS_DIRECTORY_SEP (p[-1]))
     --p;
   eassert (p > emacs_executable);
-  emacs_execdir = xpalloc (emacs_execdir, &execdir_size,
-			   p - emacs_executable + 1 - execdir_size, -1, 1);
-  memcpy (emacs_execdir, emacs_executable, p - emacs_executable);
-  execdir_len = p - emacs_executable;
-  emacs_execdir[execdir_len] = '\0';
+
+  if (strcmp (basename (emacs_executable), emacs_in_bundle))
+    {
+      emacs_execdir = xpalloc (emacs_execdir, &execdir_size,
+			       p - emacs_executable + 1 - execdir_size, -1, 1);
+      memcpy (emacs_execdir, emacs_executable, p - emacs_executable);
+      execdir_len = p - emacs_executable;
+      emacs_execdir[execdir_len] = '\0';
+    }
+  else
+    {
+      /* This is the Emacs executable from the non-self-contained app
+	 bundle which can be anywhere on the system.  Fortunately, the
+	 location of the lisp resources is known.  */
+      emacs_execdir = (char *) BINDIR;
+      execdir_len = strlen (BINDIR);
+    }
 }
 #endif
 
-- 
2.51.0


--Multipart_Mon_Dec_29_16:33:03_2025-1--




Acknowledgement sent to Yavor Doganov <yavor@HIDDEN>:
New bug report received and forwarded. Copy sent to yavor@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to yavor@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#80094; 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, 12 Jan 2026 12:30:02 UTC

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