From nobody Sat Apr 13 17:07:25 2024 X-Original-To: dev-commits-src-all@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 4VH0HJ28Tvz5HnSL for ; Sat, 13 Apr 2024 17:07:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VH0HH6ggPz4Sc2 for ; Sat, 13 Apr 2024 17:07:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a4715991c32so239298566b.1 for ; Sat, 13 Apr 2024 10:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1713028057; x=1713632857; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AtAYMXqQ3MIsNw429DC7cCkWJ25qxU5Oe8ZguM0LnZY=; b=hiGMOIJHKe9w/AXuWFkoUGie8VwGa/xloRUbjcl2z4LlGjlEemEeo9mLvptngdb5zH 6acxBWuxR6hHWIsA41LnKYB9ZBM9a7j2qm92D6XMQBHFnb4BP7A/EkIoHmJfH6hJ/0m/ 3OIf0Qzpk5QO3QJIPXOXv6IV5R2vgfhkVs4SEPNMAZkUhwHg7aspo7j8EUHV0F88jD0j I/segw9vV6bCmFu7BAeeyPhFgr2jxCooaA8cTeKqnpJHBqKqx0LK60S9ST1a3mJMeTYp 2xd/qrFJp3MTopPYSTa12za9FSf+vOteR4lxUdLh/Nrrr0gEdbP1Ky8/EwN2UtPVNKjc fJjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713028057; x=1713632857; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AtAYMXqQ3MIsNw429DC7cCkWJ25qxU5Oe8ZguM0LnZY=; b=on6BXLHHNm/ggdPPG7tectoSj99YostFUhBTBaY+tHuE5sgbI/ZPtTPmf9nt6b8zQY fyPRNMD2+JHvC5uFIa6NfPp4ARptWkSKhiMhtWYfUC2+6Dg/c78mlf7anISCvlr9UXWB KoJ+bCl3BKKVU0yck/hJ7vQI2jS6SEiPVG/BU1l9/bs7WZ2FitV+D+7ecCkPT7bd+l8B m4GeS89KGpfbx8nFQ8NDbyDE2C0ypgtKlfyd7pMg9sSYm8bDHBiSs9H5/gwpV2VV3x2N DElYJC5v/LEU43CgYj/q8GNhsIVQ4+WKe2ksyHVKKGTVVZyzoyBV7uRpgCZ4xxtuRmdj 5PJg== X-Forwarded-Encrypted: i=1; AJvYcCXEK+pn+0UGrxtnbiNa09wr4Z5HmJucY4mxo+yBBPhcQml7QefeN1OJhBqsIjRz18AQ6yCveBOc6PCAYLEszy3DinXXj7VLbpk0SUJ3kJDo X-Gm-Message-State: AOJu0YxEPvUuewrO5XiomMJ34GduEIfTBMIo2cweNbFlMasGEw95bbQD b12Pe1FlkSCzcLeD3lxN3TXbDJ02htIBAVxIzCNBZH3GRcTzLDogw1PIk5YSFZuk8cu11Fanndv CWefUKSrgHJN9fyqCDgw7CGK/l1on55be2srBwA== X-Google-Smtp-Source: AGHT+IHZS1bMp270MbH3H5RnqLaFbu7oKALxTazvGUYDWbX4BipGRZxgNIDwVa9IFLqJ9d/XQw/YKzHlJaZpN+Ofq3M= X-Received: by 2002:a17:906:5f81:b0:a52:4edc:5514 with SMTP id a1-20020a1709065f8100b00a524edc5514mr1121545eju.26.1713028057467; Sat, 13 Apr 2024 10:07:37 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202404091707.439H7vOb043582@gitrepo.freebsd.org> <5op16p78-969n-61p6-q049-o34ps2n04677@yvfgf.mnoonqbm.arg> In-Reply-To: <5op16p78-969n-61p6-q049-o34ps2n04677@yvfgf.mnoonqbm.arg> From: Warner Losh Date: Sat, 13 Apr 2024 11:07:25 -0600 Message-ID: Subject: Re: git: 22ca6db50f4e - main - config.mk: Add MK_VIMAGE knob To: "Bjoern A. Zeeb" Cc: "Stephen J. Kiernan" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000db26820615fd6c1b" 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:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4VH0HH6ggPz4Sc2 --000000000000db26820615fd6c1b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 12, 2024 at 1:29=E2=80=AFPM Bjoern A. Zeeb < bzeeb-lists@lists.zabbadoz.net> wrote: > On Tue, 9 Apr 2024, Stephen J. Kiernan wrote: > > > The branch main has been updated by stevek: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D22ca6db50f4e6bd75a141f57cf953d8= de6531a06 > > > > commit 22ca6db50f4e6bd75a141f57cf953d8de6531a06 > > Author: Stephen J. Kiernan > > AuthorDate: 2024-04-09 17:04:24 +0000 > > Commit: Stephen J. Kiernan > > CommitDate: 2024-04-09 17:05:56 +0000 > > > > config.mk: Add MK_VIMAGE knob > > > > Default to VIMAGE as yes. > > Add VIMAGE to __DEFAULT_DEPENDENT_OPTIONS (to define VIMAGE_SUPPORT) > > > > Only output VIMAGE to opt_global.h when VIMAGE support is wanted. > > > > Obtained from: Juniper Networks, Inc. > > Differential Revision: https://reviews.freebsd.org/D39636 > > --- > > share/mk/src.opts.mk | 2 ++ > > sys/conf/config.mk | 2 ++ > > sys/conf/kern.opts.mk | 4 +++- > > 3 files changed, 7 insertions(+), 1 deletion(-) > > I now see: > > cat: /usr/obj/usr/src/src.git/amd64.amd64/sys/FOO/opt_vimage.h: No such > file or directory > > during builds. I made sure I cleaned the sys/FOO obj tree. Any ideas? > I see this too... :( The problem is that VIMAGE is in opt_global.h, not in opt_vimage, so it was improper to add it here: for var in \ INET \ INET6 \ VIMAGE .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} =3D=3D "no" MK_${var}_SUPPORT:=3D no .else .if defined(KERNBUILDDIR) # See if there's an opt_foo.h .if !defined(OPT_${var}) OPT_${var}!=3D cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo <----------------- opt_vimage.h isn't a thing, it lives in opt_global.h .export OPT_${var} .endif .if ${OPT_${var}} =3D=3D "" # nothing -> no MK_${var}_SUPPORT:=3D no .else MK_${var}_SUPPORT:=3D yes .endif .else # otherwise, yes MK_${var}_SUPPORT:=3D yes .endif .endif .endfor So prior to this addition, this was abusing our build system somewhat, but it worked. Now, it doesn't work and can only work with more abuse: diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 8b1151f3d624..99e4433ec3cf 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -188,9 +188,13 @@ OPT_${opt}:=3D ${rep} .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} =3D=3D "no" MK_${var}_SUPPORT:=3D no .else -.if defined(KERNBUILDDIR) # See if there's an opt_foo.h +.if defined(KERNBUILDDIR) # See if there's an opt_foo.h or opt_global.h .if !defined(OPT_${var}) +.if exists(${KERNBUILDDIR}/opt_${var:tl}.h) OPT_${var}!=3D cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo +.else +OPT_${var}!=3D cat ${KERNBUILDDIR}/opt_global.h; echo +.endif .export OPT_${var} .endif .if ${OPT_${var}} =3D=3D "" # nothing -> no which I think gets us past the present problem... But I think that config(8) should be generating a canonical list of options so we don't have to do this crazy gymnastics of kludgitude. Warner Warner --000000000000db26820615fd6c1b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Apr 12, 2024 at 1:29=E2=80=AF= PM Bjoern A. Zeeb <bzeeb-lists@lists.zabbadoz.net> wrote:
On Tue, 9 Apr 2024, Stephen J.= Kiernan wrote:

