Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [RFC] New file layout for PKGDIR and binhosts
Date: Wed, 24 Dec 2014 19:17:37
Message-Id: 549B1147.4060007@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [RFC] New file layout for PKGDIR and binhosts by "vivo75@gmail.com"
1 On 12/24/2014 10:36 AM, vivo75@×××××.com wrote:
2 > Il 24/12/2014 17:07, Zac Medico ha scritto:
3 >> On 12/24/2014 04:01 AM, vivo75@×××××.com wrote:
4 >>> Il 24/12/2014 09:13, Zac Medico ha scritto:
5 >>>>> I like this (and it has been a long time coming). What format are we
6 >>>>>> going to store the metadata of the use flag combinations and the rest?
7 >>>> The current approach is to store the data in an xpak segment that is
8 >>>> appended to the end of the tbz2 file. The $PKGDIR/Packages files serves
9 >>>> as a cache for the essential parts of the xpak data that are used in
10 >>>> dependency calculations.
11 >>>>
12 >>> I'd like to see the xpak data being put in it's own file at the
13 >>> _beginning_ of the tar file.
14 >>>
15 >>> tar -Jcf \
16 >>> ${PKGDIR}/${CATEGORY}/${PN}/${PF}-${COUNTER}.xpak \
17 >>> tmp/${CATEGORY}:${PN}:${PF}-${COUNTER}.xpak \
18 >>> *all_the_other_stuff*
19 >>>
20 >>> this way reading it could be faster on some media and filesystem and it
21 >>> would not deviate from the standard tar.
22 >> There wouldn't be any benefit, because the data is practically always
23 >> read from the $PKGDIR/Packages cache anyway. The cache is generated when
24 >> the package is built, and the rate-limiting step there is the building
25 >> of the package.
26 > ack, and what about emerge on destination host?
27
28 The destination host uses a downloaded copy of $PKGDIR/Packages for
29 dependency calculations.
30
31 Also, I suspect that you're drastically over-estimating the cost of
32 accessing the xpak metadata, since otherwise you wouldn't be asking this
33 question.
34
35 >>> Being in /tmp/ is only for commodity but the place is debatable.
36 >>> Instead the fact it _must_ be the first file it's not, in a sequential
37 >>> archive file like tar some things depend on it.
38 >> With the current approach, the xpak segment is not part of the tar file.
39 >> The tar file is compressed, and the xpak segment is appended to the end
40 >> of the resulting bzip2 file.
41 >>
42 >>> seem to be the right time to do the change, since tool need to be
43 >>> rewritten anyway, but I'll leave to you analyze the fallout of this change.
44 >> There will be zero benefits from doing that.
45 > I see at least two however admittedly not too big
46 >
47 > 1) I see having a canonical tarball as an advantage, opposed to be
48 > forced to use /usr/bin/{qtbz2,qxpak}
49
50 You can already use tar to unpack our existing tbz2/xpak files. You only
51 need special tools if you want to access the package metadata, and I
52 think it's reasonable to expect anyone who wants to access the metadata
53 to have the appropriate tools.
54
55 > 2) there is a small benefit in space (which increase using xz) for
56 > bigger packages it would be smaller in percentage.
57 >
58 > -rw-r--r-- 1 root root 8720 24 dic 18.25 linuxtv-dvb-headers-5.8.tar.bz2
59 > -rw-r--r-- 1 root root 9691 24 dic 18.07 linuxtv-dvb-headers-5.8.tbz2
60
61 It think this savings is negligible. The environment.bz2 file accounts
62 for most of the space consumed by the xpak segment, and it is compressed
63 in order to save space.
64
65 > this has been obtained unpacking the xpak _and_ environment.bz2 (to
66 > avoid double compression) and putting them in a subdirectory
67 >
68 > ls -l tmp/linuxtv-dvb-headers-5.8/ usr
69 > tmp/linuxtv-dvb-headers-5.8/:
70 > total 80
71 > -rw-r--r-- 1 root root 11 Dec 24 18:20 BUILD_TIME
72 > -rw-r--r-- 1 root root 8 Dec 24 18:20 CATEGORY
73 > -rw-r--r-- 1 root root 2 Dec 24 18:20 DEFINED_PHASES
74 > -rw-r--r-- 1 root root 52 Dec 24 18:20 DESCRIPTION
75 > -rw-r--r-- 1 root root 2 Dec 24 18:20 EAPI
76 > -rw-r--r-- 1 root root 394 Dec 24 18:20 FEATURES
77 > -rw-r--r-- 1 root root 1 Dec 24 18:20 IUSE
78 > -rw-r--r-- 1 root root 30 Dec 24 18:20 KEYWORDS
79 > -rw-r--r-- 1 root root 24 Dec 24 18:20 PF
80 > -rw-r--r-- 1 root root 31 Dec 24 18:20 RDEPEND
81 > -rw-r--r-- 1 root root 2 Dec 24 18:20 SIZE
82 > -rw-r--r-- 1 root root 2 Dec 24 18:20 SLOT
83 > -rw-r--r-- 1 root root 65 Dec 24 18:20 USE
84 > -rw-r--r-- 1 root root 22859 Dec 24 18:21 environment
85 > -rw-r--r-- 1 root root 443 Dec 24 18:20 linuxtv-dvb-headers-5.8.ebuild
86 > -rw-r--r-- 1 root root 7 Dec 24 18:20 repository
87
88 We could save some more space in the xpak segment if we omitted the
89 ebuild, since environment.bz2 contains everything that we need from the
90 ebuild. We could also omit FEATURES, since it's non-essential and it's
91 included in environment.bz2 anyway. However, these are trivial
92 micro-optimizations.
93 --
94 Thanks,
95 Zac