Panu Matilainen via devel venit, vidit, dixit 2026-09-28 10:08:45:
> On 9/22/26 6:32 PM, Neal Gompa wrote:
> > On Tue, Sep 22, 2026 at 11:08 AM Pavel Raiskup via buildsys
> > <[email protected]> wrote:
> >>
> >> Hi everyone,
> >>
> >> We are planning to change Mock's default behavior when building
> >> packages. Specifically, we intend to unconditionally pass --noclean to
> >> rpmbuild during builds. This means Mock will no longer execute the
> >> %clean section of spec files (or the implicit rmbuild cleanup phase).
> >> So far, Mock has been using --noclean only when
> >> `cleanup_on_success=False` (opt-in behavior).
> >>
> >> Modern RPM packaging guidelines consider the %clean section obsolete.
> >> Mock already manages the chroot and build root cleanups at the top
> >> level before and after builds. Running %clean inside the chroot seems
> >> redundant, and is hard to cover correctly (especially with the new
> >> "delayed %check" feature).
> >>
> >> More context and the background discussion can be found in PR #1809:
> >> https://github.com/rpm-software-management/mock/pull/1809
> >>
> >> Request for Feedback:
> >> Before we make this change default in an upcoming release, we would
> >> like to hear from the community:
> >>
> >> Do you have any legitimate use cases where executing the %clean
> >> section or rmbuild phase inside Mock is still strictly required?
> >>
> >> Are you aware of any workflows or tooling built on top of Mock that
> >> would break if Mock always passes --noclean?
> >>
> >> If you have any objections, edge cases, or concerns, or process
> >> opinions - please let us know.
> >>
> > 
> > The %clean section is obsolete because we already define a default
> > %clean stage in RPM itself since rpm 4.8 in 2009:
> > https://github.com/rpm-software-management/rpm/commit/3fc58248d23d6f720942e5cbf4f92db246a802f0
> > 
> > And modern default %clean handles all the weird multi-buildroot stuff
> > that is now supported since RPM 4.20. Using --noclean turns all that
> > stuff off, and can result in broken build results.
> 
> Huh?
> 
> --noclean only really affects finished builds because in the other 
> modes, clean steps are not to be executed anyhow.
> 
> Please be more specific if you have a concrete example where --noclean 
> (inside mock specifically) causes problems. --noclean like any other 
> option of rpmbuild, and if it breaks something then that sounds like a 
> bug to me.

Maybe there's some confusion between the mock option and the rpmbuild
option here. Also, rpmbuild's man page seems to suggest that `--noclean`
is not the negation of `--clean`.

If the rpmbuild options are really about executing `%clean` or not after
the build, then they affect whatever is configured to run there - for
example, moving something from the build tree to somewhere else that has
been saved during a multi-stage build, or running whatever over the
created builds. This may or may not be a "creative" use of %clean, but
apparently necessary for multilib.

Michael
-- 
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://forge.fedoraproject.org/infra/tickets/issues/new

Reply via email to