From nobody Sun Aug 06 16:22:43 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RJl9S6v2Kz4m3wW for ; Sun, 6 Aug 2023 16:22:52 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RJl9S3DYMz3cpv for ; Sun, 6 Aug 2023 16:22:52 +0000 (UTC) (envelope-from grembo@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail.evolve.de (OpenSMTPD) with ESMTP id aead8be1; Sun, 6 Aug 2023 16:22:44 +0000 (UTC) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id 15bde8a8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 6 Aug 2023 16:22:44 +0000 (UTC) Content-Type: multipart/alternative; boundary=Apple-Mail-BE6BFDC8-DAA4-4C10-B1AD-29A2BF543C85 Content-Transfer-Encoding: 7bit List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (1.0) Subject: Re: make buildworld puts legacy tools into the /usr/obj/... tree From: Michael Gmelin In-Reply-To: Date: Sun, 6 Aug 2023 18:22:43 +0200 Cc: Matthias Apitz , freebsd-current@freebsd.org Message-Id: References: To: Warner Losh X-Mailer: iPhone Mail (20F75) X-Rspamd-Queue-Id: 4RJl9S3DYMz3cpv X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE] --Apple-Mail-BE6BFDC8-DAA4-4C10-B1AD-29A2BF543C85 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On 6. Aug 2023, at 18:12, Warner Losh <imp@bsdimp.com> wrote:

=
=EF=BB=BF


On Sun, Aug 6, 2023 at 10:05=E2=80=AFAM Matth= ias Apitz <guru@unixarea.de> w= rote:
El d=C3=ADa d= omingo, agosto 06, 2023 a las 09:58:32a. m. -0600, Warner Losh escribi=C3=B3= :

> On Sun, Aug 6, 2023 at 7:58=E2=80=AFAM Matthias Apitz <guru@unixarea.de> wrote:
= >
> >
> > I did, based of a git clone of head, a clean compile of world and k= ernel
> > with
> >
> > # cd /usr
> > # rm -rf obj
> > # mkdir obj
> > # cd src
> > # make -j8 buildworld
> > # make -j8 buildkernel
> > ...
> > I installed the result and the system runs fine. For some test I w= anted
> > to do another installation to some DESTDIR with
> >
> > # make installworld DESTDIR=3D/home/...
> >
> > This failed with:
> >
> > --- installworld ---
> > mkdir -p /tmp/install.j76anzU56j
> >
> > ...
> > Required library libdialog.so.8 not found.
> > *** [installworld] Error code 1
> >
> > make[1]: stopped in /usr/src
> >
> > Investigating the problem it turned out that the 'make buildworld'= puts
> > a lot of legacy binaries in to some directory:
> >
> > # ls -l /usr/obj/usr/src/amd64.amd64/tmp/legacy/bin
> > total 36976
> > -r-xr-xr-x  1 root wheel   13304 Nov 30  2020 [=
> > lrwxr-xr-x  1 root wheel      54 Aug  5 1= 3:05 apropos ->
> > /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin/mandoc
> > -rwxr-xr-x  1 root wheel 1008512 Aug  5 13:05 asn1_compi= le
> > -r-xr-xr-x  1 root wheel  217504 Nov 30  2020 awk > > -r-xr-xr-x  1 root wheel    9576 Nov 30  2020 b= asename
> > -r-xr-xr-x  1 root wheel  195712 Nov 30  2020 bmake=
> > -r-xr-xr-x  1 root wheel   33848 Nov 30  2020 b= unzip2
> > ...
> > They are all from the system before updating it (from Nov 30 2020)= and
> > of course are missing shared libs when they get called in the actu= al
> > system, for example
> >
> > # ldd /usr/obj/usr/src/amd64.amd64/tmp/legacy/bin/tzsetup
> > /usr/obj/usr/src/amd64.amd64/tmp/legacy/bin/tzsetup:
> >         libdialog.so.8 =3D> not found (= 0)
> >         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >         libncursesw.so.9 =3D> /lib/lib= ncursesw.so.9 (0xf283d7b4000)
> >         libc.so.7 =3D> /lib/libc.so.7 (= 0xf283e729000)
> >         libtinfow.so.9 =3D> /lib/libti= nfow.so.9 (0xf283c93d000)
> >         [vdso] (0xf283c4a4000)
> >
> > # which tzsetup
> > /usr/sbin/tzsetup
> > # ldd /usr/sbin/tzsetup
> > /usr/sbin/tzsetup:
> >         libprivatebsddialog.so.0 =3D> /= usr/lib/libprivatebsddialog.so.0
> > (0x1797fe45c000)
> >         libc.so.7 =3D> /lib/libc.so.7 (= 0x1797fec89000)
> >         libncursesw.so.9 =3D> /lib/lib= ncursesw.so.9 (0x1798011df000)
> >         libtinfow.so.9 =3D> /lib/libti= nfow.so.9 (0x17980043d000)
> >         libformw.so.6 =3D> /usr/lib/li= bformw.so.6 (0x17980164c000)
> >         [vdso] (0x1797fe2d9000)
> >
> > Why is this with the tools in /usr/obj/usr/src/amd64.amd64/tmp/leg= acy/bin ?
> > Or what I have done wrong or overlooked?
> >
>
> So, the build process builds tools that are used to make and install > FreeBSD.
> That's what legacy is about: providing a compatible way to do all this.= We
> setup env vars, etc, so that these tools pull their libraries from lega= cy
> as well
> so that we have a consistent set of binaries to run on while the rest o= f
> the world
> is being replaced. I'm surprised to see this failing, since it's what > nanobsd does
> all the time, and I build new systems with nanobsd every week based on<= br> > recent
> current trees.
>
> Is there a libdalog.so.8 in your tmp/legacy tree at all?

No, there is not:

root@jet:~ # find /usr/obj.broken -name libdalog.so.8
root@jet:~ #

The problem, for sure, is not when you build every day, but in my case
the last build (and the system used for building) was 2 years old. And note:=
I started with an empty new /usr/obj.

So= what's the vintage of the host you are building with? And what sources are<= /div>
you building...

Also of note: we switched= to no-clean builds by default which is way faster, but
also expos= es issues like this...

Thanks, this is valuable information (starts ada= pting idempotent playbooks).

-m
= --Apple-Mail-BE6BFDC8-DAA4-4C10-B1AD-29A2BF543C85--