From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: nativecomp and throw/catch across files Date: Thu, 18 Feb 2021 08:05:59 +0000 Message-ID: References: Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8429"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Aaron Jensen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 18 09:07:49 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lCeLl-00024Y-Ay for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Feb 2021 09:07:49 +0100 Original-Received: from localhost ([::1]:40268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCeLk-00067G-1W for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Feb 2021 03:07:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCeK3-0005by-Ol for emacs-devel@gnu.org; Thu, 18 Feb 2021 03:06:03 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:57236) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCeK1-00038L-Lo for emacs-devel@gnu.org; Thu, 18 Feb 2021 03:06:03 -0500 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 11I85xON019004 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Thu, 18 Feb 2021 08:05:59 GMT In-Reply-To: (Aaron Jensen's message of "Wed, 17 Feb 2021 23:43:01 -0600") Received-SPF: pass client-ip=205.166.94.24; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:265128 Archived-At: Aaron Jensen writes: > Hi there, > > I've been trying out the nativecomp branch and I use straight.el as my > package manager. > > One of the things that it does is throw when it detects that its own > compiled bytecode has changed. It does this from within straight.el: > > (eval > `(unless (equal > (emacs-version) > ,(eval-when-compile (emacs-version))) > (throw 'emacs-version-changed nil))) > > https://github.com/raxod502/straight.el/blob/2d407bccd9378f1d5218f8ba2ae8= 5c6be73fbaf1/straight.el#L45-L49 > > It then catches within bootstrap.el, which loads straight.el: > > (catch 'emacs-version-changed > ;; straight.el has a fun hack that throws > ;; `emacs-version-changed' if the version of Emacs has changed > ;; since the last time it was byte-compiled. This prevents us > ;; from accidentally loading invalid byte-code, hopefully. > (load (expand-file-name (concat straight.el "c") > default-directory) > nil 'nomessage 'nosuffix) > (setq emacs-version-changed nil)) > > https://github.com/raxod502/straight.el/blob/2d407bccd9378f1d5218f8ba2ae8= 5c6be73fbaf1/bootstrap.el#L47-L54 > > Unfortunately, this doesn't work with nativecomp. It claims that > there's no matching catch when a throw actually happens. > > Warning (initialization): An error occurred while loading > =E2=80=98/Users/aaronjensen/.emacs.d/early-init.el=E2=80=99: > > No catch for tag: emacs-version-changed, nil > > > To reproduce, you should be able to use the bootstrap code: > https://github.com/raxod502/straight.el#bootstrapping-straightel > > Then recompile emacs (which changes the value of emacs-version) and run a= gain. > > I tried narrowing it down to just a try/catch in two different files > and that worked, so there must be something more peculiar going on > here. Hi Aaron, is there a corresponding issue open in straight? Perhaps straight developers can narrow down the issue and suggest a minimal reproducer in case this is a real issue on our side. Thanks Andrea