> The branch main has been updated by stevek:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D22ca6db50f4e6bd75a141f57cf953d8de6531a06<= /a>
>
> commit 22ca6db50f4e6bd75a141f57cf953d8de6531a06
> Author:=C2=A0 =C2=A0 =C2=A0Stephen J. Kiernan <stevek@FreeBSD.org&g= t;
> AuthorDate: 2024-04-09 17:04:24 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Stephen J. Kiernan <stevek@FreeBSD.org&g= t;
> CommitDate: 2024-04-09 17:05:56 +0000
>
>=C2=A0 =C2=A0
config.mk: Add MK_VIMAGE knob
>
>=C2=A0 =C2=A0 Default to VIMAGE as yes.
>=C2=A0 =C2=A0 Add VIMAGE to __DEFAULT_DEPENDENT_OPTIONS (to define VIMA= GE_SUPPORT)
>
>=C2=A0 =C2=A0 Only output VIMAGE to opt_global.h when VIMAGE support is= wanted.
>
>=C2=A0 =C2=A0 Obtained from:=C2=A0 Juniper Networks, Inc.
>=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.fre= ebsd.org/D39636
> ---
> share/mk/src.opts.mk=C2=A0 | 2 ++
> sys/conf/config.mk=C2=A0 =C2=A0 | 2 ++
> sys/conf/kern.opts.mk | 4 +++-
> 3 files changed, 7 insertions(+), 1 deletion(-)

