From nobody Fri Jun 02 11:54:19 2023 X-Original-To: dev-commits-ports-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 4QXhHj1sWtz4XdsD; Fri, 2 Jun 2023 11:54:25 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QXhHh6Z0tz3sc3; Fri, 2 Jun 2023 11:54:24 +0000 (UTC) (envelope-from garga@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685706864; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LfV8TeZ8D+qCdm7/nIvtFy86p1qR7vC2gDelUT1/OpU=; b=AKmXhxZB+EQN82wOC/FST67AXHvvDUNXLEU96cdkDcx+D72XuyAY/nh+9Z5Mu+fme9jnH7 9uIQR1MbZK4t1F6pI8fLmodxf6AnvUh1LpoHhMBXrLLlLlnv1wNgapKVDwEdaoq6oibTHS ChTZRXryg+gn6nTiqRUBGg+al0ROM6y6JV8mq0HJR8LYBvtbimLW+oVDAkuYXcl2zm7yrR GeLcBxH1+Jcf1wvsUeE1ccF2K3gVT4tlxAKnrkiv8w2xY9BNXkKlQjLkY6maTaTpkN3bnG E/bbKvFVhoLuS/hJW2bkb3favDQ1Vlj9BU+pW8FAwu/hUM6ilTK0HPZMopNA4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685706864; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LfV8TeZ8D+qCdm7/nIvtFy86p1qR7vC2gDelUT1/OpU=; b=B+ZUXvk2PgK9abFH5MZEbv+Nr1pp7UQRALcesnhgvGGF2ZK8FaGDcoIuBIouMXsu2grrfh zO1RwJ1nvyfThYoDoPL/nyx39JjddWrtOIu2EDiOgH52hY51syDmHOxI0RhYrza+VsmedO biJMYuSOs0SvLzhu3FNN4U7WqSVle8bu1Q7K8mj/52wqX3MmjkmzzEQPQDbFy2I04d+wjt CUvQAkHkt0Avvbb0+N+RIHKEb59gRywjoE2wzAyl63RerrZ8ZOStqcpSNyDK8V9h0icO2c EumaiLyD15tn1kfYCLAqSG8sUH6DDI/PfjpBAjoTMDDYy8sqDLakk8q+wZLwwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685706864; a=rsa-sha256; cv=none; b=qZAT2hdSQO3qgO8yO4fyYarxMcoi7a17eBJLZ+uQk1h5ha/aNwVY8Dzbi538kFNjGLhI6z k95kfow70oRLBrgv1r3MsRyidMjko7H6rVyiK6E+a+3FDevgRYFK2w0I1e5E3zAsa+KmEj qzSRJg2o582bkjAxnN18naPaZl0BvM6RAtGJdZWThq70S8m61fYcd5tF5RmBZXzZAcvb+c 5RvWH8v6Ndg+oAPbsvYdkUpc2TrpG2phaMYu7+jiIVXkKgmHrLdJ2iim/9rz2ILzxH8p8i kiQ+5XYLBcIv1wpgmQ5xhyqWksm3wRb2EXMK/jZESgXo5Unfq5DfmfBC8Sn+pw== Received: from [172.21.4.174] (dynamic-177-53-82-16.telecominternet.net.br [177.53.82.16]) (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 did not present a certificate) (Authenticated sender: garga) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QXhHh0Bmtz14hd; Fri, 2 Jun 2023 11:54:23 +0000 (UTC) (envelope-from garga@FreeBSD.org) Message-ID: Date: Fri, 2 Jun 2023 08:54:19 -0300 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 67ce8cec004c - main - Mk/Scripts: Fix the 'stripped' check from 'make check-plist' to report all unstripped files Content-Language: en-US To: Mathieu Arnold , Yuri Victorovich Cc: ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org References: <202306020645.3526jV0Y019662@gitrepo.freebsd.org> From: Renato Botelho In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 02/06/23 04:11, Mathieu Arnold wrote: > On Fri, Jun 02, 2023 at 06:45:31AM +0000, Yuri Victorovich wrote: >> The branch main has been updated by yuri: >> >> URL: https://cgit.FreeBSD.org/ports/commit/?id=67ce8cec004c85caeee5a6e965bd10f872e1b895 >> >> commit 67ce8cec004c85caeee5a6e965bd10f872e1b895 >> Author: Yuri Victorovich >> AuthorDate: 2023-06-02 06:40:46 +0000 >> Commit: Yuri Victorovich >> CommitDate: 2023-06-02 06:45:29 +0000 >> >> Mk/Scripts: Fix the 'stripped' check from 'make check-plist' to report all unstripped files >> >> Prior to this patch, the 'stripped' check always skipped the first >> unstripped file. >> >> It uses the "find [...] -exec sh -c 'readelf -S -- /dev/null $0 "$@" || :' -- {} +" >> command. When arguments are passed to shell like this: >> "sh -c 'script' arg1 arg2 arg3" - $@ within the script is assigned >> to 'arg2 arg3', and $0 is assigned to arg1. This is a quirk in >> how shells handle arguments in case when the script is passed >> using -c. >> >> This patch adds $0 to account for the first passed file. > > So, you are right, when you run `sh -c 'script' arg1 arg2 arg3`, arg1 is > in $0, and arg2 and arg3 are in $@. > > Now, here, we are running `sh -c 'script' -- arg1 arg2 arg3`, so, $0 > contains `--`, and arg1-3 are in $@. On local tests, without this patch, I confirmed first file is always skipped, as mentioned on ticket. I took misc/trurl as example: ❯ find work/stage -type f ! -name '*.a' ! -name '*.o' work/stage/usr/local/man/man1/trurl.1.gz work/stage/usr/local/share/licenses/trurl-0.7/LICENSE work/stage/usr/local/share/licenses/trurl-0.7/catalog.mk work/stage/usr/local/share/licenses/trurl-0.7/MIT work/stage/usr/local/bin/trurl Without the patch, calling readelf I can see: ❯ find work/stage -type f ! -name '*.a' ! -name '*.o' -exec sh -c 'readelf -S -- /dev/null "$@" || :' -- {} + 2>/dev/null |& grep '^File:' File: /dev/null File: work/stage/usr/local/share/licenses/trurl-0.7/LICENSE File: work/stage/usr/local/share/licenses/trurl-0.7/catalog.mk File: work/stage/usr/local/share/licenses/trurl-0.7/MIT File: work/stage/usr/local/bin/trurl And with the change: ❯ find work/stage -type f ! -name '*.a' ! -name '*.o' -exec sh -c 'readelf -S -- /dev/null "$0" "$@" || :' -- {} + 2>/dev/null |& grep '^File:' File: /dev/null File: work/stage/usr/local/man/man1/trurl.1.gz File: work/stage/usr/local/share/licenses/trurl-0.7/LICENSE File: work/stage/usr/local/share/licenses/trurl-0.7/catalog.mk File: work/stage/usr/local/share/licenses/trurl-0.7/MIT File: work/stage/usr/local/bin/trurl Did I miss something? >> - -exec sh -c 'readelf -S -- /dev/null "$@" || :' -- {} + 2>/dev/null | awk ' >> + -exec sh -c 'readelf -S -- /dev/null $0 "$@" || :' -- {} + 2>/dev/null | awk ' > > If the patch was correct, you would need to quote "$0". Good catch. > But as I pointed out, it is not correct, so please revert. > -- Renato Botelho