From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Myhrberg 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: Wed, 30 Jun 2021 11:04:43 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21462"; mail-complaints-to="usenet@ciao.gmane.io" To: Alan Third , Jim Myhrberg , 49271@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 30 12:06:14 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 1lyX6k-0005Ge-IN for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Jun 2021 12:06:14 +0200 Original-Received: from localhost ([::1]:59700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyX6j-0004pg-JO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Jun 2021 06:06:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyX6Y-0004gO-Ly for bug-gnu-emacs@gnu.org; Wed, 30 Jun 2021 06:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyX6Y-0000cg-Ek for bug-gnu-emacs@gnu.org; Wed, 30 Jun 2021 06:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lyX6Y-0000SG-Ao for bug-gnu-emacs@gnu.org; Wed, 30 Jun 2021 06:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Myhrberg Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Jun 2021 10:06:02 +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.16250475031653 (code B ref 49271); Wed, 30 Jun 2021 10:06:02 +0000 Original-Received: (at 49271) by debbugs.gnu.org; 30 Jun 2021 10:05:03 +0000 Original-Received: from localhost ([127.0.0.1]:56489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyX5a-0000Qa-P4 for submit@debbugs.gnu.org; Wed, 30 Jun 2021 06:05:03 -0400 Original-Received: from mail-oi1-f174.google.com ([209.85.167.174]:35490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyX5Y-0000Q4-Lp for 49271@debbugs.gnu.org; Wed, 30 Jun 2021 06:05:01 -0400 Original-Received: by mail-oi1-f174.google.com with SMTP id k206so2444362oif.2 for <49271@debbugs.gnu.org>; Wed, 30 Jun 2021 03:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jimeh.me; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=hiDOIZa3Q3I2yknnQpTgA2o2y2hKUd5smdolZg7BywE=; b=ImWf9D1e0TmhZvAH0J5nCaUO9Qc8wjztdAaOGobtEAsAB/xhUrarkNnwlj9XWBsDMZ mATdWgsZIf3tvKp81Hfh1tTTdXkHludlNXfQvbuv1ktxyt8XuIxXTAny3o+CVGBpO6Pl xyLteXfA/IRPx7KTVPW+ybnW1+dQBbaYReeROMbL01J6aGYXCcHRKNLn0ejarsQBZelW wOeTsFJQqZd7kUXjPiE7EmLmCg74s/0idws1eBGlEpi14qTGkkEduPE2wSShBJGEsWAe Yngdls1ecx39kppCzI08wgZ8veyz6w3Rfckqthx+73/gtwU2WQy5gl3TWjoEyycrZPTb daZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=hiDOIZa3Q3I2yknnQpTgA2o2y2hKUd5smdolZg7BywE=; b=pS80OdX65ytxQsN3qYbi8dmNRGsDPWwqnq54x4Qlu9mDkLkifBuBYWMc4vflEeE2V0 q7TvkknS/WxXWS8Es1MQiuN3awdcx6YOg6eYORVFtbeM0804rTUJUrQ0F/9ScNel6KQl nmQ96rDIV0P388uWF2UTnEc4/sYUCh+ZkMOHwngknA0HsF6ytnloWXAebYcVVhiNt3UE R4jyfty4/MJq55nVShR8ymZlzjbOLpAHeKfGJS78ST5KA1KAW00CXZb8HkhZyUo54Wpc LIFxqDm5BRi3tsKs65Q8bLzN9i8j5zQzAyk8NZuUb3cSauwZnrUQZ5+jpg4ZokRNd9v6 IUVg== X-Gm-Message-State: AOAM531de1Oe36j9dgg1WGNECKs9ewCtx+s/kxVG3svnZ03DZILHmSnz CW9e6buFabWkRA1YJVyUan69ZZtQsVt5p/g8MQpFeg== X-Google-Smtp-Source: ABdhPJwGUWUfrwI2Gj1PUiSZK/Gy+7a+4FT1ZIYD2axdxa4zctYB4kLTrJlcswnI/OOCwcqUYWBjl8jTuPr8xeqVx6s= X-Received: by 2002:aca:4d05:: with SMTP id a5mr2339701oib.163.1625047494931; Wed, 30 Jun 2021 03:04:54 -0700 (PDT) In-Reply-To: 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:209150 Archived-At: I've just tried "Contents/lib", and it allowed me to sign and notarize the .app bundle. And combined with your patch from bug#49270, all bundled *.eln files are also correctly located and loaded :) I did a bit of searching myself for alternatives and found "Contents/PlugIns" as a potentially suitable place, but a quick test revealed codesign fails the same way with it as it does with Contents/MacOS. Personally I think Contents/lib is probably fine, as both codesign and Apple's notarization process are happy with it. And the notarization process seems very picky. For example, when *.eln files were in Resources/native-lisp, my initial notarization attempts failed because it considered the *.eln files to be binaries, and they had not been signed by codesign despite the --deep flag being used. Hence I'm individually signing all the *.eln files before signing the app bundle itself to get the app through notarization. Also, I should probably mention that I generally know little about macOS app development, and have mostly just tested my way forward with figuring out how to sign and notarize Emacs :) On Tue, Jun 29, 2021 at 8:19 PM Alan Third wrote: > > On Tue, Jun 29, 2021 at 12:58:44PM +0100, Jim Myhrberg wrote: > > Commit 5dd2d50 seems to have moved the native-lisp folder within self-contained > > Emacs.app bundles: > > > > - from: "Contents/Resources/native-lisp" > > - to: "Contents/MacOS/lib/emacs/28.0.50/native-lisp" > > > > Unfortunately, Apple's codesign utility blows up with an error if there is any > > folder within "Contents/MacOS" (recursively) which contains two dots within its > > name. Here is an example of what the error looks like: > > > > /Users/runner/work/emacs-builds/emacs-builds/builds/Emacs.2021-06-26.b8f9e58.master.macOS-10-15.x86_64/Emacs.app: > > bundle format unrecognized, invalid, or unsuitable > > In subcomponent: > > /Users/runner/work/emacs-builds/emacs-builds/builds/Emacs.2021-06-26.b8f9e58.master.macOS-10-15.x86_64/Emacs.app/Contents/MacOS/lib/emacs/28.0.50 > > Bummer. > > I had three options: > > * Contents/MacOS/lib > * Contents/Resources/ > * Contents/lib > > and a close reading of the Apple documentation left me none-the-wiser > as to which option I should use. Executable binaries go under MacOS, > but these aren't executables. Framework libraries go somewhere else > entirely, but these aren't framework libraries. Resources is intended > for images and things, not libs. Lib is entirely non-standard. > > I really don't know where the best place is. I'm still thinking > Resources is definitely not the right place, but none of the other > existing places make any sense, so perhaps the non-standard > /Contents/lib is the best option... > > Can you try that? In order to sort it edit configure.ac, search for > the first occurrence of "ns_applibdir" and change the path. > > If that fails then I guess we move them back under Resources. Unless > you have any better ideas. > -- > Alan Third