Bug 30545 - "make tests-clean" is not reliable
Summary: "make tests-clean" is not reliable
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: unspecified
: P2 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-12 15:30 UTC by Maxim Kuvyrkov
Modified: 2023-06-15 15:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2023-06-13 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Kuvyrkov 2023-06-12 15:30:34 UTC
$ ../glibc/configure --prefix=/usr
$ make -j160
$ find -name "*.out" -o -name "*.test-result" | wc -l
0
$ make -j160 check
$ find -name "*.out" -o -name "*.test-result" | wc -l
9210
$ make tests-clean
$ find -name "*.out" -o -name "*.test-result" | wc -l
3297

"tests-clean" relies on do-tests-clean to clean individual subdirs, which, in turn, relies for subdirs to provide exhaustive list of all tests:
===
do-tests-clean:
	-rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) \
						      $(tests-internal) \
						      $(xtests) \
						      $(test-srcs)) \
				     $(addsuffix .test-result,$(tests) \
							      $(tests-internal) \
							      $(xtests) \
							      $(test-srcs)))
===

I suggest changing the above to:
===
do-tests-clean:
	-find $(objpfx) -name "*.out" -delete
	-find $(objpfx) -name "*.test-result" -delete
===
... or something similar.

Another alternative is to remove the "tests-clean" target, since most developers don't trust it now.
Comment 1 Carlos O'Donell 2023-06-13 12:11:06 UTC
(In reply to Maxim Kuvyrkov from comment #0)
> I suggest changing the above to:
> ===
> do-tests-clean:
> 	-find $(objpfx) -name "*.out" -delete
> 	-find $(objpfx) -name "*.test-result" -delete
> ===
> ... or something similar.

Agreed, this is a better solution than the recursive one.

Please propose this change as a patch and I'll happily review.

Then I'll go over the test-container tests with DJ to add a stage that deletes the container chroot so it gets recreated.