On 1/29/21 12:44 PM, Miro Hrončok wrote:
On 29. 01. 21 12:25, Zbigniew Jędrzejewski-Szmek wrote:
Hello fellow packagers!
The subject of bootstrapping came up on fedora-devel recently.
I had the following idea, about which I would love to hear some feedback:
== Problem:
building packages with bootstrap currently involves doing *two*
patches to the spec file: first to add '%global _without_bootstrap 1',
then comes a rebuild, second to remove the macro, and then comes
another rebuild.
== Partial solution
Let's have an rpm that provides a single file that sets the macro for us:
$ rpm -qpl noarch/rpm-with-bootstrap-0-1.fc34.noarch.rpm
/usr/lib/rpm/macros.d/macros.rpm-with-bootstrap
$ cat rpm-macros-bootstrap/macros.rpm-with-bootstrap
# Enable %%with_bootstrap for all builds
%_with_bootstrap 1
Then we can do the following:
$ rpmdev-bumpspec 'Do rebuild w/ bootstrap'
$ mock -i rpm-with-bootstrap
$ fedpkg mockbuild
$ rpmdev-bumpspec 'Do rebuild w/o bootstrap'
$ mock -i rpm-without-bootstrap [3]
$ fedpkg mockbuild
Voilà!
The same pattern should work with side-tags in koji.
I prepared a poc implementation in [1] which builds
rpm-{with,without}-{bootstrap,tests,lto}, and a test package [2] which
prints the values of %with_bootstrap, %with_tests, %with_lto.
== Full solution
If we have automatic version bumps, this would become even simpler:
$ mock -i rpm-with-bootstrap
$ fedpkg mockbuild
$ mock --dnf-cmd remove rpm-with-bootstrap
$ fedpkg mockbuild
A more general note: Your examples involve mock, not Koji.
For mock, you can already do:
$ fedpkg mockbuild --with bootstrap
$ mock --install <built_package>
$ fedpkg mockbuild
For Koji, you cannot install arbitrary packages.
What if instead, Koji allowed to set arbitrary macros on builds (and it
keeps their definition for further reference). That way, you will be
able to do:
$ fedpkg build --with bootstrap
$ koji wait-repo ...
$ fedpkg build
From the same commit. No package installation required.
Yes, defining rpm macros in koji would solve that for the build system.
I'd love to have the following features:
* general macros that are not package or arch specific (probably most of
them)
* per-(package,arch) macro overrides
* macro inheritance across koji tags
* don't forget that NVR has to be unique in koji so you can't build the
same build twice. Having an ability to set %dist via koji might be nice
for bootstrapping.
The downside is that anyone that is not using koji would have to
retrieve the macros from somewhere (export macros into a RPM file and
ship it as part of the release?). But that's only if the macros are used
for building production RPMs that land in Fedora repos. RPMs used for
bootstrapping don't have to be rebuildable outside the build system.
It seems to be related to this:
RFC: Feature macros (aka USE flags)
https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx/thread/4DWDPKYBOXTCGKXJTOIVPO34A5BTOE3T/
And it's also not far from defining build macros in modules:
https://docs.fedoraproject.org/en-US/modularity/building-modules/fedora/defining-modules/#_build_macros_optional
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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/devel@xxxxxxxxxxxxxxxxxxxxxxx