unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: 57929@debbugs.gnu.org
Subject: bug#57929: 29.0.50; package-quickstart.elc incompatible with Emacs 28.2 due to defvar-1
Date: Mon, 19 Sep 2022 08:38:55 -0400	[thread overview]
Message-ID: <jwvzgevv993.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CADwFkmm2uk+QTbWn-1myu--MX7c0q8svSEFKjwsBx7F8CET90w@mail.gmail.com> (Stefan Kangas's message of "Mon, 19 Sep 2022 05:56:39 -0400")

Stefan Kangas [2022-09-19 05:56:39] wrote:
> It seems like the package-quickstart.elc is now backwards-incompatible
> since defvar-1 is missing.

Yes, same old issue of compatibility for `.elc` files.

It would be good to improve our handling of such situations (for
`package-quickstart.elc` as well as for other compiled files such as
those in ELPA packages).

I can think of two ways to detect the problem:
- When loading the `.elc` file signals an error.
  [ It might be a legitimate error, but we could catch it and ask the
  user if we should try loading the non-compiled file instead.  ]
- When the loaded file's version marker is "too large".  The 4th byte of
  `.elc` files holds the major version of the Emacs that compiled it
  (except that 29.0.xx counts as 28, see comment in bytecomp.el:2390),
  so we could easily use this evidence that the file was compiled by
  a newer Emacs to skip the .`elc` file.

Once detected we could also delete the file, or recompile it, or suggest
doing one of those.  Deleting could throw away a handy file.
And recompiling may generate an invalid `.elc` file if some of the
dependencies defining macros aren't loaded (or may fail if some of the
required dependencies aren't in `load-path`).


        Stefan






      reply	other threads:[~2022-09-19 12:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19  9:56 bug#57929: 29.0.50; package-quickstart.elc incompatible with Emacs 28.2 due to defvar-1 Stefan Kangas
2022-09-19 12:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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=jwvzgevv993.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=57929@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefan@marxist.se \
    /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).