* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
@ 2020-09-20 13:02 Jim Myhrberg
2020-09-21 7:53 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
` (3 more replies)
0 siblings, 4 replies; 42+ messages in thread
From: Jim Myhrberg @ 2020-09-20 13:02 UTC (permalink / raw)
To: 43532
Hi,
TL;DR:
If I've understood correctly, the filename of the cached *.eln files
includes a hash based on the absolute file path and content of the
source *.el/*.el.gz file. On macOS when producing a self-contained
Emacs.app bundle this means that the cached *.eln files bundled into
the app cannot be used, as their absolute path won't match what they
were during build time. And app bundles on macOS can be placed and
launched from anywhere on disk.
I'm not sure what the best solution here might be. But if the actual
content of the file is used to produce the hash, maybe there's no need
to use the full absolute file path, and instead just the filename
itself, along with the content?
The Long Version:
I'm not sure how familiar people here might be with macOS application
bundles, so here's a brief summary just in case; Application bundles
are self-contained macOS GUI applications which can be launched by for
example double clicking on them, among other ways. On a technical
level, they're simply a folder called "<AppName>.app" which contains
all assets needed to run the application. The main executable is
"<AppName>.app/Contents/MacOS/<AppName>".
In the case of building a self-contained Emacs.app on macOS, it looks
the *.eln caches are generated for the files located in
"<workdir>/nextstep/Emacs.app/Contents/Resources/lisp", and the *.eln
cache folder is
"<workdir>/nextstep/Emacs.app/Contents/MacOS/lib/emacs/28.0.50/native-lisp".
Which means the full set of *.eln caches can only be used when
launched from within the Emacs source directory where you built the
application.
Typical usage on macOS would have the Emacs.app movied/copied to the
"/Applications" folder, but there's no guarantee about that, as
applications are supposed work fine regardless of where it's located
on disk they're located.
I've done some tests while using NATIVE_FULL_AOT=1, which produces
1,572 *.eln files within Emacs.app. But when starting emacs with my
config, it starts by compiling a whole bunch of files from
"Emacs.app/Contents/Resources/lisp/", like "emacs-lisp/cconv.el.gz",
"emacs-lisp/bytecomp.el.gz", "help-mode.el.gz", and others. If I grab
the new *.eln files it produced in my user cache, and move them to
within Emacs.app, it doesn't compile them on launch again. If I then
move Emacs.app to another location on disk, it does compile them
again, as the absolute path has changed.
However there's 83 *.eln files which are loaded from Emacs.app,
because if they're removed, it fails to start at all with a dlopen
error instead. I don't know enough about the internals of Emacs, but
I'd assume they are referred to from the dump file, while the others
are loaded up due to my config requiring them, at which point a cache
miss happens due to the absolute path yielding a different change
filename.
Thanks :)
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-20 13:02 bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS Jim Myhrberg
@ 2020-09-21 7:53 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 9:19 ` Jim Myhrberg
2020-09-29 15:52 ` bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, " Aloxaf
` (2 subsequent siblings)
3 siblings, 1 reply; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-09-21 7:53 UTC (permalink / raw)
To: Jim Myhrberg; +Cc: 43532
Jim Myhrberg <contact@jimeh.me> writes:
> Hi,
>
> TL;DR:
>
> If I've understood correctly, the filename of the cached *.eln files
> includes a hash based on the absolute file path and content of the
> source *.el/*.el.gz file. On macOS when producing a self-contained
> Emacs.app bundle this means that the cached *.eln files bundled into
> the app cannot be used, as their absolute path won't match what they
> were during build time. And app bundles on macOS can be placed and
> launched from anywhere on disk.
Hi Jim,
I think we should be able to improve the filename hashing mechanism on
MacOS to deal with that. Perhaps something like removing
*/Emacs.app/Contents/MacOS/ from the input of it.
Could you post the value of PATH_DUMPLOADSEARCH and PATH_LOADSEARCH
macros? You should find them defined in epaths.h in your build
directory.
Thanks
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-21 7:53 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-09-21 9:19 ` Jim Myhrberg
2020-09-21 10:26 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 42+ messages in thread
From: Jim Myhrberg @ 2020-09-21 9:19 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 43532
Here they are:
#define PATH_LOADSEARCH
"/Users/jimeh/Projects/build-emacs-for-macos/sources/emacs-mirror-emacs-5b41545/nextstep/Emacs.app/Contents/Resources/lisp"
#define PATH_DUMPLOADSEARCH
"/Users/jimeh/Projects/build-emacs-for-macos/sources/emacs-mirror-emacs-5b41545/lisp"
"/Users/jimeh/Projects/build-emacs-for-macos/sources/emacs-mirror-emacs-5b41545"
is obviously my local source/build directory that my build script
extracts the source tarball to and builds from.
On Mon, Sep 21, 2020 at 8:53 AM Andrea Corallo <akrl@sdf.org> wrote:
>
> Jim Myhrberg <contact@jimeh.me> writes:
>
> > Hi,
> >
> > TL;DR:
> >
> > If I've understood correctly, the filename of the cached *.eln files
> > includes a hash based on the absolute file path and content of the
> > source *.el/*.el.gz file. On macOS when producing a self-contained
> > Emacs.app bundle this means that the cached *.eln files bundled into
> > the app cannot be used, as their absolute path won't match what they
> > were during build time. And app bundles on macOS can be placed and
> > launched from anywhere on disk.
>
> Hi Jim,
>
> I think we should be able to improve the filename hashing mechanism on
> MacOS to deal with that. Perhaps something like removing
> */Emacs.app/Contents/MacOS/ from the input of it.
>
> Could you post the value of PATH_DUMPLOADSEARCH and PATH_LOADSEARCH
> macros? You should find them defined in epaths.h in your build
> directory.
>
> Thanks
>
> Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-21 9:19 ` Jim Myhrberg
@ 2020-09-21 10:26 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 13:02 ` Jim Myhrberg
0 siblings, 1 reply; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-09-21 10:26 UTC (permalink / raw)
To: Jim Myhrberg; +Cc: 43532
[-- Attachment #1: Type: text/plain, Size: 607 bytes --]
Jim Myhrberg <contact@jimeh.me> writes:
> Here they are:
>
> #define PATH_LOADSEARCH
> "/Users/jimeh/Projects/build-emacs-for-macos/sources/emacs-mirror-emacs-5b41545/nextstep/Emacs.app/Contents/Resources/lisp"
> #define PATH_DUMPLOADSEARCH
> "/Users/jimeh/Projects/build-emacs-for-macos/sources/emacs-mirror-emacs-5b41545/lisp"
>
> "/Users/jimeh/Projects/build-emacs-for-macos/sources/emacs-mirror-emacs-5b41545"
> is obviously my local source/build directory that my build script
> extracts the source tarball to and builds from.
Could you have a run with the attached blind patch?
Thanks
Andrea
[-- Attachment #2: macos-relpath.path --]
[-- Type: text/plain, Size: 552 bytes --]
diff --git a/src/comp.c b/src/comp.c
index 15d85d30fc..c51d13ade1 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4060,6 +4060,10 @@ DEFUN ("comp-el-to-eln-filename", Fcomp_el_to_eln_filename,
FOR_EACH_TAIL (loadsearch_list)
loadsearch_re_list =
Fcons (Fregexp_quote (XCAR (loadsearch_list)), loadsearch_re_list);
+ loadsearch_re_list =
+ Fcons (
+ build_string ("^[[:ascii:]]+/Emacs\\.app/Contents/Resources/lisp"),
+ loadsearch_re_list);
}
Lisp_Object loadsearch_res = loadsearch_re_list;
FOR_EACH_TAIL (loadsearch_res)
^ permalink raw reply related [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-21 10:26 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-09-21 13:02 ` Jim Myhrberg
2020-09-21 13:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 19:38 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 2 replies; 42+ messages in thread
From: Jim Myhrberg @ 2020-09-21 13:02 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 43532
That works perfectly. It's picking up all *.eln files from within
Emacs.app, regardless of where I place it on disk, and only generating
new *.eln files into my user cache for external packages I've
installed myself.
Thanks yet again for your help :)
On Mon, Sep 21, 2020 at 11:26 AM Andrea Corallo <akrl@sdf.org> wrote:
>
> Jim Myhrberg <contact@jimeh.me> writes:
>
> > Here they are:
> >
> > #define PATH_LOADSEARCH
> > "/Users/jimeh/Projects/build-emacs-for-macos/sources/emacs-mirror-emacs-5b41545/nextstep/Emacs.app/Contents/Resources/lisp"
> > #define PATH_DUMPLOADSEARCH
> > "/Users/jimeh/Projects/build-emacs-for-macos/sources/emacs-mirror-emacs-5b41545/lisp"
> >
> > "/Users/jimeh/Projects/build-emacs-for-macos/sources/emacs-mirror-emacs-5b41545"
> > is obviously my local source/build directory that my build script
> > extracts the source tarball to and builds from.
>
> Could you have a run with the attached blind patch?
>
> Thanks
>
> Andrea
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-21 13:02 ` Jim Myhrberg
@ 2020-09-21 13:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 18:54 ` Jim Myhrberg
2020-09-21 19:38 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 1 reply; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-09-21 13:41 UTC (permalink / raw)
To: Jim Myhrberg; +Cc: 43532
Jim Myhrberg <contact@jimeh.me> writes:
> That works perfectly. It's picking up all *.eln files from within
> Emacs.app, regardless of where I place it on disk, and only generating
> new *.eln files into my user cache for external packages I've
> installed myself.
>
> Thanks yet again for your help :)
Welcome :) I'll rewrite it a little more decently and push it soon. We
can keep the bug open since it's there.
Thanks
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-21 13:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-09-21 18:54 ` Jim Myhrberg
0 siblings, 0 replies; 42+ messages in thread
From: Jim Myhrberg @ 2020-09-21 18:54 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 43532
I was just reminded by someone on GitHub that the "Emacs.app"
application can be renamed to anything by users. So I think we
probably need to effectively match against and remove
"^.*\.app\/Contents\/Resources\/lisp", basically wildcare anything
before the ".app" part.
Sorry I didn't think of this earlier myself >_<
On Mon, Sep 21, 2020 at 2:41 PM Andrea Corallo <akrl@sdf.org> wrote:
>
> Jim Myhrberg <contact@jimeh.me> writes:
>
> > That works perfectly. It's picking up all *.eln files from within
> > Emacs.app, regardless of where I place it on disk, and only generating
> > new *.eln files into my user cache for external packages I've
> > installed myself.
> >
> > Thanks yet again for your help :)
>
> Welcome :) I'll rewrite it a little more decently and push it soon. We
> can keep the bug open since it's there.
>
> Thanks
>
> Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-21 13:02 ` Jim Myhrberg
2020-09-21 13:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-09-21 19:38 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 21:17 ` Jim Myhrberg
1 sibling, 1 reply; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-09-21 19:38 UTC (permalink / raw)
To: Jim Myhrberg; +Cc: 43532
Hi Jim,
could you check what I've pushed to scratch/native-comp-macos-43532
works for you?
I've done what I could to test it but is not much as I'm not on MacOS.
Thanks
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-21 19:38 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-09-21 21:17 ` Jim Myhrberg
2020-09-21 22:40 ` Jim Myhrberg
2020-09-22 7:58 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 2 replies; 42+ messages in thread
From: Jim Myhrberg @ 2020-09-21 21:17 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 43532
Hi Andrea,
I've just tested that branch, and I'm afraid it doesn't work. It
starts native compiling cconv.el and others like before. Looking at
the changes, I believe it's looking for "Emacs.app" within
PATH_DUMPLOADSEARCH, which didn't actually contain that in my build
directory, it was PATH_LOADSEARCH that did. So currently that branch
doesn't find the bundled *.eln files even when the app is named
"Emacs.app".
And annoyingly we also need to support it if the user renames the app
to something else, like "Emacs 28.app", or "Emacs Native.app", or even
something crazy like "fooBar! LaLa.app".
My knowledge of C is mostly non-existent, but in an effort to reduce
the feedback loop and not take up too much of your time, I'll try some
guess-based tweaks and see if I have any success :)
Thanks again :)
On Mon, Sep 21, 2020 at 8:38 PM Andrea Corallo <akrl@sdf.org> wrote:
>
> Hi Jim,
>
> could you check what I've pushed to scratch/native-comp-macos-43532
> works for you?
>
> I've done what I could to test it but is not much as I'm not on MacOS.
>
> Thanks
>
> Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-21 21:17 ` Jim Myhrberg
@ 2020-09-21 22:40 ` Jim Myhrberg
2020-09-22 7:58 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 0 replies; 42+ messages in thread
From: Jim Myhrberg @ 2020-09-21 22:40 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 43532
I'm afraid I've tried all the guess-based tweaks I can think of
without any luck, mostly just changing the two PATH_* variables
around.
On Mon, Sep 21, 2020 at 10:17 PM Jim Myhrberg <contact@jimeh.me> wrote:
>
> Hi Andrea,
>
> I've just tested that branch, and I'm afraid it doesn't work. It
> starts native compiling cconv.el and others like before. Looking at
> the changes, I believe it's looking for "Emacs.app" within
> PATH_DUMPLOADSEARCH, which didn't actually contain that in my build
> directory, it was PATH_LOADSEARCH that did. So currently that branch
> doesn't find the bundled *.eln files even when the app is named
> "Emacs.app".
>
> And annoyingly we also need to support it if the user renames the app
> to something else, like "Emacs 28.app", or "Emacs Native.app", or even
> something crazy like "fooBar! LaLa.app".
>
> My knowledge of C is mostly non-existent, but in an effort to reduce
> the feedback loop and not take up too much of your time, I'll try some
> guess-based tweaks and see if I have any success :)
>
> Thanks again :)
>
> On Mon, Sep 21, 2020 at 8:38 PM Andrea Corallo <akrl@sdf.org> wrote:
> >
> > Hi Jim,
> >
> > could you check what I've pushed to scratch/native-comp-macos-43532
> > works for you?
> >
> > I've done what I could to test it but is not much as I'm not on MacOS.
> >
> > Thanks
> >
> > Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-21 21:17 ` Jim Myhrberg
2020-09-21 22:40 ` Jim Myhrberg
@ 2020-09-22 7:58 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 9:43 ` Jim Myhrberg
1 sibling, 1 reply; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-09-22 7:58 UTC (permalink / raw)
To: Jim Myhrberg; +Cc: 43532
Jim Myhrberg <contact@jimeh.me> writes:
> Hi Andrea,
>
> I've just tested that branch, and I'm afraid it doesn't work. It
> starts native compiling cconv.el and others like before. Looking at
> the changes, I believe it's looking for "Emacs.app" within
> PATH_DUMPLOADSEARCH, which didn't actually contain that in my build
> directory, it was PATH_LOADSEARCH that did. So currently that branch
> doesn't find the bundled *.eln files even when the app is named
> "Emacs.app".
>
> And annoyingly we also need to support it if the user renames the app
> to something else, like "Emacs 28.app", or "Emacs Native.app", or even
> something crazy like "fooBar! LaLa.app".
>
> My knowledge of C is mostly non-existent, but in an effort to reduce
> the feedback loop and not take up too much of your time, I'll try some
> guess-based tweaks and see if I have any success :)
>
> Thanks again :)
Hi Jim,
apologies to a quick look I've inverted PATH_LOADSEARCH and
PATH_DUMPLOADSEARCH in the code :/
I've also addressed the *.app suggestion (yesterday I've missed your
mail).
Lets see if I got it right now.
Thanks
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-22 7:58 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-09-22 9:43 ` Jim Myhrberg
2020-09-22 10:21 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 42+ messages in thread
From: Jim Myhrberg @ 2020-09-22 9:43 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 43532
HI Andrea,
I'm afraid it's still not picking up the *.eln files from within the
app bundle. I tried inverting those two variables myself last night
without any luck.
Anything I can check on my end to yield some more light on what's going on?
On Tue, Sep 22, 2020 at 8:59 AM Andrea Corallo <akrl@sdf.org> wrote:
>
> Jim Myhrberg <contact@jimeh.me> writes:
>
> > Hi Andrea,
> >
> > I've just tested that branch, and I'm afraid it doesn't work. It
> > starts native compiling cconv.el and others like before. Looking at
> > the changes, I believe it's looking for "Emacs.app" within
> > PATH_DUMPLOADSEARCH, which didn't actually contain that in my build
> > directory, it was PATH_LOADSEARCH that did. So currently that branch
> > doesn't find the bundled *.eln files even when the app is named
> > "Emacs.app".
> >
> > And annoyingly we also need to support it if the user renames the app
> > to something else, like "Emacs 28.app", or "Emacs Native.app", or even
> > something crazy like "fooBar! LaLa.app".
> >
> > My knowledge of C is mostly non-existent, but in an effort to reduce
> > the feedback loop and not take up too much of your time, I'll try some
> > guess-based tweaks and see if I have any success :)
> >
> > Thanks again :)
>
> Hi Jim,
>
> apologies to a quick look I've inverted PATH_LOADSEARCH and
> PATH_DUMPLOADSEARCH in the code :/
>
> I've also addressed the *.app suggestion (yesterday I've missed your
> mail).
>
> Lets see if I got it right now.
>
> Thanks
>
> Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-22 9:43 ` Jim Myhrberg
@ 2020-09-22 10:21 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 11:37 ` Jim Myhrberg
0 siblings, 1 reply; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-09-22 10:21 UTC (permalink / raw)
To: Jim Myhrberg; +Cc: 43532
Jim Myhrberg <contact@jimeh.me> writes:
> HI Andrea,
>
> I'm afraid it's still not picking up the *.eln files from within the
> app bundle. I tried inverting those two variables myself last night
> without any luck.
>
> Anything I can check on my end to yield some more light on what's going on?
Glab, it may work now please have a run when you've time, apologies for
the back and forward.
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-22 10:21 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-09-22 11:37 ` Jim Myhrberg
2020-09-22 13:00 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 42+ messages in thread
From: Jim Myhrberg @ 2020-09-22 11:37 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 43532
We have success :D
It now works and picks up the bundled *.eln files regardless of where
I place the app bundle or what I rename it to.
Thanks again, and, no, I'm sorry for the back and forth. You're the
one fixing stuff for me :)
On Tue, Sep 22, 2020 at 11:21 AM Andrea Corallo <akrl@sdf.org> wrote:
>
> Jim Myhrberg <contact@jimeh.me> writes:
>
> > HI Andrea,
> >
> > I'm afraid it's still not picking up the *.eln files from within the
> > app bundle. I tried inverting those two variables myself last night
> > without any luck.
> >
> > Anything I can check on my end to yield some more light on what's going on?
>
> Glab, it may work now please have a run when you've time, apologies for
> the back and forward.
>
> Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS
2020-09-22 11:37 ` Jim Myhrberg
@ 2020-09-22 13:00 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-09-22 13:00 UTC (permalink / raw)
To: Jim Myhrberg; +Cc: 43532-done
Jim Myhrberg <contact@jimeh.me> writes:
> We have success :D
Amazing, see was easy :D
I've pushed it as 4a50f54144 so I'm closing this.
Thanks for reporting and your patience in testing the fix.
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-09-20 13:02 bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS Jim Myhrberg
2020-09-21 7:53 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-09-29 15:52 ` Aloxaf
2020-09-29 18:46 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-14 0:12 ` Andrew Whatson
2020-10-15 6:52 ` bug#43532: [PATCH] Fix timestamp check when loading from eln (bug #43532) Andrew Whatson
3 siblings, 1 reply; 42+ messages in thread
From: Aloxaf @ 2020-09-29 15:52 UTC (permalink / raw)
To: 43532
[-- Attachment #1: Type: text/plain, Size: 776 bytes --]
Hello,
Sorry for disturbing you. In fact, this bug not only affects macOS. I am
an Arch Linux user and install native-comp branch by AUR package
emacs-native-comp-git
(https://aur.archlinux.org/packages/emacs-native-comp-git/). It will
build and install the whole package in a temporary directory and then
pack the directory to a standalone package. So I also suffer from this bug.
For example, in my computer, the package will be built in $srcdir (
/tmp/makepkg/emacs-native-comp-git/src ), and will be installed to
$pkgdir ( /tmp/makepkg/emacs-native-comp-git/pkg/emacs-native-comp-git
). Then the whole $pkgdir will be packed into a package.
You can find more information here:
https://wiki.archlinux.org/index.php/Creating_packages#package()
Thanks,
Aloxaf
[-- Attachment #2: Type: text/html, Size: 1356 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-09-29 15:52 ` bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, " Aloxaf
@ 2020-09-29 18:46 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-29 19:48 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-09-29 18:46 UTC (permalink / raw)
To: Aloxaf; +Cc: 43532
Aloxaf <aloxafx@gmail.com> writes:
> Hello,
>
> Sorry for disturbing you. In fact, this bug not only affects macOS. I am an Arch Linux user and install native-comp
> branch by AUR package emacs-native-comp-git (https://aur.archlinux.org/packages/emacs-native-comp-git/). It will build
> and install the whole package in a temporary directory and then pack the directory to a standalone package. So I also
> suffer from this bug.
>
> For example, in my computer, the package will be built in $srcdir ( /tmp/makepkg/emacs-native-comp-git/src ), and will be
> installed to $pkgdir ( /tmp/makepkg/emacs-native-comp-git/pkg/emacs-native-comp-git ). Then the whole $pkgdir will be
> packed into a package.
>
> You can find more information here: https://wiki.archlinux.org/index.php/Creating_packages#package()
>
> Thanks,
Hi Aloxaf,
no disturb I see.
I think I should be able to rework it for a sulution that is not MacOS
specific but generic. I'll come up with a patch.
Thanks
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-09-20 13:02 bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS Jim Myhrberg
2020-09-21 7:53 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-29 15:52 ` bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, " Aloxaf
@ 2020-10-14 0:12 ` Andrew Whatson
2020-10-14 6:57 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-15 6:52 ` bug#43532: [PATCH] Fix timestamp check when loading from eln (bug #43532) Andrew Whatson
3 siblings, 1 reply; 42+ messages in thread
From: Andrew Whatson @ 2020-10-14 0:12 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 43532, Jim Myhrberg, Aloxaf Yin
Hi Andrea,
I see similar problems with my Guix builds of emacs-native-comp. I
run with deferred compilation disabled, so the native versions of core
elisp packages are simply not loaded.
As a workaround, I've had success copying
`/path/to/emacs/lib/emacs/28.0.50/native-lisp/.../*.eln` into
`~/.emacs.d/eln-cache/.../`. The native-compiled code is then loaded
correctly as expected.
Perhaps this helps to narrow down the problem; seems it's not a
hashing problem, but a load-path one?
Cheers,
Andrew
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-10-14 0:12 ` Andrew Whatson
@ 2020-10-14 6:57 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-15 9:38 ` Andrew Whatson
0 siblings, 1 reply; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-14 6:57 UTC (permalink / raw)
To: Andrew Whatson; +Cc: 43532, Jim Myhrberg, Aloxaf Yin
Andrew Whatson <whatson@gmail.com> writes:
> Hi Andrea,
>
> I see similar problems with my Guix builds of emacs-native-comp. I
> run with deferred compilation disabled, so the native versions of core
> elisp packages are simply not loaded.
>
> As a workaround, I've had success copying
> `/path/to/emacs/lib/emacs/28.0.50/native-lisp/.../*.eln` into
> `~/.emacs.d/eln-cache/.../`. The native-compiled code is then loaded
> correctly as expected.
>
> Perhaps this helps to narrow down the problem; seems it's not a
> hashing problem, but a load-path one?
Hi Andrew,
from where I stand I don't see why it should not work so I'll have to
recreate the problem here and have a look. I'll try to do it this week.
Thanks!
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-10-14 6:57 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-15 9:38 ` Andrew Whatson
2020-10-15 10:54 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 42+ messages in thread
From: Andrew Whatson @ 2020-10-15 9:38 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 43532, Jim Myhrberg, Aloxaf Yin
Hi Andrea,
I added some debug messages to the loading procedure and determined
that the files were ignored because the timestamp check required the
eln to be newer than the source file. This makes sense when running
from the build directory or when the eln's are built with deferred
compilation, but doesn't work for packaging where they're usually
installed with the same timestamp.
Though the fix is trivial, I wonder whether a timestamp check is
needed at all. If we're already hashing the contents of the source
file, perhaps that's sufficient to detect when things are outdated?
Cheers,
Andrew
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-10-15 9:38 ` Andrew Whatson
@ 2020-10-15 10:54 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-15 12:04 ` Andrew Whatson
0 siblings, 1 reply; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-15 10:54 UTC (permalink / raw)
To: Andrew Whatson; +Cc: 43532, Jim Myhrberg, Aloxaf Yin
Andrew Whatson <whatson@gmail.com> writes:
> Hi Andrea,
>
> I added some debug messages to the loading procedure and determined
> that the files were ignored because the timestamp check required the
> eln to be newer than the source file. This makes sense when running
> from the build directory or when the eln's are built with deferred
> compilation, but doesn't work for packaging where they're usually
> installed with the same timestamp.
>
> Though the fix is trivial, I wonder whether a timestamp check is
> needed at all. If we're already hashing the contents of the source
> file, perhaps that's sufficient to detect when things are outdated?
Hi Andrew,
thanks for investigating!
yes you are correct, the system is over-constrained and I believe too
the timestamp is not anymore necessary now that we hash the file content
to verify the .el -> .eln relation.
I've pushed the following.
03dfa83dc3 * Do not check eln timestamp as superseded by source hashing (bug#43532)
Let us know if the issue is solved.
Thanks!
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-10-15 10:54 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-15 12:04 ` Andrew Whatson
2020-10-15 12:56 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 42+ messages in thread
From: Andrew Whatson @ 2020-10-15 12:04 UTC (permalink / raw)
To: Andrea Corallo; +Cc: 43532, Jim Myhrberg, Aloxaf Yin
On Thu, 15 Oct 2020 at 20:54, Andrea Corallo <akrl@sdf.org> wrote:
> I've pushed the following.
>
> 03dfa83dc3 * Do not check eln timestamp as superseded by source hashing (bug#43532)
>
> Let us know if the issue is solved.
Yes, this is now working properly for me, thanks!
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-10-15 12:04 ` Andrew Whatson
@ 2020-10-15 12:56 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-15 13:11 ` Jim Myhrberg
2020-10-15 14:51 ` Aloxaf Yin
0 siblings, 2 replies; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-15 12:56 UTC (permalink / raw)
To: Andrew Whatson; +Cc: 43532, Jim Myhrberg, Aloxaf Yin
Andrew Whatson <whatson@gmail.com> writes:
> On Thu, 15 Oct 2020 at 20:54, Andrea Corallo <akrl@sdf.org> wrote:
>
>> I've pushed the following.
>>
>> 03dfa83dc3 * Do not check eln timestamp as superseded by source hashing (bug#43532)
>>
>> Let us know if the issue is solved.
>
> Yes, this is now working properly for me, thanks!
Great, lets see Aloxaf feedback.
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-10-15 12:56 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-10-15 13:11 ` Jim Myhrberg
2020-10-15 14:51 ` Aloxaf Yin
1 sibling, 0 replies; 42+ messages in thread
From: Jim Myhrberg @ 2020-10-15 13:11 UTC (permalink / raw)
To: Andrea Corallo; +Cc: Andrew Whatson, 43532, Aloxaf Yin
For what it's worth, things still work just fine on macOS with commit 03dfa83 :)
On Thu, Oct 15, 2020 at 1:56 PM Andrea Corallo <akrl@sdf.org> wrote:
>
> Andrew Whatson <whatson@gmail.com> writes:
>
> > On Thu, 15 Oct 2020 at 20:54, Andrea Corallo <akrl@sdf.org> wrote:
> >
> >> I've pushed the following.
> >>
> >> 03dfa83dc3 * Do not check eln timestamp as superseded by source hashing (bug#43532)
> >>
> >> Let us know if the issue is solved.
> >
> > Yes, this is now working properly for me, thanks!
>
> Great, lets see Aloxaf feedback.
>
> Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-10-15 12:56 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-15 13:11 ` Jim Myhrberg
@ 2020-10-15 14:51 ` Aloxaf Yin
2020-10-15 15:02 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 1 reply; 42+ messages in thread
From: Aloxaf Yin @ 2020-10-15 14:51 UTC (permalink / raw)
To: Andrea Corallo; +Cc: Andrew Whatson, 43532, Jim Myhrberg
It works well. Thank you all!
Andrea Corallo <akrl@sdf.org> 于2020年10月15日周四 下午8:56写道:
>
> Andrew Whatson <whatson@gmail.com> writes:
>
> > On Thu, 15 Oct 2020 at 20:54, Andrea Corallo <akrl@sdf.org> wrote:
> >
> >> I've pushed the following.
> >>
> >> 03dfa83dc3 * Do not check eln timestamp as superseded by source hashing (bug#43532)
> >>
> >> Let us know if the issue is solved.
> >
> > Yes, this is now working properly for me, thanks!
>
> Great, lets see Aloxaf feedback.
>
> Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, Emacs.app builds for macOS
2020-10-15 14:51 ` Aloxaf Yin
@ 2020-10-15 15:02 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 42+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-10-15 15:02 UTC (permalink / raw)
To: Aloxaf Yin; +Cc: Andrew Whatson, 43532-done, Jim Myhrberg
Aloxaf Yin <aloxafx@gmail.com> writes:
> It works well. Thank you all!
Excellent! I'm closing then :)
Andrea
^ permalink raw reply [flat|nested] 42+ messages in thread
* bug#43532: [PATCH] Fix timestamp check when loading from eln (bug #43532)
2020-09-20 13:02 bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS Jim Myhrberg
` (2 preceding siblings ...)
2020-10-14 0:12 ` Andrew Whatson
@ 2020-10-15 6:52 ` Andrew Whatson
3 siblings, 0 replies; 42+ messages in thread
From: Andrew Whatson @ 2020-10-15 6:52 UTC (permalink / raw)
To: 43532, Andrea Corallo; +Cc: Andrew Whatson
* src/lread.c (maybe_swap_for_eln): Allow eln files to have the
same timestamp as their source file.
---
src/lread.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lread.c b/src/lread.c
index ea31131b75..ab16fdadb4 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1622,7 +1622,7 @@ maybe_swap_for_eln (Lisp_Object *filename, int *fd, struct timespec mtime)
else
{
struct timespec eln_mtime = get_stat_mtime (&eln_st);
- if (timespec_cmp (eln_mtime, mtime) > 0)
+ if (timespec_cmp (eln_mtime, mtime) >= 0)
{
*filename = eln_name;
emacs_close (*fd);
--
2.28.0
^ permalink raw reply related [flat|nested] 42+ messages in thread
end of thread, other threads:[~2020-10-15 15:02 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-20 13:02 bug#43532: [feature/native-comp] *.eln file name hashing algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained Emacs.app builds for macOS Jim Myhrberg
2020-09-21 7:53 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 9:19 ` Jim Myhrberg
2020-09-21 10:26 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 13:02 ` Jim Myhrberg
2020-09-21 13:41 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 18:54 ` Jim Myhrberg
2020-09-21 19:38 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 21:17 ` Jim Myhrberg
2020-09-21 22:40 ` Jim Myhrberg
2020-09-22 7:58 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 9:43 ` Jim Myhrberg
2020-09-22 10:21 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 11:37 ` Jim Myhrberg
2020-09-22 13:00 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-29 15:52 ` bug#43532: [feature/native-comp] *.eln file name hashing, algorithm doesn't seem to play nice with NATIVE_FULL_AOT and self-contained, " Aloxaf
2020-09-29 18:46 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-29 19:48 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
[not found] ` <CA+6YrQz8QcASrajz-+QVS5p68VPhQy1Me2T179CzXADn72WYXg@mail.gmail.com>
2020-09-30 7:13 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
[not found] ` <efd04f70-ced3-9978-2280-2bb41ca14a2f@gmail.com>
2020-10-01 13:19 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-01 15:01 ` Aloxaf
2020-10-01 15:40 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-04 18:04 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-04 19:54 ` Jim Myhrberg
2020-10-04 20:54 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-04 23:17 ` Jim Myhrberg
2020-10-05 6:56 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-05 9:57 ` Jim Myhrberg
2020-10-05 15:09 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-07 4:09 ` Aloxaf Yin
2020-10-07 15:00 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-08 3:40 ` Aloxaf Yin
2020-10-14 0:12 ` Andrew Whatson
2020-10-14 6:57 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-15 9:38 ` Andrew Whatson
2020-10-15 10:54 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-15 12:04 ` Andrew Whatson
2020-10-15 12:56 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-15 13:11 ` Jim Myhrberg
2020-10-15 14:51 ` Aloxaf Yin
2020-10-15 15:02 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-15 6:52 ` bug#43532: [PATCH] Fix timestamp check when loading from eln (bug #43532) Andrew Whatson
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.