Subject: Re: bug#74202: 31.0.50; package-el fails to delete outdated elpa packages

From: Johann Höchtl <[email-masked]>
Date: Mon, 4 Nov 2024 14:37:17 +0100

Dear Eli,

thank you for your response(s). I understand that this build is not
officially supported. Upon further investigation I think the culprit is
likely UCRT, as the directories are created without write permissions.
Former versions of Emacs, which used a different C runtime, created
directories with read/write permissions.

Therefore I will report the issue at the appropriate build site.

Best, Johann

Am Mo., 4. Nov. 2024 um 14:11 Uhr schrieb Eli Zaretskii <[email-masked]>:

> [Please don't change the Subject of the responses and followups.]
>
> > From: Johann Höchtl <[email-masked]>
> > Date: Mon, 4 Nov 2024 09:06:12 +0100
> >
> > The full error message is:
> >
> > Error when expiring the cache: (permission-denied Removing directory
> Permission denied
> > c:/Users/HoechtlJ/OneDrive - WKO
> Online/Dokumente/.emacs.d/url/cache/HoechtlJ/https/org/gnu/www)
>
> What is the Lisp code which triggers this error message?  IOW, please
> show the Lisp code which "expires the cache".
>
> > The directory unfortunately contains blanks, so it's possibly not a
> permission error at all but emacs actually
> > trying to delete another directory but the one for which the error
> message gets printed?
>
> Why would blanks in the directory name cause Emacs to try to delete a
> different directory?  Emacs doesn't delete directories via the shell,
> where this could be a problem, it deletes them by calling Windows
> APIs.
>
> Since this directory seems to be on OneDrive, I suspect that these are
> not "normal" Windows files, but some kind of junction points or some
> other filesystem wizardry that Emacs doesn't understand.  Please try
> producing a standalone self-contained recipe for reproducing the
> problem starting from "emacs -Q", preferably without installing any
> ELPA packages.  Since the issue is with removing files from a
> directory, presumably the problem has nothing to do with package.el
> per se, but with basic file I/O, and so you should be able to find a
> way of reproducing it by simply removing files from a directory,
> perhaps if the directory is on OneDrive.
>