1 |
On 4/20/20 4:21 PM, Georg Rudoy wrote: |
2 |
> вс, 19 апр. 2020 г. в 16:09, Michael Orlitzky <mjo@g.o>: |
3 |
>> But please quit looking to Go as an example of anything |
4 |
>> anyone should be doing. |
5 |
> |
6 |
> On a somewhat related note, I'd like to take this chance to ask about |
7 |
> packaging haskell software, which has somewhat similar issues: |
8 |
> |
9 |
> ... |
10 |
> 3. What is major is the following. Let's say two executables A and B |
11 |
> depend on libfoo:1 and libfoo:2 respectively, and depend on the same |
12 |
> version of libbar. libbar itself depends on libfoo (and supports both |
13 |
> versions), but libbar built with libfoo:1 is incompatible with libbar |
14 |
> built with libfoo:2. Loosely speaking, the slot of a library is |
15 |
> defined by all its dependencies' _versions_. |
16 |
> |
17 |
> Of all these, (3) is quite major, as it leads to exponential explosion |
18 |
> of the slots count. Otherwise, one might choose to carefully curate |
19 |
> the library versions, ensuring that no such situation arises, but this |
20 |
> approach is neither feasible nor possible at all for sufficiently |
21 |
> large packages base. |
22 |
|
23 |
There's nothing Haskell-specific here, is there? Except that Haskell as |
24 |
a research language tends to inspire more "fire and forget" software. |
25 |
(And Haskell works better in Gentoo than anywhere else, in my opinion.) |
26 |
|
27 |
You package each dependency as a separate package. If there's a conflict |
28 |
between two packages, then... you can't have those two packages |
29 |
installed together. When that happens, you alert upstream, and try to |
30 |
convince them to be more lenient with their dependencies (again, nothing |
31 |
Haskell-specific here). Sometimes that involves code changes, but often |
32 |
it's just an edit to the cabal file. Many people follow either semver or |
33 |
the PVP (https://pvp.haskell.org/) which keeps things from getting too |
34 |
far out of control. |
35 |
|
36 |
If upstream absolutely insists on minor-version dependencies, then you |
37 |
either tolerate it conflicting with everything else, or leave it out of |
38 |
the tree. You probably shouldn't even be packaging a library whose API |
39 |
is distinguishable across minor releases. |
40 |
|
41 |
Software engineering is a fractal. Curating APIs and dependencies is as |
42 |
much a part of it as what sorting algorithms you choose. These are all |
43 |
old problems with known solutions (sonames, semver, etc.) and software |
44 |
isn't magically high-quality because it's written in a language that |
45 |
came our last week. |
46 |
|
47 |
So aside from the "What's Gentoo?" that's going to be more common among |
48 |
Haskell upstreams, I don't see anything fundamentally different here |
49 |
between Haskell (or Go, or...) and C. We should be helping to make |
50 |
upstream software more good, and then packaging it. (It's OK to hack the |
51 |
cabal file while the bug report is open.) |