New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure %clean always succeeds #2519
Comments
Yeah, rpm itself suffers from this too. Both from the POV that rpmbuild may leave cruft behind (which does look like a bug when you look at it that way), but also when building rpm itself the test-suite can be non-removable afterwards. |
FTR, CMake does something similar on |
Another case where we'll run into this is if/when we add support for vpath builds in read-only tree (#2985). The default |
Actually the whole %clean thing seems redundant since 9d35c8d because everything is under that one directory and we need to be able to nuke it, no matter what. Fixing this would be a one-liner to build.c:
...but because %clean is still trying to do its own thing of removing the buildroot, it fails before it gets to %rmbuild, which would handle it. Doh. Of course we could just add a similar call there but that is silly too. I'll need a fresher head to think if there's still a case for that separate %clean or should we just flush it... |
Packages may contain files without write permissions, read-only sources and whatnot. Run %_fixperms on the whole builddir before trying to remove it to ensure we don't fail doing our household duties. It's worth noting that prior to b5f6c64 the build could similarly fail while running it's default %clean. If we hadn't removeed the default %clean, we'd have to do this permission fixup first redundantly for the build root and then for the rest of the %builddir. Also worth noting is that the added test doesn't actually reproduce the issue in the test-suite because it runs as root and root is not bothered by such petty issues as missing read/write permissions to remove. But at least we have a reproducer for the case once rpm-software-management#3005 is done. Fixes: rpm-software-management#2519
Packages may contain files without write permissions, read-only sources and whatnot. Run %_fixperms on the whole builddir before trying to remove it to ensure we don't fail doing our household duties, both on post-cleanup but also before trying to remove an old run, as eg 'rpmbuild -bi' will not run cleanup. It's worth noting that prior to b5f6c64 the build could similarly fail while running it's default %clean. If we hadn't removeed the default %clean, we'd have to do this permission fixup first redundantly for the build root and then for the rest of the %builddir. Also worth noting is that the added test doesn't actually reproduce the issue in the test-suite because it runs as root and root is not bothered by such petty issues as missing read/write permissions to remove. But at least we have a reproducer for the case once rpm-software-management#3005 is done. Fixes: rpm-software-management#2519
Packages may contain files without write permissions, read-only sources and whatnot. Run %_fixperms on the whole builddir before trying to remove it to ensure we don't fail doing our household duties, both on post-cleanup but also before trying to remove an old run, as eg 'rpmbuild -bi' will not run cleanup. It's worth noting that prior to b5f6c64 the build could similarly fail while running it's default %clean. If we hadn't removeed the default %clean, we'd have to do this permission fixup first redundantly for the build root and then for the rest of the %builddir. Also worth noting is that the added test doesn't actually reproduce the issue in the test-suite because it runs as root and root is not bothered by such petty issues as missing read/write permissions to remove. But at least we have a reproducer for the case once rpm-software-management#3005 is done. Fixes: rpm-software-management#2519
Packages may contain files without write permissions, read-only sources and whatnot. Run %_fixperms on the whole builddir before trying to remove it to ensure we don't fail doing our household duties, both on post-cleanup but also before trying to remove an old run, as eg 'rpmbuild -bi' will not run cleanup. It's worth noting that prior to b5f6c64 the build could similarly fail while running it's default %clean. If we hadn't removeed the default %clean, we'd have to do this permission fixup first redundantly for the build root and then for the rest of the %builddir. Also worth noting is that the added test doesn't actually reproduce the issue in the test-suite because it runs as root and root is not bothered by such petty issues as missing read/write permissions to remove. But at least we have a reproducer for the case once #3005 is done. Fixes: #2519
Could the default %clean script automatically change the mode of directories
before doing
rm -rf
? To avoid build failures caused by unsuccessfulrm
calls:Note this problem can cause problems Mock/Copr: See also rpm-software-management/mock#1081
The text was updated successfully, but these errors were encountered: