all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ken Brown <kbrown@cornell.edu>, Andrea Corallo <akrl@sdf.org>
Cc: Stromeko@nexgo.de, 50666@debbugs.gnu.org
Subject: bug#50666: 28.0.50; Fix native compilation on Cygwin
Date: Thu, 23 Sep 2021 10:42:33 +0300	[thread overview]
Message-ID: <83o88jvity.fsf@gnu.org> (raw)
In-Reply-To: <4ae8067f-55b2-d243-66f3-f76493095a39@cornell.edu> (message from Ken Brown on Wed, 22 Sep 2021 17:35:28 -0400)

> Cc: Stromeko@nexgo.de, 50666@debbugs.gnu.org
> From: Ken Brown <kbrown@cornell.edu>
> Date: Wed, 22 Sep 2021 17:35:28 -0400
> 
> We've made a good start on the Cygwin side, but I have a question about how to 
> integrate it into Emacs.

I added Andrea to this discussion, as he knows more than anyone else
about the Emacs side of this stuff.

> Let's say we have a script that I'll call "rebase" for the purpose of this 
> discussion, which rebases all the eln files in ~/.emacs.d/eln-cache.  The user 
> would then start Emacs via a script that first calls rebase and then starts 
> Emacs.

Is it really necessary to rebase the *.eln files before each startup?
Isn't it enough to rebase each of the .eln files just once, when it is
produced?  If indeed this is needed every time, can you explain why?

> Within Emacs, I would then want to do something like
> 
> (if (eq system-type 'cygwin)
>      (call-process "rebase" nil
>                    '(:file "<log file>")
>                    nil "<arg>" ...))
> 
> after every compilation but before the compiled file is loaded.
> 
> I'm not familiar enough with native compilation to know where this should go. 

The non-preloaded *.eln files are all loaded by native-elisp-load, so
I guess the rebase should be launched from there?  The preloaded *.eln
files are loaded in pdumper.c:dump_do_dump_relocation, but do we need
to support non-rebased preloaded *.eln files?

> Or maybe it has to be done in more than one place, depending on whether the 
> compilation is synchronous or not.
> 
> Can you help?

I hope the above helps.  But I think we should understand better all
the aspects of this issue, to make sure it will work correctly in the
wild.  The *.eln files bring quite a few new and unusual aspects and
dependencies to Emacs, they are not just another kind of DLLs loaded
dynamically.  So I'd appreciate if you explained:

  . why is rebasing needed (I think I understand that part, but I'd
    prefer an explanation from the experts)
  . how will the 'rebase' utility determine to which address to remap
    each .eln file

> P.S. The rebase script will fail to rebase eln files that are already loaded, 
> but that's harmless in the scenario above.

When an updated .eln file is produced for .eln that is loaded into
some running Emacs, Emacs on Windows renames the original .eln to
avoid a similar problem.  Can't you use the same technique, to avoid
the need of rebasing on each start?  Please note that users could
place *.eln files in unusual locations (and customize
native-comp-eln-load-path to reflect that), so finding _all_ of the
relevant *.eln files from a shell script might not be easy.  In fact,
even without customizing the load-path, I don't think I understand how
will that script you propose know where to find all the *.eln files.

Thanks.





  reply	other threads:[~2021-09-23  7:42 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-18 20:46 bug#50666: 28.0.50; Fix native compilation on Cygwin Ken Brown
2021-09-18 20:58 ` Ken Brown
2021-09-19  5:37   ` Eli Zaretskii
2021-09-19  7:00     ` ASSI
2021-09-19  7:08       ` Eli Zaretskii
2021-09-19 11:31         ` ASSI
2021-09-19 12:06           ` Eli Zaretskii
2021-09-19 12:37             ` Ken Brown
2021-09-19 13:41               ` Eli Zaretskii
2021-09-19 14:27                 ` Ken Brown
2021-09-19 15:28                   ` Eli Zaretskii
2021-09-19 16:17                     ` Ken Brown
2021-09-19 17:12                       ` Eli Zaretskii
2021-09-22 21:35                         ` Ken Brown
2021-09-23  7:42                           ` Eli Zaretskii [this message]
2021-09-23 14:20                             ` Ken Brown
2021-09-23 16:37                               ` Eli Zaretskii
2021-09-23 17:13                                 ` Ken Brown
2021-09-23 17:29                                   ` Eli Zaretskii
2021-09-23 17:49                                     ` Achim Gratz
2021-09-23 18:01                                       ` Eli Zaretskii
2021-09-23 18:25                                         ` Achim Gratz
2021-09-23 18:46                                           ` Eli Zaretskii
2021-10-28 22:22                                   ` Ken Brown
2021-10-29  5:54                                     ` Eli Zaretskii
2021-10-29 17:03                                       ` Ken Brown
2021-10-29 18:01                                         ` Eli Zaretskii
2021-10-29 18:12                                           ` Ken Brown
2021-10-31 20:22                                             ` Achim Gratz
2021-10-31 23:52                                               ` Ken Brown
2021-09-23 17:27                                 ` Achim Gratz
2021-09-23 17:48                                   ` Eli Zaretskii
2021-09-23 18:29                                     ` Achim Gratz
2021-09-23 18:57                                       ` Eli Zaretskii
2021-09-23 19:37                                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-24  6:11                                         ` ASSI
2021-09-24  7:13                                           ` Eli Zaretskii
2021-09-24  7:32                                           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-24  9:05                                             ` ASSI
2021-09-24 10:48                                             ` Eli Zaretskii
2021-09-25 15:10                                               ` Eli Zaretskii
2021-09-23 19:11                             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-23 19:21                               ` Eli Zaretskii
2021-09-24  6:04                               ` ASSI
2021-09-24  7:10                                 ` Eli Zaretskii
2021-09-24  7:26                                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-24 11:10                                     ` Eli Zaretskii
2021-09-24 12:49                                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-24  9:15                                   ` ASSI
2021-09-24 11:03                                     ` Eli Zaretskii
2021-09-19  5:32 ` 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

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

  git send-email \
    --in-reply-to=83o88jvity.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=50666@debbugs.gnu.org \
    --cc=Stromeko@nexgo.de \
    --cc=akrl@sdf.org \
    --cc=kbrown@cornell.edu \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.