unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: "T.V Raman" <raman@google.com>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Permanently fix org versioning breakage during builds?
Date: Sun, 24 Dec 2023 16:32:30 +0000	[thread overview]
Message-ID: <CALDnm50rK5o44URVNXWQdQ0tSK3sW6xq3wCxrryhDFUS4OYkFw@mail.gmail.com> (raw)
In-Reply-To: <875y0n4px0.fsf@localhost>

On Sun, Dec 24, 2023 at 2:45 PM Ihor Radchenko <yantar92@posteo.net> wrote:
>
> João Távora <joaotavora@gmail.com> writes:
>
> >> I do not think that your idea will work.
> >> What you propose is compiling `org-assert-version' once.
> >>
> >
> > Hmm? How can that be what I'm proposing if I didn't even know about this
> > definition. Is it a form, a macro?
>
> > What ultimate problem is it solving? What condition do you need to assert
> > at Emacs master build-time, failing which something else will go wrong?
>
> `org-assert-version' is a macro.
> It is solving a very common problem when some files from Org mode are
> loaded from Emacs distribution and some are loaded from a newer Org mode
> version typically installed from ELPA. This causes various unexpected
> breakages.

OK, what thing does `org-assert-version` assert and what is one concrete
example of a breakage.  Can this unexpected breakage exist if someone
has never ever installed Org mode from ELPA?

> Or, similarly, when built-in Org mode is updated, some macros are
> changed, but their users are not re-compiled, leaving stale macro
> expansions inside .elc files. Again, this causes various breakages.

Well, this is a problem that is very commonly solved by the technique
I described.  But without an example of one member of this "some macros"
set and the example of one of its users in some other file, it's hard
to justify your previous assertion that "the idea will not work".

Maybe it will, maybe it won't, or maybe it would but it would be
unpractical for some reason (say, if there are hundred such macros,
or if they're created by a macro-generating macro, or whatever: macros
can be hairy).

For example, the technique I described earlier cannot generally solve
a very similar problem with DEFSTRUCT (in our case cl-defstruct), because
all the slot accessors are functions generated with cl-defstruct which have
compiler macros and removing the compiler macros would negate the dispatching
speedup which the (only?) reason to choose structs over classes.

But we won't know any of this until we study the problem with some
concrete code.

