#469 Unified bootstrapping
Closed: Fixed None Opened 9 years ago by msuchy.

Fedora has quite a lots of circular build requires.

Often is is caused that package B requires A, and A BuildRequires B. Very often it is because B is used in %check or for building -doc subpackage.

Each maintainer use different macros to handle this situation. E.g:

{{{
%global with_docs 1
%global with_check 1
%global no_test 0
%global bootstrap 0
...
}}}
This make mass rebuilds little bit complicated. Therefore I propose to unify this behaviour by adding following chapter to Packaging Guidelines. This would allow build tools (e.g. mockchain) to break the circle (when it occure) to try the build with with_bootstrap set to 1 and try to automatically resolve this issue. The scriptlets is inspired by
http://fedoraproject.org/wiki/Packaging:Guidelines#Exceptions

== Bootstrapping ==

If your package introduce circular dependencies in build time, you have to define and use this macro:

{{{

Set this to 0 after we've bootstrapped

%{!? with_bootstrap: %global bootstrap 1}

[...]

%if 0%{?bootstrap}
# dependencies for %%check
BuildRequires: foo
%endif

[...]

%if 0%{?bootstrap}
%check
make check
%endif

}}}

When your bootstrapped package (let say package "bar") is missing some functionality, you have to provide this virtual provides:

{{{
%if ! 0%{?bootstrap}
Provides bar(some_functionality)
%endif
}}}

Packages which requires this functionality should require this virtual provides.

Please note that usage of pre-built binaries in bootstrap still needs exception from FPC as stated in http://fedoraproject.org/wiki/Packaging:Guidelines#Exceptions


I entirely support this idea.

And if I may, I have some additional proposals (not solutions though :/).

1) We should solve versioning, i.e. the first bootstrap build should be possible to run with release such as 0.stablerelease
2) Once this is resolved, we could consider to modify our build system to support redefining the bootstrap flag from outside. Mock can currently override macros from outside, so Koji and fedpkg could be enhanced by this.

This could save us from unnecessary dist-git commits, release bumps etc.

AFAIK bootstrapping is one of the topics the Base Working Group should be working on.

We should solve versioning .... we could consider to modify our build system

Yes. I plan to enhance mock/mockchain this way. But first I need to know, which macros to use and unify it across distribution.
I plan to enhance dist tag for rebuilds. But that macro is not mandatory. Therefore I would like to enhance the original draft by this sentence:

''Packages, which use boostrap macro, MUST use dist tag macro. This will allow build tools to do automatic rebuild.''

This was discussed at today's meeting (http://meetbot.fedoraproject.org/fedora-meeting-1/2014-11-20/fpc.2014-11-20-17.00.txt) and was passed after some modifications:

...final etherpad reposted below:

= Bootstrapping =
If your package introduces build time circular dependencies, you should use this macro to bootstrap your package:

# Set this to 0 after we've bootstrapped

%{!?_with_bootstrap: %global bootstrap 1}

[...]

%if 0%{?bootstrap}

  # dependencies for %%check

  BuildRequires: foo

%endif

[...]

%if 0%{?bootstrap}

%check

make check

%endif

If your package explicitly Provides: some functionality that is missing when bootstrapped, then that Provides: should look like:

%if ! 0%{?bootstrap}

Provides: bar(some_functionality)

%endif

Please note that usage of pre-built binaries in bootstrap still needs an exception from the Packaging Committee as stated in ​http://fedoraproject.org/wiki/Packaging:Guidelines#Exceptions

Ops, I forgot to add and discuss on meeting the comment #6:

''Packages, which use boostrap macro, MUST use dist tag macro. This will allow build tools to do automatic rebuild.''

Can you please vote about this on next meeting?

We discussed this in this weeks meeting (http://meetbot.fedoraproject.org/fedora-meeting-1/2014-12-04/fpc.2014-12-04-17.02.txt) and decided that bootstrapping packages weren't really special here so just require dist for everything now:

I have written up the dist guideline change, though I still need to go through everything to make sure that all examples which have Release: tags show the dist tag.

Announcement info:

Use of the %{?dist} tag in the Release: field is now mandatory.

I guess also add an announcement note about the new unified bootstrap guideline (I closed the ticket too early without understanding the correct workflow)

I might be reading this guideline wrong, but shouldn't it be:

{{{
%if ! 0%{?bootstrap}
# dependencies for %%check
BuildRequires: foo
%endif

[...]

%if ! 0%{?bootstrap}
%check
make check
%endif
}}}

I.e. after bootstrapping round, the {{{%{bootstrap} == 0}}}, we have finally available all dependencies and we want to use the to execute the %check section.

Metadata Update from @tibbs:
- Issue assigned to mbooth

7 years ago

Login to comment on this ticket.

Metadata