From nobody Thu Nov 16 16:07:40 2023 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 4SWQ160KHNz50pN7 for ; Thu, 16 Nov 2023 16:07:54 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 4SWQ155b7xz3CT9 for ; Thu, 16 Nov 2023 16:07:53 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2c50ec238aeso14306531fa.0 for ; Thu, 16 Nov 2023 08:07:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700150872; x=1700755672; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Tb0VtYpHRDTd1GkP3GjyXn2Jgn+vl1QcPmZMEVwpO4=; b=xG8zWZBwqBLF5hM5NWnG9ruUv6MaCr/eR5wGCxGygVgj8i6nx6qoKBb3Ufxmnwlh5U ACU3BdP2Yp3OJtdR5SqyafgDtABJob41HSvl1DB+5nBWcjTnxjE9ktBT9s4UB9ByyXYr 5csgFp4kHOYU5VPijNrQUuVUFu5BuJSkZqqFQg+dJuA3FZmtF1VB+U6zcZnTqlMOzzqE 0+gWr7cVt2bmyZfxw/P5DP9vHBiUVK7K5cnN7DwtEqKfP1OTrxWuf3sPO+kVEIOO4/Me lJlOEGuP1te2E1XannsvM5Ai/mvIPib+Ohw8drcnyXBYIGFtDPyzRO6pvToLxQYY5+ql HN0g== X-Gm-Message-State: AOJu0Yx9aOsAJIlh2EDxrbH6wQAxDDDb0qDq1gSfMi30KBpcmDdR1AfX DAIAXaG1sIfASP6qPyIl1TihfA== X-Google-Smtp-Source: AGHT+IGB4qDEKmKZ6YcvJiL81QvieG51PyAHVG9h161n09Nn/EU8h2IxJNAL6nC1g6gHIA6BivQe4Q== X-Received: by 2002:a2e:b55a:0:b0:2c5:2298:d44e with SMTP id a26-20020a2eb55a000000b002c52298d44emr6419874ljn.5.1700150871649; Thu, 16 Nov 2023 08:07:51 -0800 (PST) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id d1-20020adfe841000000b0032dba85ea1bsm14110131wrn.75.2023.11.16.08.07.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Nov 2023 08:07:51 -0800 (PST) Content-Type: text/plain; charset=utf-8 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Subject: Re: git: accfb4cc9346 - main - genoffset.sh: stop using a temporary file From: Jessica Clarke In-Reply-To: <202311161507.3AGF7kgx070201@gitrepo.freebsd.org> Date: Thu, 16 Nov 2023 16:07:40 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <39921E4A-4C15-4D8F-BA9F-D0C53AD62CD1@freebsd.org> References: <202311161507.3AGF7kgx070201@gitrepo.freebsd.org> To: "Jonathan T. Looney" X-Mailer: Apple Mail (2.3774.200.91.1.1) 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:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4SWQ155b7xz3CT9 On 16 Nov 2023, at 15:07, Jonathan T. Looney wrote: >=20 > The branch main has been updated by jtl: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Daccfb4cc9346b23f6d6383dfc98d2c97= ae18ce0d >=20 > commit accfb4cc9346b23f6d6383dfc98d2c97ae18ce0d > Author: Jonathan T. Looney > AuthorDate: 2023-11-16 15:02:32 +0000 > Commit: Jonathan T. Looney > CommitDate: 2023-11-16 15:02:32 +0000 >=20 > genoffset.sh: stop using a temporary file >=20 > Instead, use a here document for the input. This allows us to run = the > while loop in the main script so we can build the list of asserts = in > a shell variable. We then print out the list of asserts at the end = of > the loop. >=20 > Reviewed by: imp > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D42407 > --- > sys/kern/genoffset.sh | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) >=20 > diff --git a/sys/kern/genoffset.sh b/sys/kern/genoffset.sh > index fda27998ca79..c974a7d52e8c 100644 > --- a/sys/kern/genoffset.sh > +++ b/sys/kern/genoffset.sh > @@ -35,16 +35,13 @@ usage() >=20 > work() > ( > - local last off x1 x2 x3 struct field type lastoff lasttype > + local last off x1 x2 x3 struct field type lastoff lasttype = asserts >=20 > echo "#ifndef _OFFSET_INC_" > echo "#define _OFFSET_INC_" > echo "#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || = defined(KLD_TIED))" > last=3D > - temp=3D$(mktemp -d genoffset.XXXXXXXXXX) > - trap "rm -rf ${temp}" EXIT > - # Note: we need to print symbol values in decimal so the numeric = sort works > - ${NM:=3D'nm'} ${NMFLAGS} -t d "$1" | grep __assym_offset__ | sed = -e 's/__/ /g' | sort -k 4 -k 1 -n | > + asserts=3D > while read off x1 x2 struct field type x3; do > off=3D$(echo "$off" | sed -E 's/^0+//') > if [ "$last" !=3D "$struct" ]; then > @@ -60,12 +57,14 @@ work() > printf "%b" "\t${type}\t${field};\n" > lastoff=3D"$off" > lasttype=3D"$type" > - echo "_SA(${struct}, ${field}, ${off});" >> "$temp/asserts" > - done > + asserts=3D"${asserts}_SA(${struct}, ${field}, ${off});\n" > + done < +$(${NM:=3D'nm'} ${NMFLAGS} -t d "$1" | grep __assym_offset__ | sed -e = 's/__/ /g' | sort -k 4 -k 1 -n) > +EOT > echo "};" > echo "#define _SA(s,f,o) _Static_assert(__builtin_offsetof(struct = s ## _lite, f) =3D=3D o, \\" > printf '\t"struct "#s"_lite field "#f" not at offset "#o)\n' > - cat "$temp/asserts" > + echo -e "${asserts}\c" This isn=E2=80=99t POSIX, and isn=E2=80=99t supported by macOS=E2=80=99s = sh, so breaks the build there. Please fix or revert promptly. Jess > echo "#undef _SA" > echo "#endif" > echo "#endif"