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

rpmbuild -bs leaves an unnecessary name-version-build directory behind #3382

Open
pmatilai opened this issue Oct 15, 2024 · 5 comments · May be fixed by #3487
Open

rpmbuild -bs leaves an unnecessary name-version-build directory behind #3382

pmatilai opened this issue Oct 15, 2024 · 5 comments · May be fixed by #3487
Labels

Comments

@pmatilai
Copy link
Member

Reported by @decathorpe in #3381:

Running rpmbuild -bs <spec> leaves behind an empty name-version-build directory. If we need to create the dir, we should at least clean up afterwards (and cleaning up might be easier than trying to avoid creating)

@pmatilai pmatilai added the bug label Oct 15, 2024
@pmatilai pmatilai added this to RPM Oct 15, 2024
@github-project-automation github-project-automation bot moved this to Backlog in RPM Oct 15, 2024
@voxik
Copy link
Contributor

voxik commented Oct 15, 2024

To me, this might be fedpkg thing, but I won't mind if this is going to be fixed on RPM side.

@decathorpe
Copy link

fedpkg srpm just does call rpmbuild -bs (with some additional --defines) under the hood, though? So I don't think this can entirely be "fixed" in fedpkg (and adding a workaround there won't fix uses of plain rpmbuild -bs).

@pmatilai
Copy link
Member Author

It's not a fedpkg thing, it's just that in the "traditional" ~/rpmbuild/{SPECS,BUILD,...} layout the directory gets created out of sigh, whereas fedpkg overrides all those to the current directory.

It's a bug in rpmbuild. No need to speculate. There are ... somewhere over a hundred different combinations this stuff be invoked, and this one got overlooked.

pmatilai added a commit to pmatilai/rpm that referenced this issue Dec 12, 2024
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
Copy link
Member Author

And what a bug it was! Not the proudest day of my career 😆

Thanks a lot for reporting @decathorpe !

@decathorpe
Copy link

eh, we've all forgot to add break in switch statements before, I think :) thank you for tracking it down!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

3 participants