Skip to content

fix(rpm): a finished build left its tree behind in /var/tmp - #157

Merged
jamesconwaydev merged 1 commit into
mainfrom
fix/rpm-tree-cleanup
Nov 15, 2026
Merged

jamesconwaydev merged 1 commit into
mainfrom
fix/rpm-tree-cleanup

Conversation

@jamesconwaydev

Copy link
Copy Markdown
Owner

Follow-up to your note on #156. rpm-here now removes /var/tmp/sentry-v2-rpmbuild once the results are copied to rpmbuild/, 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. Two make rpm runs 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 rpm through the container route exits 0, with the packages in rpmbuild/ and the tree gone.

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 foothillsdigital left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jamesconwaydev
jamesconwaydev merged commit e004e00 into main Nov 15, 2026
6 checks passed
@jamesconwaydev
jamesconwaydev deleted the fix/rpm-tree-cleanup branch November 15, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants