From nobody Tue Jun 03 17:41:41 2025 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 4bBdLn0nfhz5xwXf for ; Tue, 03 Jun 2025 17:41:53 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBdLn0RmZz3fRK for ; Tue, 03 Jun 2025 17:41:53 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748972513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y/9aasTRGLNrmBww4/XW8rVGK5hWDXrQ7LLd5XQnYjQ=; b=YZgwT+5V9zzMDW5LSaMO7Zmzdf9gYalVO0cNPb7wAfTEFNeodCrPjZgzjy/IqrWiVfe7Dg nM88fCil0s3Xxxt8IUDKIC49P5FHTbjrPBBRSd/Fm+7Q1DJGQXubdXz1ixy8Z2DWgMRq6x rRJGInk1krtg4CItS216wL9a3yx4PTFHQRvF7qJypLeZTky1r7zZuD4ueKmR/dOeqENCJ/ mmSjslrB4e9bRljadbklrytwunrQhScQoAXajTltvue0M/oylEHPWBECjhYOy8s8bWCIiI QAXGhW3lBMyTmlZ/fuYgOBThHGyii0C4PKXIrL7Yf4F45S4JcZ+C1Zfogzgsow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748972513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y/9aasTRGLNrmBww4/XW8rVGK5hWDXrQ7LLd5XQnYjQ=; b=pkh/zDciPFxMORin2Ean3O0Gp0cst0JBexduszHVhmAGCAoQ1h7pkA8Ln+QOjQgRe4edDd mGOQ0+tQ5C/KoiDoqpGc3XB2jZQDJiapsGpAuut5cZj4DpBNvtP1HN4BkJLFFPAyZB5hpC 3DQlYk99KXmyAH/SG0nSCYEJndyRYUerA3gzkWUQPHaRN8zNmZor2SxaSgYfN5AM9GDIqH 8pfAbLZ/Ikc76SMTao5vxpiQk2OVrLr89+L6HO5bUNYVyflq9iT/X9Zti7fnwM+2pQkIak oZPnSpJ9ZmzsQXXM+Th1dfDZtrYqotQGWWSZ2KkAWaPWvHA0PBtx7jAernndyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748972513; a=rsa-sha256; cv=none; b=PNFTBALk9Og5GoVgYz2Z4yIApYfIzCn5vs/PQtSpmxbSPCqY5DIeLUQD07KJIeFtqNf35r OPo8epvzRh5Lxo1jAd14NfJX3MFiP93WqrZVtX8PocD3zlhGKxR4wg66psct3Iti2z2Cet HDNyUpVRidXt/YgYDv5CnWBNSaAnIoK2CtDZecFRVxXjqYiIIkrsff9VmU9NTXECzxdKVh m7WF4ObvijeAgs+/rmqG64EnQTo4RZ08u6x48J9nysuKNyFh+eHROBh9j4CY2kXiK137w7 HjaOW7+mCuOenXZTjX5TOBjUvAkbuYq9eKMrxdriXsc5QCspDr7zOh2Rcbt5PA== Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bBdLm6fLkz14sJ for ; Tue, 03 Jun 2025 17:41:52 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6f2af1e6d16so4256676d6.3 for ; Tue, 03 Jun 2025 10:41:52 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVMR7Efc5FnjokrJBr3n3hCEdkxeSLr3cwiceIRJxhqgi/pB8CwBqEK72M3HmdvG8bv+3J0iheHMHd6Bb5bqDM=@freebsd.org X-Gm-Message-State: AOJu0Yw7L9s8DCSa6ylISnKm6tNWhx2GjS4XEtdfdWZ8D5yJUaZYLFyz JWgyTyvKRYUthdTzQZQad+H/lcdPvUqIq0pqvxKcZrRdrDhBmfJbqCRnYAEytOkFgX0Q0KqJw0W VgM5d15txLG59czl/YojVU4t7TQldR/4= X-Google-Smtp-Source: AGHT+IHRTO6FJFYY8Mh307NXAcaSWqrxjIolTx6Tq2hz84QtRVad4YDrcim80ygFKe7IFosIgA2CRtGGDumXCI34cso= X-Received: by 2002:a05:622a:1a15:b0:471:f437:2973 with SMTP id d75a77b69052e-4a4431dcccfmr92986231cf.14.1748972512339; Tue, 03 Jun 2025 10:41:52 -0700 (PDT) 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 References: <28F2BDE7-5903-4C04-A570-6A407F19D5F2.ref@yahoo.com> <28F2BDE7-5903-4C04-A570-6A407F19D5F2@yahoo.com> <49396.1746554966@kaos.jnpr.net> <87401.1746562441@kaos.jnpr.net> <4ACBBC16-3BB6-436A-B0B1-A18F088B000E@yahoo.com> <4421.1746572832@kaos.jnpr.net> <2CA19E21-0F2F-465A-BE8E-81ACDEE42D23@yahoo.com> <10858.1746584427@kaos.jnpr.net> <27515.1747072855@kaos.jnpr.net> <3D5D0CE0-64A9-4A99-8282-61918987BA5C@yahoo.com> <8FA02BF7-2653-4B4A-8EFD-84C148473AF5@yahoo.com> <91572.1747150994@kaos.jnpr.net> <85314.1747165929@kaos.jnpr.net> In-Reply-To: <85314.1747165929@kaos.jnpr.net> From: Nuno Teixeira Date: Tue, 3 Jun 2025 18:41:41 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: AX0GCFtWJaUiWr64xVC97JPYz4s3eWmLcyWK9T9udIOhkTTpInFYiv1ohyCgTvQ Message-ID: Subject: Re: incremental bulds from scratch with beinstall.sh To: "Simon J. Gerraty" Cc: Mark Millard , FreeBSD Current Content-Type: multipart/alternative; boundary="00000000000051ef930636ae653b" --00000000000051ef930636ae653b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello! https://reviews.freebsd.org/D50313 has been acepted and soon it will be committed. I still have a lot of difficulties about how this works and how to be configured. Thinking if it will be some config examples be provided? Thanks Simon J. Gerraty escreveu (ter=C3=A7a, 13/05/2025 =C3=A0(= s) 20:52): > Mark Millard wrote: > > > If you are going to head down that path, I would highly recommend > > > using the 'mk' wrapper from > > > https://www.crufty.net/ftp/pub/sjg/sb-tools.tar.gz > > > We've used that model at work for over 20 years. > > > Described in https://www.crufty.net/sjg/docs/sb-tools.htm > > > > > > In a nutshell; each tree has a .sandbox-env file which can tune its > > > environment (as well as mark the top of the "sandbox"). > > > There are a plethora of other hooks to tune. > > > I find it especially useful with Emac's M-x compile > > > > I will take a look. > > > > Using my aarch64 context as an example (it > > has more variations than my amd64 > > environment, since I do nothing for i386 > > but aarch64 is also set up for armv7): > > you can do combinations. > > Eg Junos currently builds for last I counted, over 35 combinations of > architecture and OS we provide symlinks to 'mk' to simply usage. > Eg. you can always do 'mk --machine arm64,aarch64' but 'mk-arm64,aarch64' > is > less typing and allows for auto-completion. > > FreeBSD by uses MACHINE and MACHINE_ARCH as TARGET_SPEC_VARS, > Junos however only supports a single MACHINE_ARCH per MACHINE but > multiple TARGET_OS's (bsd15,bsd12,wrl9,...) so we use > MACHINE and TARGET_OS as TARGET_SPEC_VARS. > > You can of course extend that for your own use, so that you could have > mk --machine arm64,aarch64,something to set > TARGET_SPEC=3Darm64,aarch64,something > > but that assumes that the objects for arm64,aarch64,something should be > kept separate from those for arm64,aarch64,other > > If "something" and "other" really represent things to be built for > arm64,aarch64, then setting up targets for them is another option. > > There is nothing to stop you of course from using any of the scripts > below in conjuction with the setup supported by 'mk'. > > Things that everyone is likely to need/use can/should be setup as > targets so 'mk-arm64,aarch64 dbg-kernel' "just worked" > but things that do not fit that criteria are better served as scripts > such as you have. > > This is in some way a reflection of the difference b/w an emedded vendor > who is typically only interested in a very small sub-set of the > architectures supported by the project, but wants them handled the same > way by 100's if not 1000's of devs. Eg we put all our Juniper specific > targets under a juniper/ tree - that works with the same DIRDEPS_BUILD > bits as FreeBSD can. > > > I have 8 aarch64 scripts that have the > > likes of __MAKE_CONF (and more) specified > > that do individual system builds of main's > > kernel or world: > > > > # ls -C1 ~/build-sys-*dbg-*.sh > > /root/build-sys-main-CA7-dbg-kernel.sh > > /root/build-sys-main-CA7-dbg-world.sh > > /root/build-sys-main-CA7-nodbg-kernel.sh > > /root/build-sys-main-CA7-nodbg-world.sh > > /root/build-sys-main-CA76-dbg-kernel.sh > > /root/build-sys-main-CA76-dbg-world.sh > > /root/build-sys-main-CA76-nodbg-kernel.sh > > /root/build-sys-main-CA76-nodbg-world.sh > > > > The above in turn involve use of appropriate > > files from: > > > > # ls -C1 ~/src.configs/* > > /root/src.configs/make.conf > > /root/src.configs/src.conf.CA7-dbg-clang.aarch64-host > > /root/src.configs/src.conf.CA7-nodbg-clang.aarch64-host > > /root/src.configs/src.conf.CA76-dbg-clang.aarch64-host > > /root/src.configs/src.conf.CA76-nodbg-clang.aarch64-host > > > > ~/src.configs/make.conf is common to all 8. > > Which is consistent with how one might setup a .sandbox-env for that > tree - it might do nothing more than set > > export __MAKE_CONF=3D$HOME/src.configs/make.conf > > > > > They also use my git worktree: /usr/main-src/ > > > > ( /usr/src/ is from PkgBase and, so, has no > > .git/ repository. A different /usr/*-src/ > > has the .git repository. ) > > > > > > I also have 7 scripts that run more than > > one of those ~/build-sys-*dbg-*.sh in a > > sequence: > > > > # ls -C1 ~/build-sys-*[67]-[kw]*.sh > > /root/build-sys-main-CA7-kernel.sh > > /root/build-sys-main-CA7-world-kernel.sh > > /root/build-sys-main-CA7-world.sh > > /root/build-sys-main-CA76-kernel.sh > > /root/build-sys-main-CA76-world-kernel.sh > > /root/build-sys-main-CA76-world.sh > > /root/build-sys-main-CA76_CA7-world-kernel.sh > > > > (Each of those 7 build both -dbg- and -nodbg- > > variations.) > > Sounds like something more suited to a set of targets - which could > reduce redundant work? > > > > > > > For reference: > > > > CA76: cortex-a76 (aarch64) > > CA7: cortex-a7 (armv7) > > > > # ls -dC1 /usr/obj/BUILDs/*/ > > /usr/obj/BUILDs/main-CA7-dbg-clang/ > > /usr/obj/BUILDs/main-CA7-nodbg-clang/ > > /usr/obj/BUILDs/main-CA76-dbg-clang/ > > /usr/obj/BUILDs/main-CA76-nodbg-clang/ > > > > I do not use ~/src.configs/make.conf with > > poudriere-devel for package builds. I avoid > > doing package builds outside of poudriere > > in normal circumstances. > > > > I normally do not build stable/* or releng/*.* > > systems, just using official FreeBSD builds > > for such. (Long ago I used to build more > > variations.) > > > > I only build amd64 systems on amd64; I only > > build aarch64 and armv7 on aarch64. (Long > > ago I used to cross build little endian > > systems on amd64.) > > We cross-build everything ;-) > --=20 Nuno Teixeira FreeBSD UNIX: Web: https://FreeBSD.org --00000000000051ef930636ae653b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello!

https://reviews.freebsd.org/D50313 has been a= cepted and soon it will be committed.

I still have a lot = of difficulties about how this works and how to be configured.
Thinking if it will be some config examples be provided?

Thanks

Simon J. Gerraty <sjg@juniper.net> escreveu (ter=C3=A7a, 13/05= /2025 =C3=A0(s) 20:52):
Mark Millard <marklmi@yahoo.com> wrote:
> > If you are going to head down that path, I would highly recommend=
> > using the 'mk' wrapper from
> > https://www.crufty.net/ftp/pub/sjg/sb-to= ols.tar.gz
> > We've used that model at work for over 20 years.
> > Described in https://www.crufty.net/sjg/docs/s= b-tools.htm
> >
> > In a nutshell; each tree has a .sandbox-env file which can tune i= ts
> > environment (as well as mark the top of the "sandbox").=
> > There are a plethora of other hooks to tune.
> > I find it especially useful with Emac's M-x compile
>
> I will take a look.
>
> Using my aarch64 context as an example (it
> has more variations than my amd64
> environment, since I do nothing for i386
> but aarch64 is also set up for armv7):

you can do combinations.

Eg Junos currently builds for last I counted, over 35 combinations of
architecture and OS we provide symlinks to 'mk' to simply usage. Eg. you can always do 'mk --machine arm64,aarch64' but 'mk-arm6= 4,aarch64' is
less typing and allows for auto-completion.

FreeBSD by uses MACHINE and MACHINE_ARCH as TARGET_SPEC_VARS,
Junos however only supports a single MACHINE_ARCH per MACHINE but
multiple TARGET_OS's (bsd15,bsd12,wrl9,...) so we use
MACHINE and TARGET_OS as TARGET_SPEC_VARS.

You can of course extend that for your own use, so that you could have
mk --machine arm64,aarch64,something to set
TARGET_SPEC=3Darm64,aarch64,something

but that assumes that the objects for arm64,aarch64,something should be
kept separate from those for arm64,aarch64,other

If "something" and "other" really represent things to b= e built for
arm64,aarch64, then setting up targets for them is another option.

There is nothing to stop you of course from using any of the scripts
below in conjuction with the setup supported by 'mk'.

Things that everyone is likely to need/use can/should be setup as
targets so 'mk-arm64,aarch64 dbg-kernel' "just worked" but things that do not fit that criteria are better served as scripts
such as you have.

This is in some way a reflection of the difference b/w an emedded vendor who is typically only interested in a very small sub-set of the
architectures supported by the project, but wants them handled the same
way by 100's if not 1000's of devs.=C2=A0 Eg we put all our Juniper= specific
targets under a juniper/ tree - that works with the same DIRDEPS_BUILD
bits as FreeBSD can.

> I have 8 aarch64 scripts that have the
> likes of __MAKE_CONF (and more) specified
> that do individual system builds of main's
> kernel or world:
>
> # ls -C1 ~/build-sys-*dbg-*.sh
> /root/build-sys-main-CA7-dbg-kernel.sh
> /root/build-sys-main-CA7-dbg-world.sh
> /root/build-sys-main-CA7-nodbg-kernel.sh
> /root/build-sys-main-CA7-nodbg-world.sh
> /root/build-sys-main-CA76-dbg-kernel.sh
> /root/build-sys-main-CA76-dbg-world.sh
> /root/build-sys-main-CA76-nodbg-kernel.sh
> /root/build-sys-main-CA76-nodbg-world.sh
>
> The above in turn involve use of appropriate
> files from:
>
>=C2=A0 # ls -C1 ~/src.configs/*
> /root/src.configs/make.conf
> /root/src.configs/src.conf.CA7-dbg-clang.aarch64-host
> /root/src.configs/src.conf.CA7-nodbg-clang.aarch64-host
> /root/src.configs/src.conf.CA76-dbg-clang.aarch64-host
> /root/src.configs/src.conf.CA76-nodbg-clang.aarch64-host
>
> ~/src.configs/make.conf is common to all 8.

Which is consistent with how one might setup a .sandbox-env for that
tree - it might do nothing more than set

export __MAKE_CONF=3D$HOME/src.configs/make.conf

>
> They also use my git worktree: /usr/main-src/
>
> ( /usr/src/ is from PkgBase and, so, has no
> .git/ repository. A different /usr/*-src/
> has the .git repository. )
>
>
> I also have 7 scripts that run more than
> one of those ~/build-sys-*dbg-*.sh in a
> sequence:
>
> # ls -C1 ~/build-sys-*[67]-[kw]*.sh
> /root/build-sys-main-CA7-kernel.sh
> /root/build-sys-main-CA7-world-kernel.sh
> /root/build-sys-main-CA7-world.sh
> /root/build-sys-main-CA76-kernel.sh
> /root/build-sys-main-CA76-world-kernel.sh
> /root/build-sys-main-CA76-world.sh
> /root/build-sys-main-CA76_CA7-world-kernel.sh
>
> (Each of those 7 build both -dbg- and -nodbg-
> variations.)

Sounds like something more suited to a set of targets - which could
reduce redundant work?

>
>
> For reference:
>
> CA76: cortex-a76 (aarch64)
> CA7:=C2=A0 cortex-a7=C2=A0 (armv7)
>
> # ls -dC1 /usr/obj/BUILDs/*/
> /usr/obj/BUILDs/main-CA7-dbg-clang/
> /usr/obj/BUILDs/main-CA7-nodbg-clang/
> /usr/obj/BUILDs/main-CA76-dbg-clang/
> /usr/obj/BUILDs/main-CA76-nodbg-clang/
>
> I do not use ~/src.configs/make.conf with
> poudriere-devel for package builds. I avoid
> doing package builds outside of poudriere
> in normal circumstances.
>
> I normally do not build stable/* or releng/*.*
> systems, just using official FreeBSD builds
> for such. (Long ago I used to build more
> variations.)
>
> I only build amd64 systems on amd64; I only
> build aarch64 and armv7 on aarch64. (Long
> ago I used to cross build little endian
> systems on amd64.)

We cross-build everything ;-)


--
Nuno Teixeira
=
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--00000000000051ef930636ae653b--