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.
--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
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