bootstrapping without .spec modification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

My idea would be to submit [1] for package-review so that it's
generally available.

Note that this works if the package we're building uses
  %bcond_with bootstrap
or
  %bcond_without bootstrap
I picked %{with bootstrap}, %{with lto}, %{with tests} as
generally-useful settings. I think it is worth standarizing the names
like this, and at least %{with bootstrap} and %{with tests} could be
added to packaging guidelines.

[1] https://pagure.io/rpm-macros-bootstrap
[2] https://pagure.io/rpm-macros-test
[3] rpm-without-bootstrap has Conflicts:rpm-with-bootstrap, so installing
    one forces the other out. Alternatively, rpm-with-bootstrap may just
    be uninstalled.

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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux