#789 Use bconds everywhere
Opened 3 years ago by churchyard. Modified 3 years ago

I love bconds, they are awesome.

I'd like to propose 2 things:

  1. In the guidelines, use bconds everywhere instead of just 0/1 macros. E.g. in Bootstrapping don't use %if ! 0%{?bootstrap} but %if %{with bootstrap} etc. (I volunteer to go trough everything here, I just don't want to do it before we agree on this).

  2. Add a guideline that says packager SHOULD prefer bconds over 0/1 macros if possible. Explain a bit how bcond_with and without work (it's a bit counter intuitive), add examples.

Personally I've never really like bcond because it's so... arcane and counterintuitive. I certainly have no objection to documenting it better and even using it in the various examples. I'm not so sure I'd go so far as to require that everyone use it, though.

I only used this when doing local rpmbuild or mock builds, but can I even tell koji builds to use --with or --without? I don't think that works - but then, how are those bootstrap builds possible? Maybe I'm misunderstanding something, but it definitely isn't well documented :neutral_face:

From this weeks log ( https://meetbot-raw.fedoraproject.org/fedora-meeting-1/2018-08-23/fpc.2018-08-23-16.00.txt):

  • .789 Use bconds everywhere (geppetto, 16:25:11)
  • ACTION: mhroncok Will come up with the policy of which cases they
    should be used in. (geppetto, 16:36:13)
  • ACTION: mhroncok to give a definition of when to use bconds
    (mhroncok, 16:36:14)

Metadata Update from @churchyard:
- Issue untagged with: meeting
- Issue assigned to churchyard
- Issue tagged with: needinfo

3 years ago

You can change it in spec. Or even push commits like: https://src.fedoraproject.org/rpms/python-setuptools/c/df1f52989e65d45b372ad5978d54e0f77f742207?branch=master

So, if I understand correctly, the following things are equivalent:

in spec                               passed to rpmbuild / mock command
%global _with_tests 1         <=>     --with=tests
%global _without_tests 1      <=>     --without=tests

I agree with @tibbs, the bcond stuff is rather arcane. However, with some documentation and good examples I agree that they should be preferred to the clunky and error-prone conditionals.

Yeah every time I've tried to use it I've had to double-check which way round it goes (you say "bcond_with X" so that the package builds without X by default ... that's confusing).

So I'm reluctant to say they should be used everywhere.

I was involved in the initial bootstrapping proposal and adjustments to the "_with_bootstrap" because I find the bcond confusing as well. Nevertheless, in retrospective, I think it was a mistake and I support @churchyard's proposal, mainly because of this:


Login to comment on this ticket.