I now see:

cat: /usr/obj/usr/src/src.git/amd64.amd64/sys/FOO/opt_vimage.h: No such fil= e or directory

during builds.=C2=A0 I made sure I cleaned the sys/FOO obj tree.=C2=A0 Any = ideas?

I see this too... :(
<= br>
The problem is that VIMAGE is in opt_global.h, not in opt_vim= age, so it was improper to add it here:
for var in \
=C2=A0 = =C2=A0 INET \
=C2=A0 =C2=A0 INET6 \
=C2=A0 =C2=A0 VIMAGE
.if defin= ed(WITHOUT_${var}_SUPPORT) || ${MK_${var}} =3D=3D "no"
MK_${va= r}_SUPPORT:=3D no
.else
.if defined(KERNBUILDDIR) =C2=A0 =C2=A0 =C2= =A0 # See if there's an opt_foo.h =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0=C2=A0
.if !defined(OPT_${var})
OPT_${var}!=3D cat ${KERNB= UILDDIR}/opt_${var:tl}.h; echo <----------------- opt_vimage.h isn't= a thing, it lives in opt_global.h
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A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
MK_${var}_SUPPORT:=3D y= es
.endif
.endif
.endfor

So prior to this additi= on, this was abusing our build system somewhat, but it worked. Now, it does= n't work and can only work with more abuse:

di= ff --git a/sys/conf/kern.opts.mk b/sys/= conf/kern.opts.mk
index 8b1151f3d624= ..99e4433ec3cf 100644
--- a/sys/conf/ker= n.opts.mk
+++ b/sys/conf/kern.opts.m= k
@@ -188,9 +188,13 @@ OPT_${opt}:=3D =C2=A0 =C2=A0 =C2=A0 ${rep}=C2=A0.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} =3D=3D "no&= quot;
=C2=A0MK_${var}_SUPPORT:=3D no
=C2=A0.else
-.if defined(KERN= BUILDDIR) =C2=A0# See if there's an opt_foo.h
+.if defined(KERNBUILD= DIR) =C2=A0 =C2=A0# See if there's an opt_foo.h or opt_global.h
=C2= =A0.if !defined(OPT_${var})
+.if exists(${KERNBUILDDIR}/opt_${var:tl}.h)=
=C2=A0OPT_${var}!=3D cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo
+.els= e
+OPT_${var}!=3D cat ${KERNBUILDDIR}/opt_global.h; echo
+.endif
= =C2=A0.export OPT_${var}
=C2=A0.endif
=C2=A0.if ${OPT_${var}} =3D=3D = "" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# nothi= ng -> no

which I think gets us past the present= problem...

But I think that config(8) should be g= enerating a canonical list of options so we don't have to do this crazy= gymnastics of kludgitude.

Warner
Warner
--000000000000db26820615fd6c1b--