Skip to content
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

Fix regression causing a build directory left behind on rpmbuild -bs #3487

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

pmatilai
Copy link
Member

There are a bunch of flaws here, kinda separate items but as they were all introduced in a single commit it probably makes sense to address the mess as one too:

There was a missing 'break' causing %mkbuilddir to use the templates of %prep, which masks the fact that the %_spec_builddir* stuff all set to %{nil} doesn't work, which causes us to try to 'cd' to the build directory that we're about to create in that %mkbuilddir. It only happens to work because I forgot to update the rpmMkdirs() call in rpmbuild to create %_top_builddir instead of %_builddir. Oof.

The only obvious evidence of all that fubar was that rpmbuild -bs started leaving an empty build directory behind.

Reported-by: Fabio Valentini [email protected]

Fixes: #3382

There are a bunch of flaws here, kinda separate items but as they were
all introduced in a single commit it probably makes sense to address
the mess as one too:

There was a missing 'break' causing %mkbuilddir to use the templates of
%prep, which masks the fact that the %__spec_builddir_* stuff all set
to %{nil} doesn't work, which causes us to try to 'cd' to the build
directory that we're about to create in that %mkbuilddir. It only
happens to work because I forgot to update the rpmMkdirs() call in
rpmbuild to create %_top_builddir instead of %_builddir. Oof.

The only obvious evidence of all that fubar was that rpmbuild -bs
started leaving an empty build directory behind.

Reported-by: Fabio Valentini <[email protected]>

Fixes: rpm-software-management#3382
@pmatilai pmatilai requested a review from a team as a code owner December 12, 2024 06:30
@pmatilai pmatilai requested review from ffesti and removed request for a team December 12, 2024 06:30
@ffesti ffesti merged commit 5b2abea into rpm-software-management:master Dec 18, 2024
1 check passed
@decathorpe
Copy link

Thank you! Would it be possible to backport this to (or include the patch in) RPM 4.20 in Fedora 41+?

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.

rpmbuild -bs leaves an unnecessary name-version-build directory behind
3 participants