From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.devel Subject: nativecomp and throw/catch across files Date: Wed, 17 Feb 2021 23:43:01 -0600 Message-ID: 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="35779"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 18 06:44:08 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 1lCc6h-0009CU-QP for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Feb 2021 06:44:07 +0100 Original-Received: from localhost ([::1]:58154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCc6g-0007nU-PU for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Feb 2021 00:44:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCc5y-0007Mw-0C for emacs-devel@gnu.org; Thu, 18 Feb 2021 00:43:22 -0500 Original-Received: from mail-yb1-xb32.google.com ([2607:f8b0:4864:20::b32]:39727) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCc5q-0007Sc-8U for emacs-devel@gnu.org; Thu, 18 Feb 2021 00:43:21 -0500 Original-Received: by mail-yb1-xb32.google.com with SMTP id u3so1037894ybk.6 for ; Wed, 17 Feb 2021 21:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=IjDbpOXjJHIJBEJBaHpnoJmc2g05pRNQD9+CPiUyzoc=; b=al+zpeTraapC0jtsogANSYOeU6iLX7ygfpRrFhBK4rV2yVCffTkPkvokbXyOiRQN3b cbu/oO8vywEWVsjVMPD8yhE5686mEbgaoPhB/zdPbP9t48LdTYUVwq3p5e//XgPbwAN8 k/72iS7qodhNxzKuIuOlR1xuLjUIIoVCbSFyNjcNn8lfYQWDcOGnhjspsKkTLnOGcern RrZOBaFS2ujKVQB7A0PHfJ0Oieqhs0ZbKhp1zynGTNUDw0XCNsZQrmgpZWn1Ua9mp2mO in1i1jn7RuAv+hsv3SIP+s8Ml1dZUNnbLPSIJ3mmZIF0I1QJp2zOwpLz1KhveqA9Zr/J QDOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=IjDbpOXjJHIJBEJBaHpnoJmc2g05pRNQD9+CPiUyzoc=; b=lGYAPHasta+PQq4vRPcFjsoMEou0jzYTrm6TuuuO8R12mGmJ/XmHeRTR8HHCVReg1O ZwDNv4FyVhbCzYUXZuU+MsFpgACz4BGQlfXiNPOjuhjwO3rAlxX1A7DQw7lJRUSNzUwV W/Z/Q8doajNMaz56OKTZLt9aIvUPYRcfgPGR0yrh4xBXYTnn3ZQDwpp/RyPWbIQTOPjr 5H8MwchX65mvu3N2+60dy0O+MlR3BFf9aiKV3BE1/15lbTT1gq4Vdwnicdh0rkuAn7CW MrDXU2/S1BjJCKkkmL6eYxo+ifONGl0+R9oKS2JLqofS/T8tH0sowG270aLVavhfrH5g 70RA== X-Gm-Message-State: AOAM533l4iPADmLOwnEkbrYveJ3VqbSlCz27krtNzRpg+DJjcNj6jDpG hhFPH48xicSycyM7TrpjPcUTaqN6wiSQ9hOC1eTzboaA+md7XA== X-Google-Smtp-Source: ABdhPJxP5qtgYprroAfefIylfUovMJ0lSVEsKSF5y2eeFSqVpWmrf6DzvZ9dV3dmsT3gkpP2hgYMYnQDWjJWcaug90s= X-Received: by 2002:a25:903:: with SMTP id 3mr3999699ybj.275.1613626992484; Wed, 17 Feb 2021 21:43:12 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::b32; envelope-from=aaronjensen@gmail.com; helo=mail-yb1-xb32.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:265125 Archived-At: 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/2d407bccd9378f1d5218f8ba2ae85c= 6be73fbaf1/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/2d407bccd9378f1d5218f8ba2ae85c= 6be73fbaf1/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 aga= in. 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. Aaron