From Fedora Project Wiki
(Use ? for magic operator instead of : since some things take : as epoch.)
(More notes.)
Line 27: Line 27:
 
Keeping Release: pristine sounds great, but....
 
Keeping Release: pristine sounds great, but....
 
* (1.2-1, 1.2+20180101.abcde, 1.2.1-1 + Epoch)
 
* (1.2-1, 1.2+20180101.abcde, 1.2.1-1 + Epoch)
So push snapshot information into Release:
+
Pushing snapshot information into release just gives us the current guidelines.
* (1.2-1, 1.2-2.20180101.abcde, 1.2.1-1)
 
  
So obviously, uh, we have no choice but to keep our current Release: mangling here.
+
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.
  
If we had some magical operator ':' or something which compared like this: (1.2-1 < 1.2:20180101.abcde < 1.2.1-1) then life would be golden, but I don't think it exists.
+
So  it seems we have no choice but to keep putting post-release snapshot information into Release:.
 +
 
 +
If we had some magical operator '?' or something which compared like this: (1.2-1 < 1.2?20180101.abcde < 1.2.1-1) then life would be golden, but I don't think it exists.  All non alphanumerics besides '~' mean the same thing to RPM.
  
 
=== Moving between tagged prereleases and git snapshots ===
 
=== Moving between tagged prereleases and git snapshots ===
Line 47: Line 50:
 
Pushing the snapshot information into Release gives:
 
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)
 
* (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 particularly bad but it seems that #1 is the simplest that allows tilde.  I'm calling the third one the "post-prerelease snapshot" option.
+
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?
 
What if you knew upstream was going to put out 1.2 and package a snapshot, but then upstream releases a beta?
Line 58: Line 61:
 
Without the requirement for the digit on snapshots it "works" but is less pleasant:
 
Without the requirement for the digit on snapshots it "works" but is less pleasant:
 
* (1.2~20180101.abcde, 1.2~3.beta1)
 
* (1.2~20180101.abcde, 1.2~3.beta1)
 +
An extra tilde kind of saves you:
 +
* (1.2~~20180101.abcde, 1.2~beta1)
 
With snapshot information in release, you can't add the beta1 tag anywhere.
 
With snapshot information in release, you can't add the beta1 tag anywhere.
* (1.2-1.20180101.abcde, ???) or (1.2-20180101.abcde, ???)
+
* (1.2-1.20180101.abcde, ???)
  
 
=== Conceptual issues with tilde ===
 
=== Conceptual issues with tilde ===
Line 68: Line 73:
 
** 1.2 < 1.2.1~1 < 1.2.1~2 < 1.2.1 (X~Z is less than all possible X)
 
** 1.2 < 1.2.1~1 < 1.2.1~2 < 1.2.1 (X~Z is less than all possible X)
 
** 1.2 < 1.2:1 < 1.2?2 < 1.2.1 (X?Z is greater than X but less than all possible X.Y).
 
** 1.2 < 1.2:1 < 1.2?2 < 1.2.1 (X?Z is greater than X but less than all possible X.Y).
* There may be a point where upstream has decided what to call the next release, but hasn't given you anything to put after the ~.  Though it does appear that 1.2~ is actually less than 1.2~anything, which could be useful.  You can also use multiple tildes, which I have not explored.
+
* There may be a point where upstream has decided what to call the next release, but hasn't given you anything to put after the ~.  Double tildes could help here.
  
 
=== What to do? ===
 
=== What to do? ===
Line 75: Line 80:
  
 
# Don't change anything.
 
# Don't change anything.
# Allow tilde but 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.
+
# 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.
 
# Allow tilde. Keep post-release snapshot information in Release:.  Keep prerelease snapshot information in Version.
 
# Allow tilde. Keep post-release snapshot information in Release:.  Keep prerelease snapshot information in Version.
 
# Allow tilde, with post-release info in Release and prerelease info in a place decided by whether you ever intend to package snapshots.
 
# Allow tilde, with post-release info in Release and prerelease info in a place decided by whether you ever intend to package snapshots.

Revision as of 01:00, 10 November 2018

Notes for the tilde versioning drafts

There are two drafts:

Neither draft 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 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:

  • 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.2.1-1 + Epoch)

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:.

If we had some magical operator '?' or something which compared like this: (1.2-1 < 1.2?20180101.abcde < 1.2.1-1) then life would be golden, but I don't think it exists. All non alphanumerics besides '~' mean the same thing to RPM.

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~3.beta1)

An extra tilde kind of saves you:

  • (1.2~~20180101.abcde, 1.2~beta1)

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

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

Conceptual issues with tilde

There are two main issues with tilde:

  • It's one of a pair of operators, but we do not have its counterpart (shown as '?' below):
    • 1.2 < 1.2.1~1 < 1.2.1~2 < 1.2.1 (X~Z is less than all possible X)
    • 1.2 < 1.2:1 < 1.2?2 < 1.2.1 (X?Z is greater than X but less than all possible X.Y).
  • There may be a point where upstream has decided what to call the next release, but hasn't given you anything to put after the ~. Double tildes could help here.

What to do?

I see four 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.

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.

One thing is clear: allowing tilde 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.