Gentoo Archives: gentoo-dev

From: Dan Shearer <dan@×××××××.org>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Not-Forking 0.3.1 with ebuild
Date: Tue, 26 Jan 2021 17:15:20
Message-Id: CADB0MOO2aiPYH+pCV0B-NYisL2Z8BPE9hoT2-zG1+oU6V9cG1A@mail.gmail.com
In Reply to: Re: [gentoo-dev] Not-Forking 0.3.1 with ebuild by Gordon Pettey
1 Gordon,
2
3 Le mar. 26 janv. 2021 à 00:40, Gordon Pettey <petteyg359@×××××.com> a écrit :
4
5 > A bit off topic to whether or not there's an ebuild/maintainer for it
6
7 As to relevance to gentoo-dev:
8
9 1. Not-Forking is a package that general Gentoo users may want,
10 especially those who do embedded development or who maintain a suite
11 of apps.
12 The ebuild supplied with Not-Forking works today, but as a
13 non-Gentoo dev, I recognise that is not the same as having a
14 Maintainer or a Proxied Maintainer :-)
15
16 2. The problem Not-Forking addresses is one the Gentoo distribution
17 has at scale, and neither Git or any other other VCS can solve
18 unassisted and
19 in a general way. Part of this is what Debian calls vendoring[0].
20
21 > Instead of using the built-in features of Git like submodules and rebasing, depend on an external tool
22 > to make your repository even more messy?
23
24 Git cannot address the Not-Forking class of problems because the
25 decisions required are typically made by humans doing a
26 port or reimplementation where multiple upstreams need to be combined.
27 A patch stream can't describe what needs to be done,
28 so automating this requires a tangle of fragile one-off code.
29 Not-Forking makes it possible to write a build system without these
30 code tangles.
31
32 Examples of actions Not-Forking can take:
33
34 * check for new versions of all upstreams, doing comparisons of the
35 human-readable release numbers rather than repo checkins or tags,
36 where human-readable version numbers vary widely in their construction
37 * replace foo.c with bar.c in all cases (perhaps because we want to
38 replace a library that has an identical API with a safer
39 implementation)
40 * apply this patch to main.c of Upstream 0, but only in the case where
41 we are also pulling in upstream1.c, but not if we are also using
42 upstream2.c
43 * apply these non-patch changes to Upstream 0 main.c in the style of
44 `sed` rather than `patch`, making it possible to merge trees that a
45 VCS says are unmergable
46 * build with upstream1.c version 2, and upstream3.c version 3, both of
47 which are ported to upstream 0's main.c version 5
48 * track changes in all upstreams, which may use arbitrary release
49 mechanisms (Git, tarball, Fossil, other)
50 * cache all versions of all upstreams, so that a build system can step
51 through a large matrix of versions of code quickly, perhaps for
52 test/benchmark
53
54 I can best illustrate this with LumoSQL [1]. The point of LumoSQL is
55 to take the SQLite source code in one hand and up to five (currently
56 two)
57 existing key-value pair storage backends on the other, and make them
58 work together. LumoSQL has not developed a new version of SQLite,
59 and doesn't fork SQLite or the upstream key-value storage systems.
60 This is despite the fact SQlite was never intended to have pluggable
61 backends,
62 and none of the key-value pair storage systems were designed to be
63 compatible or to work with SQLite.
64
65 Thanks to Not-Forking, LumoSQL mostly consists of a build system[2] .
66 A single `make` command can generate a binary with:
67
68 * several versions of SQLite
69 * any or all of up to twenty versions of LMDB
70 * one version of BDB
71
72 in many combinations, with some combinations skipped because they
73 can't exist. Now that the LumoSQL build system exists, we can focus on
74 expanding the
75 range of versions and backends, confident that any manual porting work
76 can be turned into Not-Forking configuration items.
77
78 Now, you might ask "why doesn't SQLite have a backend storage API", to
79 which there are two answers:
80
81 a. Since it is probably the most-deployed software in the world with
82 billions of human end users and many billions more instances, SQLite
83 can do whatever it likes and other software just needs to accommodate
84 that. As it happens SQLite chooses to be extremely careful and
85 conservative about user-visible changes, especially the C API and
86 on-disk storage format. There are various issues with that, and SQLite
87 features and internals do change quite a bit, however, SQLite is very
88 unlikely to adopt a funky new architecture because it would be neater.
89 SQLite is intended to be forwards-compatible for decades, more or
90 less.
91
92 b. Despite (a) above, LumoSQL is developing a generic backend for
93 key-value stores to SQLite, and Richard Hipp has indicated he will
94 consider minimally-invasive patches to that end if they seem to be
95 generally helpful. So LumoSQL has committed to definitely not forking
96 SQLite (there are already countless SQLite forks in the world).
97
98 And that's why Not-Forking exists.
99
100 --
101 Dan Shearer
102 dan@×××××××.org
103
104 [0] https://lwn.net/Articles/836911/
105 Debian vendoring discussion
106 [1] https://lumosql.org/src/lumosql
107 LumoSQL home page
108 [2] https://lumosql.org/src/lumosql/doc/trunk/doc/lumo-build-benchmark.md
109 Detailed description of LumoSQL meta-build system