Gentoo Archives: gentoo-dev

From: James Le Cuirot <chewi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Integrating Portage with other package managers
Date: Thu, 08 Mar 2018 21:00:08
Message-Id: 20180308205943.5ec58869@symphony.aura-online.co.uk
In Reply to: [gentoo-dev] Integrating Portage with other package managers by anoteros@teknik.io
1 On Wed, 7 Mar 2018 11:06:47 -0500
2 anoteros@××××××.io wrote:
3
4 > Having used Gentoo for a few years now, one thing that has been annoying
5 > to me is the tremendous duplication of effort and uphill battle of
6 > creating ebuilds (build recipes) for language-specific packages that
7 > already have their own build systems.
8 >
9 > For example, many languages such as Python (pip), Node (npm), Ruby
10 > (gems), TeXLive (tlmgr), Haskell (cabal), Rust (cargo) have ways of
11 > redistributing up-to-date dependencies and ensuring that they build
12 > properly in most environments.
13
14 I was expecting to see Java's Maven in this list. Gentoo Java is in
15 trouble because we have basically given up trying to keep up with the
16 ecosystem. The last time anything under dev-java was bumped, other than
17 JVMs and Tomcat-related stuff, was January 20th. We could be bumping 5
18 packages a day and still not keep up, never mind all the things we
19 haven't packaged at all yet.
20
21 Java's problem is somewhat unique in that although you can have
22 optional dependencies at runtime, unless you go out of your way
23 (and nobody ever does), all these optional dependencies are required
24 at build time. Suddenly a package that might normally only have 2
25 dependencies now has 20. But wait, that's just the first level of
26 dependencies! This can repeat on and on and you end up battered and
27 bruised having packaged 100 things but still not the one you actually
28 wanted.
29
30 I therefore put some thought into something along the lines of what you
31 have suggested. Java is supposed to be write (or really build) once,
32 run anywhere so why are we wasting time building things that we don't
33 have to? That's certainly why upstreams look at us like we're crazy
34 whenever we dare to contact them. If we can leverage Maven or whatever
35 to grab the platform-neutral dependencies for us, we can focus
36 attention on the few that have native libraries and also things like
37 icons, desktop entries, etc, that Maven doesn't deal with.
38
39 But how would this work? I thought perhaps the dependencies we don't
40 care about could be installed into a Maven repository, essentially
41 untracked by Portage but still self-contained, by fetching them in
42 src_unpack (or src_fetch, which I'd like to introduce) and then
43 installing them in pkg_preinst. However, unless src_fetch is
44 implemented, it would not be possible to install Java packages offline.
45 This approach would also break binary packages, effectively forcing
46 Java packages to have RESTRICT="bindist", although there would arguably
47 be little building to do anyway.
48
49 Apart from the fact that I haven't had time to do any of this, is this
50 even what Gentoo users want? I suspect not. But what's worse, this or a
51 totally stale or practically empty package repository?
52
53 Others have experimented with from-source ebuild generators but that
54 doesn't change the fact that putting all these ebuilds into the tree is
55 still a huge maintenance burden and because of the build time
56 dependency issue, end users will still have to build hundreds of
57 packages they don't even care about.
58
59 --
60 James Le Cuirot (chewi)
61 Gentoo Linux Developer