unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44701: 28.0.50; [feature/native-comp] Use file-truename when building eln path hash
@ 2020-11-17  4:03 Tad
  2020-11-18  8:28 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 5+ messages in thread
From: Tad @ 2020-11-17  4:03 UTC (permalink / raw)
  To: 44701; +Cc: akrl

It appears that `comp-el-to-eln-filename` uses `expand-file-name` to
determine the absolute filename to
hash. When the filename is a symlink, this results in a cache miss
depending on which path is loaded.

`file-truename' would be the equivalent to `(expand-file-name name
nil)`, except that it would resolve to a
single canonical path (in the absence of hardlinks, which is pathological).

If I may ask, what is the purpose behind the path component of the
hash? I would think a content hash
would suffice to disambiguate files in the .el<->.eln bijection.

Thanks,
Tad





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#44701: 28.0.50; [feature/native-comp] Use file-truename when building eln path hash
  2020-11-17  4:03 bug#44701: 28.0.50; [feature/native-comp] Use file-truename when building eln path hash Tad
@ 2020-11-18  8:28 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-18 17:54   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 5+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-11-18  8:28 UTC (permalink / raw)
  To: Tad; +Cc: 44701

Hi Tad,

Tad <tadfisher@gmail.com> writes:

> It appears that `comp-el-to-eln-filename` uses `expand-file-name` to
> determine the absolute filename to
> hash. When the filename is a symlink, this results in a cache miss
> depending on which path is loaded.
>
> `file-truename' would be the equivalent to `(expand-file-name name
> nil)`, except that it would resolve to a
> single canonical path (in the absence of hardlinks, which is pathological).

It might be not 100% trivial as just calling `file-truename' from
`comp-el-to-eln-filename' in place of `expand-file-name'.  ATM I'm not
sure is good to call Lisp from there.  I'll give it a go.

> If I may ask, what is the purpose behind the path component of the
> hash? I would think a content hash
> would suffice to disambiguate files in the .el<->.eln bijection.

Sure we mainly use it to keep the eln-cache directory clean when
recompiling.

Thanks for reporting.

  Andrea





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#44701: 28.0.50; [feature/native-comp] Use file-truename when building eln path hash
  2020-11-18  8:28 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-11-18 17:54   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-18 20:52     ` Tad
  0 siblings, 1 reply; 5+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-11-18 17:54 UTC (permalink / raw)
  To: Tad; +Cc: 44701

Hi Tad,

could you verify 3ae309bd59 fix the issue for you?

Thanks!

  Andrea





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#44701: 28.0.50; [feature/native-comp] Use file-truename when building eln path hash
  2020-11-18 17:54   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-11-18 20:52     ` Tad
  2020-11-18 20:57       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 5+ messages in thread
From: Tad @ 2020-11-18 20:52 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: 44701

On Wed, Nov 18, 2020 at 9:54 AM Andrea Corallo <akrl@sdf.org> wrote:
>
> Hi Tad,
>
> could you verify 3ae309bd59 fix the issue for you?

Yes, this is working now. Here's a transcript:

    (comp-el-to-eln-filename
"/nix/store/...-emacs-ace-window-20200606.1259/share/emacs/site-lisp/elpa/ace-window-20200606.1259/ace-window.el")
    "/home/tad/.emacs.d/eln-cache/28.0.50-x86_64-pc-linux-gnu-6462edf10bdf79d2b67bce57511338e8/ace-window-d01e56e26487b663b5932fdce1c8c623-99728e8187c8762dea4b86e75d14412a.eln"

    (comp-el-to-eln-filename
"/nix/store/...-emacs-packages-deps/share/emacs/site-lisp/elpa/ace-window-20200606.1259/ace-window.el")
    "/home/tad/.emacs.d/eln-cache/28.0.50-x86_64-pc-linux-gnu-6462edf10bdf79d2b67bce57511338e8/ace-window-d01e56e26487b663b5932fdce1c8c623-99728e8187c8762dea4b86e75d14412a.eln"

This makes it possible to load AOT-compiled .eln files from the Nix
store, so thank you for implementing this change.

>
> Thanks!
>
>   Andrea





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#44701: 28.0.50; [feature/native-comp] Use file-truename when building eln path hash
  2020-11-18 20:52     ` Tad
@ 2020-11-18 20:57       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 5+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-11-18 20:57 UTC (permalink / raw)
  To: Tad; +Cc: 44701-done

Tad <tadfisher@gmail.com> writes:

> This makes it possible to load AOT-compiled .eln files from the Nix
> store, so thank you for implementing this change.

That's good to hear!  Thank you for reporting, closing.

  Andrea





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-18 20:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17  4:03 bug#44701: 28.0.50; [feature/native-comp] Use file-truename when building eln path hash Tad
2020-11-18  8:28 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-18 17:54   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-18 20:52     ` Tad
2020-11-18 20:57       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).