<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 20/07/18 10:54, Paul Sherwood wrote:<br>
</div>
<blockquote type="cite"
cite="mid:caaa3c0e8a52030ef939f6be17e5d5b4@codethink.co.uk">Hi Ben
<br>
On 2018-07-19 14:20, Ben Brewer wrote:
<br>
<blockquote type="cite">So over the past couple of weeks we've
been attempting to get a good
<br>
minimal distro using definitions and both ybd and bst, here are
our
<br>
findings so far.
<br>
<br>
We tried building the "morphs" branch of definitions using YBD,
and found:
<br>
1. The "morphs" branch is a bit out of date.
<br>
- Dependencies are not tracked properly in morphs because
of leakage.
<br>
</blockquote>
<br>
What do you mean precisely by 'leakage', please?
<br>
</blockquote>
Say package A depends on package B.<br>
And package C, depends on package A.<br>
Package C will have Package B staged, despite not having it as a
direct dependency, even though it may not require it.<br>
This leads to a situation where packages have dependencies that are
indirectly met, and not documented.<br>
<br>
<blockquote type="cite"
cite="mid:caaa3c0e8a52030ef939f6be17e5d5b4@codethink.co.uk">
<br>
<blockquote type="cite">2. YBD was in some cases crashing with
python errors that made little sense.
<br>
</blockquote>
<br>
Eek.
<br>
<br>
<blockquote type="cite">3. Because morph files don't differentiate
between runtime and
<br>
build-time dependencies, it's very hard to build a minimal
system:
<br>
a) Though the runtime should be 4 packages, there are a lot
of
<br>
build dependencies.
<br>
</blockquote>
<br>
Yes understood.
<br>
<br>
<blockquote type="cite"> - Our current system is 81
elements total.
<br>
b) Many overlaps are caused by dependency leakage.
<br>
4. YBD seemed a little faster than BuildStream
<br>
5. YBD needs to be run as sudo
<br>
</blockquote>
<br>
Fraid so.
<br>
<br>
<blockquote type="cite">We found that by switching to BST, we
gained a number of advantages.
<br>
1. The runtime/build split allows for proper dependency
tracking.
<br>
2. Much easier to debug using BST log and shell commands.
<br>
3. It's a little easier to track what's going on.
<br>
<br>
One feature we'd think is very important for BST is an easy way
of
<br>
tracking the number of runtime dependencies deployed in the
final
<br>
system, although I guess this could be scripted (this has been
<br>
reported).
<br>
</blockquote>
<br>
Is there an issue raised for that?
<br>
</blockquote>
Yep: <a
href="https://gitlab.com/BuildStream/buildstream/issues/406">https://gitlab.com/BuildStream/buildstream/issues/406</a><br>
Also discussed here: <a
href="https://gitlab.com/BuildStream/buildstream/issues/406">https://gitlab.com/BuildStream/buildstream/issues/416</a><br>
<br>
But as it turns out the functionality somewhat exists via:<br>
bst show <elements> --deps run<br>
<br>
Also, if run against a deployed image then it doesn't show the deps,
so you have to have some insight.<br>
<br>
So I guess this is a documentation issue, probably just that there's
no documentation for building a distro where the command would be
most useful.<br>
<blockquote type="cite"
cite="mid:caaa3c0e8a52030ef939f6be17e5d5b4@codethink.co.uk">
<blockquote type="cite">In resurrecting Baserock definitions, we
discovered the following
<br>
(non-exhaustive) list of issues:
<br>
1. Linux header version didn't match the kernel version.
<br>
- No automated checking is performed, but should be in many
<br>
cases, especially for bootstrapped components.
<br>
</blockquote>
<br>
That sounds like it would be an easy and useful thing to have a
test for in any 'trustable' implementation?
<br>
</blockquote>
Yes, it needs some thinking about. We need to remove as much
duplication or scope for error as is practical.<br>
<blockquote type="cite"
cite="mid:caaa3c0e8a52030ef939f6be17e5d5b4@codethink.co.uk">
<br>
<blockquote type="cite">2. Most packages have invisible
dependencies, for two reasons:
<br>
a) Baserock used the "Strata" concept, which don't track
<br>
dependencies accurately.
<br>
</blockquote>
<br>
Yes - that was/is a simplification
<br>
</blockquote>
Yeah, I've always thought it a bad one, and mentioned it before.
Hopefully we can fix it now :)<br>
<blockquote type="cite"
cite="mid:caaa3c0e8a52030ef939f6be17e5d5b4@codethink.co.uk">
<br>
<blockquote type="cite"> b) Most elements incorrectly list
their build depends as runtime
<br>
dependencies which causes leakage.
<br>
</blockquote>
<br>
Ack.
<br>
<br>
<blockquote type="cite">3. Many packages are simply downloaded
tarballs which have no
<br>
provenance and are not trustable (in our opinion).
<br>
</blockquote>
<br>
Noted.
<br>
<br>
<blockquote type="cite">4. There are many issues with
bootstrapping:
<br>
a) Many packages have circular dependencies and are not
correctly
<br>
bootstrapped.
<br>
</blockquote>
<br>
I'm surprised by that, actually. Certainly at the time it seemed
that quite a lot of effort was expended on 'bootstrapping'
<br>
</blockquote>
Only toolchain items are bootstrapped, which is basically gcc,
binutils and glibc (and a few others).<br>
Some pretty major stuff is not bootstrapped though: autoconf,
automake, libtool, flex, bison, etc.<br>
<blockquote type="cite"
cite="mid:caaa3c0e8a52030ef939f6be17e5d5b4@codethink.co.uk">
<br>
<blockquote type="cite"> - For example coreutils depends
upon itself, and baserock
<br>
compiles a random "join.c" from openbsd to resolve that
dependency :/
<br>
</blockquote>
<br>
Hmmm. I'm almost tempted to look at git blame for that. But
probably it would be more constructive just to say, let's start
afresh and do it 'properly'.
<br>
</blockquote>
It's not the worst compromise, but I probably wouldn't have made it.<br>
<blockquote type="cite"
cite="mid:caaa3c0e8a52030ef939f6be17e5d5b4@codethink.co.uk">
<br>
<blockquote type="cite"> b) The bootstrapping is very fragile,
updates to many packages
<br>
require the entire universe to be bootstrapped:
<br>
- GLIBC for example would require flex, bison and their
<br>
dependencies to be bootstrapped if we want to update it.
<br>
c) In many cases bootstrapping is avoided by including tar
files,
<br>
this is not a trustable way to build from source (in our
opinion).
<br>
d) bootstrapping is very complicated and causes a lot of
<br>
duplication, some automation of this would be highly beneficial.
<br>
5. There are so many hacks, scripts, or modified branches used
for
<br>
building various components that it's actually very difficult to
<br>
update components at all. Linux is one of the few elements that
can
<br>
easily be replaced.
<br>
<br>
We believe it is possible to fix the issues above, however these
are
<br>
not trivial issues to resolve.
<br>
<br>
With regards to the discussion where we set a goal of a
toolchain with
<br>
7 packages, and a runtime of around 3, we believe that to be
<br>
impossible if we perform proper bootstrapping. The numbers at
the
<br>
minute seem to indicate that we could build a minimal system
with 4
<br>
packages:
<br>
syslinux (bootloader), linux (kernel), toybox
(environment), musl (libc)
<br>
However, the toolchain will likely require order of 50 packages
(more
<br>
elements due to grouping and staging).
<br>
</blockquote>
<br>
Right. Even though it's non-trivial, I'm currently leaning towards
the 'let's do it properly'. But let's consider this more deeply
over the next few days.
<br>
</blockquote>
Yeah, I don't think we have any option but to 'do it properly', we
just have to nail down what that is :)<br>
<blockquote type="cite"
cite="mid:caaa3c0e8a52030ef939f6be17e5d5b4@codethink.co.uk">
<blockquote type="cite">Our current work can be viewed here:
<br>
<a class="moz-txt-link-freetext" href="https://gitlab.com/trustable/distros/minimal-distro">https://gitlab.com/trustable/distros/minimal-distro</a>
<br>
</blockquote>
<br>
Thanks!
<br>
<br>
Paul
<br>
<br>
</blockquote>
<p><br>
</p>
</body>
</html>