After some iterations of running of "make -j8 bootstrap && make -j8 check", my ~/src/emacs is filled with a lot of temporary directories: drwx------ 2 skangas skangas 4.0K 2021-04-27 03:50 emacs-testsuite-0B1nPY drwx------ 2 skangas skangas 4.0K 2021-04-26 12:01 emacs-testsuite-0Ei8cf drwx------ 2 skangas skangas 4.0K 2021-04-27 03:50 emacs-testsuite-0G40w3 drwx------ 2 skangas skangas 4.0K 2021-04-27 02:59 emacs-testsuite-0GcjNo drwx------ 2 skangas skangas 4.0K 2021-04-27 02:43 emacs-testsuite-0Gwmf7 drwx------ 2 skangas skangas 4.0K 2021-04-26 20:24 emacs-testsuite-0HYLcF drwx------ 2 skangas skangas 4.0K 2021-04-27 03:49 emacs-testsuite-0Iy0yX drwx------ 2 skangas skangas 4.0K 2021-04-26 12:01 emacs-testsuite-0JpgU6 I actually have 2922 of these directories. The content of one of these directories is: emacs-testsuite-xdgMCK └── 28.0.50-d25e21f7 └── subr--trampoline-63616c6c2d70726f63657373_call_process_0.eln 1 directory, 1 file Others are empty: emacs-testsuite-1HQfjD 0 directories, 0 files Every time I run "make -j8 check", I get another 584 of these directories. Could we do something to ensure these directories are always deleted?
Stefan Kangas wrote: > After some iterations of running of "make -j8 bootstrap && make -j8 > check", my ~/src/emacs is filled with a lot of temporary directories: > > drwx------ 2 skangas skangas 4.0K 2021-04-27 03:50 emacs-testsuite-0B1nPY As predicted in https://debbugs.gnu.org/47138#28 ? (I see that report is still open, BTW. Not saying it should be merged.)
Stefan Kangas <stefan@marxist.se> writes:
> After some iterations of running of "make -j8 bootstrap && make -j8
> check", my ~/src/emacs is filled with a lot of temporary directories:
>
> drwx------ 2 skangas skangas 4.0K 2021-04-27 03:50 emacs-testsuite-0B1nPY
> drwx------ 2 skangas skangas 4.0K 2021-04-26 12:01 emacs-testsuite-0Ei8cf
> drwx------ 2 skangas skangas 4.0K 2021-04-27 03:50 emacs-testsuite-0G40w3
> drwx------ 2 skangas skangas 4.0K 2021-04-27 02:59 emacs-testsuite-0GcjNo
> drwx------ 2 skangas skangas 4.0K 2021-04-27 02:43 emacs-testsuite-0Gwmf7
> drwx------ 2 skangas skangas 4.0K 2021-04-26 20:24 emacs-testsuite-0HYLcF
> drwx------ 2 skangas skangas 4.0K 2021-04-27 03:49 emacs-testsuite-0Iy0yX
> drwx------ 2 skangas skangas 4.0K 2021-04-26 12:01 emacs-testsuite-0JpgU6
>
> I actually have 2922 of these directories.
>
> The content of one of these directories is:
>
> emacs-testsuite-xdgMCK
> └── 28.0.50-d25e21f7
> └── subr--trampoline-63616c6c2d70726f63657373_call_process_0.eln
>
> 1 directory, 1 file
>
> Others are empty:
>
> emacs-testsuite-1HQfjD
>
> 0 directories, 0 files
>
> Every time I run "make -j8 check", I get another 584 of these directories.
>
> Could we do something to ensure these directories are always deleted?
I guess the correct way to do it would be in the Makefile when tests are
done, am I correct?
The other option would be to have Emacs to clean-up this directory
before exiting, but in case of a crash it wouldn't work.
The last option would be to convince `make-temp-file' we call at
startup.el:553 to create the directory in "/tmp/" or equivalent (not
sure that's possible).
Andrea
> Cc: 48060@debbugs.gnu.org > Date: Tue, 27 Apr 2021 16:53:33 +0000 > From: Andrea Corallo via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> > > I guess the correct way to do it would be in the Makefile when tests are > done, am I correct? > > The other option would be to have Emacs to clean-up this directory > before exiting, but in case of a crash it wouldn't work. We usually do the latter. Crashes in the test suite should be rare. > The last option would be to convince `make-temp-file' we call at > startup.el:553 to create the directory in "/tmp/" or equivalent (not > sure that's possible). That's only a good solution on platforms where /tmp is periodically cleaned up, or even disappears when the user logs off.
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> writes: Hi Andrea, >> The content of one of these directories is: >> >> emacs-testsuite-xdgMCK >> └── 28.0.50-d25e21f7 >> └── subr--trampoline-63616c6c2d70726f63657373_call_process_0.eln >> >> 1 directory, 1 file >> >> Others are empty: >> >> emacs-testsuite-1HQfjD >> >> 0 directories, 0 files >> >> Every time I run "make -j8 check", I get another 584 of these directories. >> >> Could we do something to ensure these directories are always deleted? > > I guess the correct way to do it would be in the Makefile when tests are > done, am I correct? > > The other option would be to have Emacs to clean-up this directory > before exiting, but in case of a crash it wouldn't work. Not an Emacs cleanup. Usually, test functions are responsible for their own cleanup. You could put the whole test body in an unwind-protect bodyform, and perform the cleanup in one of the unwindforms. > Andrea Best regards, Michael.
Michael Albinus <michael.albinus@gmx.de> writes:
> Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs@gnu.org> writes:
>
> Hi Andrea,
>
>>> The content of one of these directories is:
>>>
>>> emacs-testsuite-xdgMCK
>>> └── 28.0.50-d25e21f7
>>> └── subr--trampoline-63616c6c2d70726f63657373_call_process_0.eln
>>>
>>> 1 directory, 1 file
>>>
>>> Others are empty:
>>>
>>> emacs-testsuite-1HQfjD
>>>
>>> 0 directories, 0 files
>>>
>>> Every time I run "make -j8 check", I get another 584 of these directories.
>>>
>>> Could we do something to ensure these directories are always deleted?
>>
>> I guess the correct way to do it would be in the Makefile when tests are
>> done, am I correct?
>>
>> The other option would be to have Emacs to clean-up this directory
>> before exiting, but in case of a crash it wouldn't work.
>
> Not an Emacs cleanup. Usually, test functions are responsible for their
> own cleanup. You could put the whole test body in an unwind-protect
> bodyform, and perform the cleanup in one of the unwindforms.
Hi Michael,
the issue is that here is not really the test function that is creating
this folder, but Emacs it-self that to operate needs a folder to store
and retrieve eln files.
For the test-suite we moved to a different folder than the one we use
for normal runs to have a clean environment to run the test-suite on.
Regards
Andrea
Eli Zaretskii <eliz@gnu.org> writes:
>> Cc: 48060@debbugs.gnu.org
>> Date: Tue, 27 Apr 2021 16:53:33 +0000
>> From: Andrea Corallo via "Bug reports for GNU Emacs,
>> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> I guess the correct way to do it would be in the Makefile when tests are
>> done, am I correct?
>>
>> The other option would be to have Emacs to clean-up this directory
>> before exiting, but in case of a crash it wouldn't work.
>
> We usually do the latter. Crashes in the test suite should be rare.
Right, c62262736c using `kill-emacs-hook' should do the clean-up for all
non crashing sessions.
Regards
Andrea
Andrea Corallo <akrl@sdf.org> writes: > Hi Michael, Hi Andrea, > the issue is that here is not really the test function that is creating > this folder, but Emacs it-self that to operate needs a folder to store > and retrieve eln files. I know. > For the test-suite we moved to a different folder than the one we use > for normal runs to have a clean environment to run the test-suite on. Couldn't you create this different folder inside an ert-deftest, and remove it at test-case end? > Regards > > Andrea
Michael Albinus <michael.albinus@gmx.de> writes:
> Andrea Corallo <akrl@sdf.org> writes:
>
>> Hi Michael,
>
> Hi Andrea,
>
>> the issue is that here is not really the test function that is creating
>> this folder, but Emacs it-self that to operate needs a folder to store
>> and retrieve eln files.
>
> I know.
>
>> For the test-suite we moved to a different folder than the one we use
>> for normal runs to have a clean environment to run the test-suite on.
>
> Couldn't you create this different folder inside an ert-deftest, and
> remove it at test-case end?
No, Emacs needs to be able if necessary to depose .eln files even before
a test is run (this is not specific to native-comp tests), and given we
set HOME to a non existent directory the conventional
"~/.emacs.d/eln-cache" can't be used.
Regards
Andrea
Andrea Corallo <akrl@sdf.org> writes: >> Couldn't you create this different folder inside an ert-deftest, and >> remove it at test-case end? > > No, Emacs needs to be able if necessary to depose .eln files even before > a test is run (this is not specific to native-comp tests), and given we > set HOME to a non existent directory the conventional > "~/.emacs.d/eln-cache" can't be used. I don't quite understand how this precludes us from specifying a directory under test/ for the .eln files? I.e., HOME=/nonexistent ELN_DIR=test/cache-dir emacs ... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Andrea Corallo <akrl@sdf.org> writes:
>
>>> Couldn't you create this different folder inside an ert-deftest, and
>>> remove it at test-case end?
>>
>> No, Emacs needs to be able if necessary to depose .eln files even before
>> a test is run (this is not specific to native-comp tests), and given we
>> set HOME to a non existent directory the conventional
>> "~/.emacs.d/eln-cache" can't be used.
>
> I don't quite understand how this precludes us from specifying a
> directory under test/ for the .eln files? I.e.,
>
> HOME=/nonexistent ELN_DIR=test/cache-dir emacs ...
I agree, these are just to different cases, specifying one single
directory is certainly possible, doing it test by test inside
ert-deftest makes me a little more skeptical :)
Andrea
Stefan Kangas <stefan@marxist.se> writes: > After some iterations of running of "make -j8 bootstrap && make -j8 > check", my ~/src/emacs is filled with a lot of temporary directories: > > drwx------ 2 skangas skangas 4.0K 2021-04-27 03:50 emacs-testsuite-0B1nPY > drwx------ 2 skangas skangas 4.0K 2021-04-26 12:01 emacs-testsuite-0Ei8cf > drwx------ 2 skangas skangas 4.0K 2021-04-27 03:50 emacs-testsuite-0G40w3 > drwx------ 2 skangas skangas 4.0K 2021-04-27 02:59 emacs-testsuite-0GcjNo > drwx------ 2 skangas skangas 4.0K 2021-04-27 02:43 emacs-testsuite-0Gwmf7 > drwx------ 2 skangas skangas 4.0K 2021-04-26 20:24 emacs-testsuite-0HYLcF > drwx------ 2 skangas skangas 4.0K 2021-04-27 03:49 emacs-testsuite-0Iy0yX > drwx------ 2 skangas skangas 4.0K 2021-04-26 12:01 emacs-testsuite-0JpgU6 > > I actually have 2922 of these directories. Andrea's previous changes reduced the number of these directories, but there were still some left over. I think I've now fixed that, at least for "make check", and I'm going through the other ert interface functions, too. nativecomp still leaves other files over, but I'm opening a new report for that, and closing this one. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no