Gentoo Archives: gentoo-dev

From: Raymond Jennings <shentino@×××××.com>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] JFYIOR: A Simple Package Versioning Spec
Date: Sat, 19 Sep 2015 03:13:29
Message-Id: CAGDaZ_rtDv0xi0y++yVsMTLFntjJdXQ-JMiHods_c7Ok9n89Yg@mail.gmail.com
In Reply to: Re: [gentoo-dev] JFYIOR: A Simple Package Versioning Spec by Kent Fredric
1 Gentoo is a distribution that incorporates heterogeneous software packages,
2 each of which may have their own versioning scheme.
3
4 We kinda have to treat the upstream version as an opaque blob because of
5 this.
6
7 Maybe I'm missing something but I don't think it's ok to screw with
8 upstream supplied version numbers. Sorting them is fine but to me they
9 appear best treated as whole atoms that shouldn't be picked apart.
10
11 On Fri, Sep 18, 2015 at 6:02 PM, Kent Fredric <kentfredric@×××××.com> wrote:
12
13 > On 19 September 2015 at 10:09, konsolebox <konsolebox@×××××.com> wrote:
14 > > As for A6FGHKE and TRIAL, it's impossible to tell their actual level
15 > > values so even if we choose to map them lexicographically, we would
16 > > still not be able to use a universal algorithm that could tell how it
17 > > affects the base version (just like how stages affects it) and how it
18 > > compares with other values as well. So it would still be up to the
19 > > maintainer how he would represent the versions on ebuilds.
20 > >
21 > > One could do:
22 > >
23 > > Math-BaseCnv-1.6.20YYMMDD
24 > >
25 > > and
26 > >
27 > > Ubic-1.58.01.20YYMMDD or Ubic-1.58.01_pre20YYMMDD
28 >
29 >
30 > And both of those translations would be wrong.
31 >
32 > Math::BaseCnv's version is illegal even by Perl standards, but it uses
33 > it anyway.
34 >
35 > And that also means the is no way in Perl to declare you need
36 > 1.6.A6FG, any such dependency will either be treated as impossible to
37 > satisfy, or satisfiable by all versions, and there is no way to even
38 > *sort* versions that have invalid string components. Using a date
39 > based segment in Gentoo will allow us to package the component itself,
40 > but date order doesn't actually imply version order, they're just
41 > highly similar. Which basically means even *if* we normalise it
42 > somehow, any dependency we have on it in tree is just waiting to be
43 > wrong.
44 >
45 > Fortunately, cases like that are rare, and the associated yelling in
46 > bug reports are preferred avoided.
47 >
48 > And in the latter case, the "TRIAL" component is not actually part of
49 > the version, but is itself a release-grade specifier, and just
50 > so happens to be part of the *archive* name.
51 >
52 > This is because CPAN upstream are not "archive" oriented dependencies,
53 > but *module* oriented dependencies.
54 >
55 > And an archive can have >1 modules and they may not all have the same
56 > version.
57 >
58 > Hence, http://cpansearch.perl.org/src/MMCLERIC/Ubic-1.58_01-TRIAL/
59 >
60 > Is actually just "1.58_01" + Alpha signifier
61 >
62 > Which here is redundant, because the "_" is an alpha signifier as
63 > well, and is deemed invisible in perl code.
64 >
65 > Alas, there's a horrible historical bug in version.pm that stupidly
66 > treats "_" in any version as significant.
67 >
68 > But either way, the right way to nomalise those versions is to elide
69 > the _ and '-TRIAL' parts.
70 >
71 > So the version is in fact: 1.5801 + ALPHA grade
72 >
73 > And then you get to the horror of the fact CPAN has *2* versioning schemes:
74 >
75 > MAJOR.FLOATINGPART
76 >
77 > DECIMAL.DECIMAL.
78 >
79 > Which means:
80 >
81 > 1.58.1 is less than 1.58
82 >
83 > Why?
84 >
85 > Because 1.58.1 would be 1.058001 ( decimal to float conversion )
86 > And 1.58 would be 1.580000 ( float not converted due to only 2 parts )
87 >
88 > This is the horror of mixing too many version schemes into the same
89 > namespace.
90 >
91 > You get recurrent horrible gotchas that nobody intends on making, and
92 > makes repeatedly.
93 >
94 > The collective experience of Perl/CPAN and versions is that the
95 > toolchain operators
96 > wish we'd only ever had one version scheme, because there are just
97 > *so* *many* *ways*
98 > to confuse yourself when you switch from one scheme to another
99 > thinking its fine.
100 >
101 > And there are *so* *many* *ways* to royally cock it up, or do it the
102 > best way possible, and then have
103 > a downstream vendor not understand the reality of perl versions and
104 > then have downstream make a mess of it.
105 >
106 > For instance, downstreams without education are tend to see:
107 >
108 > 1.1, 1.10 , 1.2, 1.20
109 >
110 > as:
111 >
112 > 1.1 , 1.2, 1.10, 1.20
113 >
114 > When in reality, 1.10 = 1.10, and 1.2 == 1.20
115 >
116 > In short: I'd rather Gentoo just had a tighter version scheme and good
117 > tooling to allow mapping from one-scheme to another
118 > on a case-by-case basis with forced normalised versions on the package
119 > itself.
120 >
121 > Perl Herd are doing just that because it greatly simplifies version
122 > interactions.
123 >
124 >
125 > --
126 > Kent
127 >
128 > KENTNL - https://metacpan.org/author/KENTNL
129 >
130 >