Repository navigation
fix(rpm): a finished build left its tree behind in /var/tmp - #157
Conversation
rpm-here starts with rm -rf on the fixed build directory, and the tree it left is mode 0700 in sticky /var/tmp, so another user's next build on the same machine couldn't clear it. Remove it once the results are copied out. A failed build still leaves it, for debugging. Raised by foothillsdigital in the review of #156. Signed-off-by: James Conway <148910373+jamesconwaydev@users.noreply.github.com>
foothillsdigital
left a comment
There was a problem hiding this comment.
Checked ab55429.
The container route keeps /var/tmp/sentry-v2-rpmbuild inside the throwaway container, so the case that matters is a native build. I ran one: this branch's tree in a Rocky 10 container with rpm-build, make, bzip2, tar and python3 installed, so command -v rpmbuild succeeds and make rpm takes rpm-here directly:
/usr/bin/rpmbuild
make_exit=0
3 (RPMs in rpmbuild/RPMS/noarch)
ls: cannot access '/var/tmp/sentry-v2-rpmbuild': No such file or directory
A failed $(RPM_BUILD) or cp stops make before the rm, so the tree stays for debugging, as you say. Leaving out flock is fair, given CI and releases always start from a fresh container.
Against the checklist: worth having, yes. Tested, by the run above. Safe: it only removes the directory rpm-here itself made. Small: one line. Words: the PR says what changed, and the CHANGELOG entry from #156 still holds. Approving.
Follow-up to your note on #156.
rpm-herenow removes/var/tmp/sentry-v2-rpmbuildonce the results are copied torpmbuild/, so one user's finished build doesn't block the next user's. A failed build still leaves the tree, for debugging.I left out the
flock. Twomake rpmruns at once on one machine isn't something we do: CI and the release run in a fresh container each time. And as you said, a race only makes a build fail, never write somewhere else.Checked:
make rpmthrough the container route exits 0, with the packages inrpmbuild/and the tree gone.