From Fedora Project Wiki

Notes for the tilde versioning drafts

There are two drafts:

Neither of the first two drafts is as simple as the current guidelines but the second is a relatively small addition. I don't know if either is more acceptable to anyone in particular. The third draft, on the other hand, is a significant simplification. It has been merged into upstream RPM, and maybe it will be backported to the live Fedora branches afterwards. Even if it is, the question of RHEL/EPEL will remain. We can hope.

The fundamental issues I'm trying to solve:

  • People really want to use tilde because for some (limited but common) cases it makes things simpler.
  • We need something which is relatively simple and "works" for the range of problems generally seen by people.
  • It would be nice to be prescriptive for weirder cases.
  • Keeping Release: simple is really appealing.

With that in mind, here's the problem: these two simple, common cases are at odds with each other if all we have is the tilde operator:

  • Moving from a post-release snapshot to a new version.
  • Moving between upstream tagged prereleases and git snapshots.

Moving between post-release snapshots and tagged releases

Take this version sequence:

  • (1.2, git snapshot, 1.2.1)

Current guidelines give:

  • (1.2-1, 1.2-2.20180101.abcde, 1.2.1-1)

Keeping Release: pristine sounds great, but....

  • (1.2-1, 1.2+20180101.abcde-1, 1.2.1-1 + Epoch)

So that won't work. Pushing snapshot information into release just gives us the current guidelines.

You can try to throw a tilde in there:

  • (1.2-1, 1.2+0~20180101.abcde-1, 1.2.1-1)

It works in that case but sadly it breaks if 1.2a is released instead of 1.2.1.

So it seems we have no choice but to keep putting post-release snapshot information into Release: or wait until we can use the caret operator.

Moving between tagged prereleases and git snapshots

Take this version sequence:

  • (1.2beta1, git snapshot, 1.2beta2, git snapshot, 1.2)

Current guidelines give:

  • (1.2-0.1.beta1, 1.2-0.2.20180101.abcde-1, 1.2-0.3.beta2, 1.2-0.3.20180102.fghij-1, 1.2-1) (0)

With keeping Release: pristine, you have to insert a digit and it's simplest to just start when you introduce a snapshot:

  • (1.2~beta1-1, 1.2~1.20180101.abcde-1, 1.2~2.beta2-1, 1.2~3.20180102.fghij-1, 1.2-1) (1)

Not inserting the digit until necessary does work, but seems easy to get wrong and hard to describe:

  • (1.2~beta1-1, 1.2~20180101.abcde-1, 1.2~3.beta2-1 ???, 1.2~4.20180102.fghij-1, 1.2-1) (2)

Pushing the snapshot information into Release gives:

  • (1.2~beta1-1, 1.2~beta1-2.20180101.abcde, 1.2~beta2-1, 1.2~beta2-2.20180102.fghij, 1.2-1) (3)

Now, to me none of these look absolutely terrible but it seems that #1 is the simplest that allows tilde. I'm calling the third one the "post-prerelease snapshot" option.

What if you knew upstream was going to put out 1.2 and package a snapshot, but then upstream releases a beta?

  • (1.2 git snapshot, 1.2beta1)

Current guidelines of course work fine:

  • (1.2-0.1.20180101.abcde, 1.2-0.2.beta1)

Keeping "pristine Release" with requiring the extra digit on snapshots works:

  • (1.2~1.20180101.abcde, 1.2~2.beta1)

Without the requirement for the digit on snapshots it "works" but is less pleasant:

  • (1.2~20180101.abcde, 1.2~20180101.1.beta1) (tack a counter onto the date)

With snapshot information in release, you can't add the beta1 tag anywhere.

  • (1.2-1.20180101.abcde or 1.2-0.1.20190101.abcde, ???)

Unless you use a tilde with nothing (which sort of mirrors what I've done with the full tilde-caret guidelines)

  • (1.2~-1.20180101.abcde, 1.2~beta1-1)

What to do?

I see five options:

  1. Don't change anything.
  2. Allow tilde and keep snapshot information in Release:. Requires the odd "post-prerelease snapshot" thing if you ever go from a snapshot to a prerelease. Forbid the packaging of tagged prereleases if prerelease snapshots for the same version were packaged.
  3. Allow tilde. Keep post-release snapshot information in Release:. Keep prerelease snapshot information in Version.
  4. Allow tilde, with post-release info in Release and prerelease info in a place decided by whether you ever intend to package snapshots.
  5. Wait for the implementation of caret to be merged and pushed back to live Fedora branches.

Since people have declared that the first option is simply something they will ignore because they want tilde so much.

The second option just seems unreasonable.

The third option seems... inconsistent but at least possible to describe.

The fourth option is simply insane, but seems to be what the people who want tilde say because it appears they don't ever intend to package prerelease snapshots and don't care about that use case.

The fifth option permits some really clean guidelines, but we have to wait a bit (maybe three weeks) and then EPEL cannot follow.

One thing is clear: allowing tilde by itself does not simplify the guidelines. It does make some specific versioning cases look nicer. When you completely ignore the existence of snapshots, tilde certainly makes loads of sense. If we have both tilde and caret then things get significantly simplified.