#713 Forward-looking conditionals by default
Opened 7 years ago by ignatenkobrain. Modified 6 years ago

Unfortunately I don't have time to write draft, so just filing issue here and hopefully someone from FPC would write it instead (given that thing I'm talking about is very trivial).

currently packagers are doing things like

%if 0%{?fedora} > 12
%global with_python3 1
%endif

Unfortunately, I have always to look when I propose patch and see whether package is built for EPEL7 because if I will simply remove condition (given that Fedora is already 28 on the radar) I will break something for EPEL7.

So my proposal is to guide people to make their conditionals forward-looking by default which would mean to write code above as

%if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 12)
%global with_python3 0
%else
%global with_python3 1
%endif

Notes:

  • At the point of writing specfile, EL7 is latest version so probably it will be changed in future and if it will then someone will look at it anyway
  • It helps to find in easy way when some condition can be dropped

Hopefully I described it in understandable and making sense way, but if not -- let me know.

cc @ngompa


To reiterate what I mentioned in the meeting:

  • Packaging:DistTag could use some attention regardless.
  • If this is just flipping the signs of suggested conditionals, that's probably not a bad idea.
  • If it's adding unnecessary complexity (like by default including EPEL conditionals for packages which may not ever go to EPEL) then that would be bad. But maybe the example above was simply unfortunate.
  • You can't avoid having to figure out whether a particular spec is targeted at EPEL or whatnot regardless of how you phrase the conditionals.
  • We should consider simply predefining useful conditionals if they are needed by many packages. Of course that would still just handle a relatively small percentage of these.

Metadata Update from @tibbs:
- Issue tagged with: meeting

7 years ago

We discussed this at this weeks meeting (http://meetbot.fedoraproject.org/fedora-meeting-2/2017-09-06/fpc.2017-09-06-17.00.txt):

  • x713 Forward-looking conditionals by default (geppetto, 17:13:12)
  • ACTION: ignatenkobrain To write a draft for changing the default to
    enable python3 when no distro. macros are in use (geppetto,
    17:35:25)

will try to prepare some draft next week

Metadata Update from @ignatenkobrain:
- Issue assigned to ignatenkobrain

6 years ago

Metadata Update from @ignatenkobrain:
- Issue untagged with: meeting
- Issue tagged with: draftneeded

6 years ago

Even though I was initial skeptical of the added complexity, I'm finding that the initial reasoning here really is correct and that it would be good if we had this. In fact, I find myself referring to this ticket when I need to see an example of how to do it properly.

Certainly if there are any examples in the existing guidelines that don't follow this pattern, we should fix them. I'll fix up any that I notice in regular usage but feel free to point out any which need fixing. Still need the draft and discussion of whether convenience macros are useful or needed.

Log in to comment on this ticket.

Metadata