> `org-assert-version' macro makes sure that no mixing like the above is
> happening.
>
> > I just provided ideas on how to solve a very common build-time pitfall in
> > Lisp. A pitfall that can be solved by requiring a recompilation of
> > everything, as seems to be the current way, or in other less brutal ways.
>
> > Keep in mind something in the build system is causing builds to fail with
> > cryptic messages even for people who don't use Org or rarely ever do. I've
> > never touched any Org related files in my life, why should it blow up in my
> > face? Of course happens to all package maintainers but usually there is a
> > fix. There should be one here, too.
>
> Nothing is blown up in your face. The version breakage we are discussing
> in this thread is at runtime, when Org mode is loaded and detects that
> some of .elc files for Org libraries are stale (compiled using older Org
> mode version).

I've seen this problem tens of times, even fairly recently, when doing my
usual git pull --rebase && make routine.  It's especially annoying during a
git bisect.  It's only solved by `make bootstrap` or `rm -rf lisp/org/*.elc`.

Is this problem 100% fully solved?

> I hope that the above clarified the situation.

No, it didn't, I'm afraid.  If you know one of these macros (you alluded
earlier to "some macros"), type its name here, please.

João



  reply	other threads:[~2023-12-24 16:32 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22 17:27 Permanently fix org versioning breakage during builds? T.V Raman
2023-12-23 17:58 ` João Távora
2023-12-23 18:06   ` Ihor Radchenko
2023-12-23 18:44     ` João Távora
2023-12-24 11:50       ` Ihor Radchenko
2023-12-24 14:13         ` João Távora
2023-12-24 14:48           ` Ihor Radchenko
2023-12-24 16:32             ` João Távora [this message]
2023-12-24 16:36               ` T.V Raman
2023-12-24 17:00                 ` Eli Zaretskii
2023-12-24 17:04               ` João Távora
2023-12-24 17:16                 ` Ihor Radchenko
2023-12-24 17:48                   ` João Távora
2023-12-24 18:13                     ` T.V Raman
2023-12-24 18:52                       ` Eli Zaretskii
2023-12-24 18:13                     ` Ihor Radchenko
2023-12-24 23:11                       ` João Távora
2023-12-25 11:26                         ` &allow-other-keys + &rest body in cl-defmacro (was: Permanently fix org versioning breakage during builds?) Ihor Radchenko
2023-12-25 12:09                           ` João Távora
2023-12-25 12:21                             ` Ihor Radchenko
2023-12-25 19:00                           ` Ihor Radchenko
2023-12-25 13:58                         ` Permanently fix org versioning breakage during builds? Ihor Radchenko
2023-12-25 17:42                           ` João Távora
2023-12-25 18:24                             ` Ihor Radchenko
2023-12-24 17:05               ` Ihor Radchenko
2023-12-24 17:12                 ` João Távora
2023-12-24 17:18                   ` Ihor Radchenko
2023-12-24 17:24                     ` Ihor Radchenko
2023-12-24 17:54                       ` João Távora
2023-12-24 18:10                         ` Ihor Radchenko
2023-12-24 18:16                           ` João Távora
2023-12-24 18:23                             ` Ihor Radchenko
2023-12-24 18:47                           ` Eli Zaretskii
2023-12-24 18:56                             ` Ihor Radchenko
2023-12-24 18:57                               ` Eli Zaretskii
2023-12-24 18:42                         ` Eli Zaretskii
2023-12-24 14:56           ` Eli Zaretskii
2023-12-24 23:14             ` João Távora
2023-12-24  2:43     ` T.V Raman
2023-12-24  6:51       ` Eli Zaretskii
2023-12-24 16:29         ` T.V Raman
2023-12-24 16:56           ` Eli Zaretskii
2023-12-24 11:00       ` Ihor Radchenko
2023-12-24 12:32         ` Po Lu
2023-12-24 12:50           ` Ihor Radchenko
2023-12-24 12:57             ` Po Lu
2023-12-24 14:11             ` Stefan Kangas
2023-12-24 14:51               ` Ihor Radchenko
2023-12-24 14:58                 ` Eli Zaretskii
2023-12-24 16:59                   ` Ihor Radchenko
2023-12-24 17:26                     ` T.V Raman
2023-12-24 17:44                       ` Ihor Radchenko
2023-12-24 18:01                         ` João Távora
2023-12-24 18:12                           ` Ihor Radchenko
2023-12-24 18:16                             ` T.V Raman
2023-12-24 18:25                               ` Ihor Radchenko
2023-12-24 18:53                               ` Eli Zaretskii
2023-12-24 18:48                             ` Eli Zaretskii
2023-12-24 19:23                               ` Stefan Kangas
2023-12-24 18:45                           ` Eli Zaretskii
2023-12-24 18:11                         ` T.V Raman
2023-12-24 18:17                           ` Ihor Radchenko
2023-12-24 19:31                             ` T.V Raman
2023-12-24 18:51                           ` Eli Zaretskii
2023-12-24 17:56                       ` João Távora
2023-12-24 18:36                       ` Eli Zaretskii
2023-12-24 18:32                     ` Eli Zaretskii
2023-12-24 18:50                       ` Ihor Radchenko
2023-12-24 18:55                         ` Eli Zaretskii
2023-12-24 19:05                           ` Ihor Radchenko
2023-12-24 23:23                       ` João Távora
2023-12-24 19:16                     ` Stefan Kangas
2023-12-24 19:24                       ` Ihor Radchenko
2023-12-24 16:32               ` T.V Raman
2023-12-24 16:39                 ` João Távora
2023-12-24 16:58                   ` Eli Zaretskii
2023-12-24 17:05                     ` João Távora
2023-12-24 18:34                       ` Eli Zaretskii
2023-12-25 18:59             ` Ihor Radchenko
2023-12-25 19:27               ` Eli Zaretskii
2023-12-25 20:02                 ` Ihor Radchenko
2023-12-25 20:03                   ` Eli Zaretskii

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=CALDnm50rK5o44URVNXWQdQ0tSK3sW6xq3wCxrryhDFUS4OYkFw@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=raman@google.com \
    --cc=yantar92@posteo.net \
    /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).