unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo via "Emacs development discussions." <emacs-devel@gnu.org>
To: Aaron Jensen <aaronjensen@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: nativecomp and throw/catch across files
Date: Thu, 18 Feb 2021 08:05:59 +0000	[thread overview]
Message-ID: <xjfpn0xpzq0.fsf@sdf.org> (raw)
In-Reply-To: <CAHyO48wQzOA0t_UKWiSy2+ThR-fDrT2HnsZ1xj_G1SksG06kOw@mail.gmail.com> (Aaron Jensen's message of "Wed, 17 Feb 2021 23:43:01 -0600")

Aaron Jensen <aaronjensen@gmail.com> 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/2d407bccd9378f1d5218f8ba2ae85c6be73fbaf1/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/2d407bccd9378f1d5218f8ba2ae85c6be73fbaf1/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
> ‘/Users/aaronjensen/.emacs.d/early-init.el’:
>
> 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 again.
>
> 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



  reply	other threads:[~2021-02-18  8:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18  5:43 nativecomp and throw/catch across files Aaron Jensen
2021-02-18  8:05 ` Andrea Corallo via Emacs development discussions. [this message]
2021-02-18  8:36   ` Aaron Jensen
2021-02-18  9:44     ` Andrea Corallo via Emacs development discussions.
2021-02-18 15:44       ` Aaron Jensen
2021-02-18 15:54         ` Andrea Corallo via Emacs development discussions.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjfpn0xpzq0.fsf@sdf.org \
    --to=emacs-devel@gnu.org \
    --cc=aaronjensen@gmail.com \
    --cc=akrl@sdf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).