On Tue, Sep 22, 2026 at 5:33 PM Neal Gompa <[email protected]> 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.

You probably mean rmbuild, right? Because %clean plays a very minor
role these days (in Mock, or outside):
https://github.com/rpm-software-management/rpm/commit/1153ccd3749d26f184d6f78eeaa682d8815d896c
(Unless an explicit %clean section is defined, there is no %clean).

> Using --noclean turns all that
> stuff off, and can result in broken build results.
>
> Please don't do this.

Now `Executing(rmbuild)` is a different story.  But from what I see,
Mock implements
a few cleanup mechanisms that already clean what the 'rmbuild' phase does.
How `--noclean` can affect build results, considering the built
artefacts arleady exist?

Pavel



>
>
> --
> 真実はいつも一つ!/ Always, there's only one truth!
>

-- 
_______________________________________________
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