[distri] Re: Building distri packages on distri

  • From: Jan Bölsche <jan@xxxxxxxxxxxx>
  • To: distri@xxxxxxxxxxxxx
  • Date: Sun, 19 Sep 2021 13:52:14 +0200

Hi Michael,

thanks, that got me started!

To better understand what is going on, I looped over (with
/root/distri/pkgs/bash as cwd)
   distri build
   see form the error message what package is missing
   distri install $MISSINGPKG
   cp --link /roimg/$MISSINGPKG* ~/distri/_build/distri/pkg

I was surprised by the fact that bash wouldn't build without mpc .. (the
music player daemon client). The only dependency that is listed in
bash/build.textproto is ncurses (which in turn lists one runtime_dep
(glibc) in /roimg/ncurses....meta.textproto)

Is there a way to automatically discover needed build dependencies, other
than repeatedly trying `distri build`?
Just for my better understanding: Are build dependencies supposed to be
listed in build.textproto in their entirety? (not including transitive deps
I suppose) Or do we assume a set of packages to be present on all dev
machines (like the package group "base-devel" on Arch)

If build deps are supposed to be listed in build.textproto: is there a way
to declare them as build deps explicitly? (or do all listed deps in
build.textproto count as build deps, because runtime_deps are discovered
automatically?)

I could work on a script that generates a patch to add missing build deps
for all build.textproto (by using the loop approach described above, but
automated) if that makes sense at all. (which I am not sure of). It could
help uncover some surprising things like bash not building without mpc
installed, at the very least.

Thanks for your time and quick answer!
Jan


On Sun, Sep 19, 2021 at 10:24 AM Michael Stapelberg <
michael+distri@xxxxxxxxxxxxx> wrote:

Hey Jan

Thanks for your interest!

You have multiple options to get the build to work.

The quickest option if you just want to build OpenSSH
is to install the build dependencies in your running distri instance,
and then hardlink the package images into your
$DISTRIROOT/_build/distri/pkg/, for example:

distri0# distri install git bzip2 patch diffutils file make musl strace
gcc binutils zlib openssl pam xauth bash
distri0# cp --link /roimg/* ~/distri/_build/distri/pkg/
distri0# distri build

The other option, to build without having to change your running instance
(and only work within $DISTRIROOT),
is to download all distri packages from our mirror server, see:
https://github.com/distr1/distri/issues/84#issuecomment-744575431

If you’re curious about prior discussion, see

https://www.freelists.org/post/distri/Setting-up-development-environment-for-packaging,1

We should really make distri build pull these images by default, so that
builds work out of the box :)

Best regards
Michael


On Sun, 19 Sept 2021 at 09:43, Jan Bölsche <jan@xxxxxxxxxxxx> wrote:

Hey!

I am excited about distri's approach to package management and
system-building. I'd like to take part in exploring the problem space,
especially the aspect of peer-to-peer package installation, peer-to-peer
system updates and reproducible system image building.

I did my first stumbling around in the world of distri by downloading the
supersilverhaze image, and booting it from USB. I then:

distri0# source <(distri env)
distri0# git clone https://github.com/distr1/distri $DISTRIROOT

Then I tried, just for fun, to build openssh:

distri0# cd $DISTRIROOT/pkgs/openssh
distri0# distri build
2021/09/18 15:16:00 building openssh-amd64-8.2p1-11
2021/09/18 15:16:00 downloading
https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.2p1.tar.gz
to openssh-8.2p1.tar.gz
2021/09/18 15:16:04 verifying openssh-8.2p1.tar.gz
patching file sshd_config
2021/09/18 15:16:04 cherry picked config.patch
patching file ssh.service
2021/09/18 15:16:04 cherry picked service.patch
build: build: builddeps: glob: glob1(bash-amd64): package "bash" not
found (pattern /root/distri/_build/distri/pkg/bash-amd64-*.meta.textproto)

Since it is missing metadata for bash, I tried `distri build` in
pkgs/bash, but that fails with the same error message. Seems I can't build
bash because I haven't build bash ...?

I am probably missing some bootstrapping step. Can you give me a quick
hint?

Thanks!
Jan



Other related posts: