Page MenuHomeFreeBSD

make check: Eliminate "operation not permitted" errors
AcceptedPublic

Authored by guest-patmaddox on Fri, Apr 11, 4:53 AM.
Tags
None
Referenced Files
F115540041: D49775.id153499.diff
Fri, Apr 25, 1:38 AM
F115533657: D49775.id153949.diff
Thu, Apr 24, 11:31 PM
F115524374: D49775.diff
Thu, Apr 24, 8:31 PM
Unknown Object (File)
Thu, Apr 17, 12:23 PM
Unknown Object (File)
Thu, Apr 17, 2:45 AM
Unknown Object (File)
Thu, Apr 17, 2:10 AM
Unknown Object (File)
Tue, Apr 15, 9:25 PM
Unknown Object (File)
Mon, Apr 14, 6:47 PM

Details

Reviewers
ngie
imp
Group Reviewers
Contributor Reviews (src)
Summary

aftercheck calls clean. ${DESTDIR}/var/empty has schg flag set. Prior
to this change, every run of make check ended with:

rm: checkdir/var/empty: Operation not permitted
rm: checkdir/var: Directory not empty
rm: checkdir: Directory not empty

  • Error code 1 (ignored)

Remove the flags from DESTDIR before running clean, to bypass the
noisy output.

PR: 286025
Signed-off-by: Pat Maddox <pat@patmaddox.com>

Test Plan

I've run make check in a bunch of directories. Anything else I should do?

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I have reviewed https://reviews.freebsd.org/D11905 which originally only ran @cd ${.CURDIR} && ${MAKE} clean. I have updated the comment to what I believe more clearly describes the intent of the separate aftercheck target.

DESTDIR used to be completely deleted. Now that is gone and the dirs remain since make clean doesn't remove those, right?

In D49775#1138257, @imp wrote:

DESTDIR used to be completely deleted. Now that is gone and the dirs remain since make clean doesn't remove those, right?

In the default case, DESTDIR does get completely deleted, because DESTDIR == checkdir:

MAKE_CHECK_SANDBOX_DIR=	checkdir
CLEANDIRS+=	${MAKE_CHECK_SANDBOX_DIR}

.if ${MK_MAKE_CHECK_USE_SANDBOX} != "no" && make(check)
DESTDIR:=	${.OBJDIR}/${MAKE_CHECK_SANDBOX_DIR}

You are correct though that if you run e.g. make MAKE_CHECK_USE_SANDBOX=no DESTDIR=/tmp/ls-check check then it doesn't clean up /tmp/ls-check.

So this should keep the rm -Rf "${DESTDIR}" for the case where it's run with MAKE_CHECK_USE_SANDBOX=no.

However, the chflags -R 0 should still come first - that's the main point of this patch. If you look at https://reviews.freebsd.org/D18641, chflags was introduced to pick up any files that couldn't be deleted by make clean. If you chflags first, then everything is able to get deleted, and you avoid these messy warnings.

Maintain the make clean and rm -Rf. Simply run chflags first so no warnings are emitted in make clean due to schg files.

Yes. I agree with the main point of the patch, and now it's correct (or as correct as it can get).

This revision is now accepted and ready to land.Mon, Apr 21, 1:56 PM