* native-comp write path?
@ 2022-02-12 13:38 Yuri D'Elia
2022-02-12 14:14 ` Yuri D'Elia
2022-02-12 17:51 ` Eli Zaretskii
0 siblings, 2 replies; 7+ messages in thread
From: Yuri D'Elia @ 2022-02-12 13:38 UTC (permalink / raw)
To: emacs-devel
Is there a way to customize the place where user's elc-cache is
_written_ to?
I'd like to move the directory inside the XDG_CACHE hierarchy without
using symlinks.
I tried to change native-comp-eln-load-path inside early-init, but if I
inspect the value after starting emacs I see that the default value is
_prepended_ to my preferred directory:
native-comp-eln-load-path
("/h/y/.config/emacs/eln-cache/" "/h/y/.cache/emacs/eln-cache/")
I had the impression that this used to work up until recently.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: native-comp write path?
2022-02-12 13:38 native-comp write path? Yuri D'Elia
@ 2022-02-12 14:14 ` Yuri D'Elia
2022-02-12 17:51 ` Eli Zaretskii
1 sibling, 0 replies; 7+ messages in thread
From: Yuri D'Elia @ 2022-02-12 14:14 UTC (permalink / raw)
To: emacs-devel
On Sat, Feb 12 2022, Yuri D'Elia wrote:
> Is there a way to customize the place where user's elc-cache is
> _written_ to?
Ha, I've just seen this has been added two days ago :)
Sorry for the noise.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: native-comp write path?
2022-02-12 13:38 native-comp write path? Yuri D'Elia
2022-02-12 14:14 ` Yuri D'Elia
@ 2022-02-12 17:51 ` Eli Zaretskii
2022-02-12 17:59 ` Stefan Monnier
1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2022-02-12 17:51 UTC (permalink / raw)
To: Yuri D'Elia; +Cc: emacs-devel
> From: Yuri D'Elia <wavexx@thregr.org>
> Date: Sat, 12 Feb 2022 14:38:29 +0100
>
> Is there a way to customize the place where user's elc-cache is
> _written_ to?
Yes, as you've seen.
> I'd like to move the directory inside the XDG_CACHE hierarchy
IMO, this is a mistake: the eln-cache is supposed to be more
persistent than XDG_CACHE, and even more than the entire XDG
hierarchy. It isn't really a "cache" in the XDG sense.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: native-comp write path?
2022-02-12 17:51 ` Eli Zaretskii
@ 2022-02-12 17:59 ` Stefan Monnier
2022-02-12 19:12 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2022-02-12 17:59 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Yuri D'Elia, emacs-devel
>> I'd like to move the directory inside the XDG_CACHE hierarchy
> IMO, this is a mistake: the eln-cache is supposed to be more
> persistent than XDG_CACHE, and even more than the entire XDG
> hierarchy. It isn't really a "cache" in the XDG sense.
Really? I thought the main defining feature of "cache" is that any of
those files can be thrown away an the system will work as well (tho
potentially a bit less efficiently) and the files will/can be
transparently re-generated if/when needed.
The files in eln-cache seem to fit the description.
Or is XDG's cache not expected to survive a login session?
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: native-comp write path?
2022-02-12 17:59 ` Stefan Monnier
@ 2022-02-12 19:12 ` Eli Zaretskii
2022-02-12 19:40 ` Stefan Monnier
2022-02-12 21:18 ` Yuri D'Elia
0 siblings, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 2022-02-12 19:12 UTC (permalink / raw)
To: Stefan Monnier; +Cc: wavexx, emacs-devel
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Yuri D'Elia <wavexx@thregr.org>, emacs-devel@gnu.org
> Date: Sat, 12 Feb 2022 12:59:08 -0500
>
> >> I'd like to move the directory inside the XDG_CACHE hierarchy
> > IMO, this is a mistake: the eln-cache is supposed to be more
> > persistent than XDG_CACHE, and even more than the entire XDG
> > hierarchy. It isn't really a "cache" in the XDG sense.
>
> Really? I thought the main defining feature of "cache" is that any of
> those files can be thrown away an the system will work as well (tho
> potentially a bit less efficiently) and the files will/can be
> transparently re-generated if/when needed.
>
> The files in eln-cache seem to fit the description.
The *.eln files don't need to be updated as long as you don't modify
the corresponding *.el files. This means that, for an Emacs built and
installed using the default procedure, the eln-cache will quickly fill
up with compiled *.el files from the Emacs distribution that you
frequently use. If those *.eln files are removed, Emacs will
recompile them upon next startup, which might take a few minutes
during which Emacs will be more sluggish than usually (because JIT
native compilation by default uses half of the system's execution
units).
If you don't care about this, maybe it's okay to move the *.eln files
to the XDG cache. But you need to understand the affects of this.
> Or is XDG's cache not expected to survive a login session?
I think it can disappear when you log off. Which is also something to
keep in mind: your Emacs will compile the same files time and again
each login.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: native-comp write path?
2022-02-12 19:12 ` Eli Zaretskii
@ 2022-02-12 19:40 ` Stefan Monnier
2022-02-12 21:18 ` Yuri D'Elia
1 sibling, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2022-02-12 19:40 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: wavexx, emacs-devel
>> Or is XDG's cache not expected to survive a login session?
> I think it can disappear when you log off.
Ah... if that's the case, then indeed it's a poor choice for eln-cache.
I can't seem to find clear docs about it.
I see mentions of "equivalent to /var/cache", which would work well for
us since `/var/cache` is normally never cleared even after a reboot.
`ls -R ~/.cache` shows I have files from 2020 in my `.cache` even though
I rebooted this machine 2 months ago.
So empirically, it doesn't seem inappropriate on my (Debian +
XFCE4) system.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: native-comp write path?
2022-02-12 19:12 ` Eli Zaretskii
2022-02-12 19:40 ` Stefan Monnier
@ 2022-02-12 21:18 ` Yuri D'Elia
1 sibling, 0 replies; 7+ messages in thread
From: Yuri D'Elia @ 2022-02-12 21:18 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Stefan Monnier, emacs-devel
On Sat, Feb 12 2022, Eli Zaretskii wrote:
> The *.eln files don't need to be updated as long as you don't modify
> the corresponding *.el files. This means that, for an Emacs built and
> installed using the default procedure, the eln-cache will quickly fill
> up with compiled *.el files from the Emacs distribution that you
> frequently use. If those *.eln files are removed, Emacs will
> recompile them upon next startup, which might take a few minutes
> during which Emacs will be more sluggish than usually (because JIT
> native compilation by default uses half of the system's execution
> units).
>
> If you don't care about this, maybe it's okay to move the *.eln files
> to the XDG cache. But you need to understand the affects of this.
I was fully aware of this.
In my case, ~/.cache is excluded from backups, however I'm not using any
DE, so nobody is going to remove that automatically. It makes perfect
sense for me to move it there instead of adding another exclusion.
I wonder which DE and/or environment deletes ~/.cache?
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-02-12 21:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-12 13:38 native-comp write path? Yuri D'Elia
2022-02-12 14:14 ` Yuri D'Elia
2022-02-12 17:51 ` Eli Zaretskii
2022-02-12 17:59 ` Stefan Monnier
2022-02-12 19:12 ` Eli Zaretskii
2022-02-12 19:40 ` Stefan Monnier
2022-02-12 21:18 ` Yuri D'Elia
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.