From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#49271: 28.0.50: native-comp: Signing macOS self-contained .app bundle fails due to new *.eln location Date: Thu, 1 Jul 2021 19:45:46 +0100 Message-ID: References: <83zgv7mtly.fsf@gnu.org> <83v95uld6n.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="/RofLedAnAvQkvPz" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26226"; mail-complaints-to="usenet@ciao.gmane.io" Cc: contact@jimeh.me, 49271@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 01 20:47:19 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lz1iY-0006ay-TQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Jul 2021 20:47:19 +0200 Original-Received: from localhost ([::1]:38018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lz1iX-0008Tk-VC for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Jul 2021 14:47:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lz1iH-0008QF-VJ for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 14:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50388) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lz1iH-0004Bk-O5 for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 14:47:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lz1iH-0002Sg-Mx for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 14:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2021 18:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49271 X-GNU-PR-Package: emacs Original-Received: via spool by 49271-submit@debbugs.gnu.org id=B49271.16251651629382 (code B ref 49271); Thu, 01 Jul 2021 18:47:01 +0000 Original-Received: (at 49271) by debbugs.gnu.org; 1 Jul 2021 18:46:02 +0000 Original-Received: from localhost ([127.0.0.1]:33701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz1hK-0002R3-F2 for submit@debbugs.gnu.org; Thu, 01 Jul 2021 14:46:02 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:42295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz1hE-0002QW-MC for 49271@debbugs.gnu.org; Thu, 01 Jul 2021 14:46:00 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id F40F792; Thu, 1 Jul 2021 18:45:50 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.142]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1625165150; bh=nNr1cjuTIsuGnmLk45fYh0YdHMsC2m5QlYkYeN4X73E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZeUwys/q0c+X9TcoQGOPQCJP8z7FBbBMFvmyTqstvI5qf+TS3VuCUxBz6cnHa7fq+ FHRWUpC5qGm0U/WYKLK/8tK/RQT/8CXjq+ASCx0kGqbPR3BT72mOih7y+K6fKbD8vV w70Ji86AKBd0iT6rPTpzBRTAZkN4POhd3ZgDR0gmvkIWiX62hHudZNJA8Yt4eC7IbG fVja4Ez8+dzd0WKzqG3XPjebw6vxT6adqxTPlb7rT9mquVGO1Jp14Wmg65j3wMhIZY mA+t0Uue84SpSBCGnBfJdyCctJIP7gW7MMF/b44BmPMGsib+iTG/L6bWcSNP1q3Rk7 0v6wbF96KKCuA== Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 09224202CDC89B; Thu, 1 Jul 2021 19:45:46 +0100 (BST) Mail-Followup-To: Alan Third , Eli Zaretskii , contact@jimeh.me, 49271@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <83v95uld6n.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209283 Archived-At: --/RofLedAnAvQkvPz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 01, 2021 at 10:13:04AM +0300, Eli Zaretskii wrote: > It should work, although I'd prefer writing such code the other way > around: first create an uninitialized Lisp string (with > make_uninit_multibyte_string or make_uninit_string), then copy the > bytes while making the conversions. The reason for this preference is > that you could then make sure the produced string has the same > multibyte-ness as the original, whereas the way you did it relies on > whatever build_string decides, which is not necessarily the same. Thanks. I think the attached is doing what you suggested. -- Alan Third --/RofLedAnAvQkvPz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-Fix-NS-self-contained-eln-location-bug-49271.patch" >From 8de89ce0d2ae7f84ab2df025ae405b15994dfdb6 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Wed, 30 Jun 2021 19:58:13 +0100 Subject: [PATCH v2] Fix NS self contained eln location (bug#49271) * Makefile.in: * configure.ac: Change eln file install location to Contents/Frameworks. * src/comp.c (hash_native_abi): Replace dots with underscores in the eln install location as the macOS code-signing tool won't sign the files if the parent directories have dots. --- Makefile.in | 2 +- configure.ac | 4 ++-- src/comp.c | 35 ++++++++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index 8fccdf7580..8c14c5cc7d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -333,7 +333,7 @@ BIN_DESTDIR= ELN_DESTDIR = $(DESTDIR)${libdir}/emacs/${version}/ else BIN_DESTDIR='${ns_appbindir}/' -ELN_DESTDIR = ${ns_applibdir}/emacs/${version}/ +ELN_DESTDIR = ${ns_applibdir}/ endif all: ${SUBDIR} info diff --git a/configure.ac b/configure.ac index 6e2cda947a..c924634d5b 100644 --- a/configure.ac +++ b/configure.ac @@ -1895,7 +1895,7 @@ AC_DEFUN ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir}/Contents/MacOS ns_applibexecdir=${ns_appdir}/Contents/MacOS/libexec - ns_applibdir=${ns_appdir}/Contents/MacOS/lib + ns_applibdir=${ns_appdir}/Contents/Frameworks ns_appresdir=${ns_appdir}/Contents/Resources ns_appsrc=Cocoa/Emacs.base ns_fontfile=macfont.o @@ -1954,7 +1954,7 @@ AC_DEFUN ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir} ns_applibexecdir=${ns_appdir}/libexec - ns_applibdir=${ns_appdir}/lib + ns_applibdir=${ns_appdir}/Frameworks ns_appresdir=${ns_appdir}/Resources ns_appsrc=GNUstep/Emacs.base ns_fontfile=nsfont.o diff --git a/src/comp.c b/src/comp.c index ea05952627..c45f9e3a7f 100644 --- a/src/comp.c +++ b/src/comp.c @@ -744,8 +744,41 @@ hash_native_abi (void) Vsystem_configuration_options), Fmapconcat (intern_c_string ("comp--subr-signature"), Vcomp_subr_list, build_string ("")))); + + Lisp_Object version = Vemacs_version; + +#ifdef NS_SELF_CONTAINED + /* MacOS self contained app bundles do not like having dots in the + directory names under the Contents/Frameworks directory, so + convert them to underscores. */ + unsigned char *to; + const unsigned char *from = SDATA (Vemacs_version); + + int multibyte = STRING_MULTIBYTE (Vemacs_version); + + version = multibyte + ? make_uninit_multibyte_string (SCHARS (Vemacs_version), + SBYTES (Vemacs_version)) + : make_uninit_string (SBYTES (Vemacs_version)); + + to = SDATA (version); + + while (from < SDATA (Vemacs_version) + SBYTES (Vemacs_version)) + { + int c = multibyte ? string_char_advance (&from) : *from++; + + if (c == '.') + c = '_'; + + if (multibyte) + to += CHAR_STRING (c, to); + else + *to++ = c; + } +#endif + Vcomp_native_version_dir = - concat3 (Vemacs_version, build_string ("-"), Vcomp_abi_hash); + concat3 (version, build_string ("-"), Vcomp_abi_hash); } static void -- 2.29.2 --/RofLedAnAvQkvPz--