From owner-svn-src-head@freebsd.org Tue Sep 22 21:53:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E1A73E1161 for ; Tue, 22 Sep 2020 21:53:46 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2k.ore.mailhop.org (outbound2k.ore.mailhop.org [54.148.219.64]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bww6y1kG5z3VJp for ; Tue, 22 Sep 2020 21:53:46 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1600811624; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=MCncu9yCFTYXNfVgW0qH2LQY7A9VHgAOJjSoTVpFH2XsO8I+oLXN5gVCFcWMMJVVVYofI68totVde zWDPIkQbSv3b/vE+6E/WOSRg5muVoQCkDg5okJe7W/ivs92fvCf/VqdBNYTAyj0iTvclcgc4R7vQ/t CtcW6jlj0e5tPmFq9j5pAdAcxsiGi0XJEiA9/x8QxgsOB/4rsn/S93TwV7Zexblkj16a0GajtIA1lW gkJgq1Exshm5MwnAq7eJG3e226S8VU98f+4nb/8wUe+fMkaIpAq+HqGF9jqSWFYvFhM+gOxudAnyZu hdH9RNuvigXoX1u2k30kKsoaMd6AWAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=f/g8/hT/jSZ4k1rH26V8GMx2DkwTI5GSfhZlBQDheP0=; b=Kl8HzdwBzQaFVDgeVAT4v2oUl48mua2In2LhbgutfJjeANpBYfq1LZ3LPlkVgrt1qCGPjMB3nGSfD a5awx2nGnjtzmJR4/5Z4vI2/kJZBJ9pJ9em2cB6YUC0WFvlV2rP550oWQSyc2aWLlG64uwJWeDcREJ /TSzhq1/E0xLtPmq4kWBPYH1tB0SP5GHzLmCyG59j4CJEnplW1ZJnEjKi9o4Vs3oKYrozJ7Yanp0Ww TzPQBxnd6P0xbWapsqIZkuYNi/7ozGHc2ZS54U6tLs5PqsJI7YpTOWhTCY8UEZP/oATEuknS6GzpmY Nq+diI931BbXf5wUAQTM4aX/R2+2ZYg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=f/g8/hT/jSZ4k1rH26V8GMx2DkwTI5GSfhZlBQDheP0=; b=fpH04z7DEk+Cltc4ZzcZ39WmZDs9QRzm01WNCu+AVpF5zJmTj1P1Ai5UXh/hWWRO+HaI0Oxmi8HRl mcwI68537P14qB1aQTKqOdivB2oQlzW97gd+RQMERN9UqnBLiVksr3Dwe4ZODCOMTfJhoHPwoSQSEP m1nb7ph8lOjiQzHakGqCvQKIiHveWPLmB1Ze+aJJfXNS1pLKmWaabZ+GjezcDN7LLpa0TbrB9ceBQv 30VHEbPBV6vz3q4w57aOf1FXRqg3olSFgBTpQVC6wDiAYVfu6cQJWMo01pAdHifIWwC0c1kHrSz1Ji 8hqup1q8S7X0iq+l4KfWDhhqW2IOlkg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 13973109-fd1e-11ea-9e11-df46ed8f892f X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 13973109-fd1e-11ea-9e11-df46ed8f892f; Tue, 22 Sep 2020 21:53:42 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 08MLreqp026646; Tue, 22 Sep 2020 15:53:40 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r365643 - head/bin/cp From: Ian Lepore To: Warner Losh , Alan Somers Cc: Kyle Evans , Mateusz Guzik , src-committers , svn-src-all , svn-src-head Date: Tue, 22 Sep 2020 15:53:40 -0600 In-Reply-To: References: <202009112049.08BKnavL032212@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bww6y1kG5z3VJp X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2020 21:53:46 -0000 On Tue, 2020-09-22 at 15:50 -0600, Warner Losh wrote: > I think it's a great leap sideways, but I've done cp /dev/null foo to > clear > it out for 35 years now... It's why it feels like a workaround. > > Though it is a legit optimization, no matter the feelings. As for > clearer, > I'm less sure since then I have to remember what the : operator does. > > Warner > For me, :> is idiomatic (but ugly). On the other hand, the cp /dev/null had a nice dogfooding aspect to it... when we broke cp by accident, its use in the build system was the first alarm to go off. --Ian > On Tue, Sep 22, 2020 at 3:48 PM Alan Somers > wrote: > > > It doesn't feel like a workaround to me. I think Kyle's version is > > clearer than the original. > > > > On Tue, Sep 22, 2020 at 3:45 PM Warner Losh wrote: > > > > > > > > > > > On Tue, Sep 22, 2020 at 3:42 PM Kyle Evans > > > wrote: > > > > > > > cp is already fixed, people are still feeling the fallout of > > > > being > > > > within those revisions and needing to bootstrap their own cp. > > > > We can > > > > reduce the number of components these invocations rely on > > > > trivially to > > > > shell built-in mechanics, why not do so? > > > > > > > > > > Fair point. I just bristle at putting workarounds in for valid > > > /bin/sh > > > syntax because we opposed for a few days. so long as it's an > > > unconditional > > > clearing of the file to be zero length, I'm OK with that. > > > > > > Warner > > > > > > > > > > On Tue, Sep 22, 2020 at 4:40 PM Warner Losh > > > > wrote: > > > > > > > > > > So why do we need a workaround at all? cp /dev/null has been > > > > > fixed, > > > > > > > > and that's way more important to get right. > > > > > > > > > > I don't want to paper-over issues with this at all, though if > > > > > we use > > > > > > > > the host's (now broken) cp, I suppose that might be OK in the > > > > short term. > > > > If that's the case, then maybe this is OK. > > > > > > > > > > Otherwise, I'd strongly prefer we fix cp. > > > > > > > > > > Warner > > > > > > > > > > On Tue, Sep 22, 2020 at 3:31 PM Alan Somers < > > > > > asomers@freebsd.org> > > > > > > > > wrote: > > > > > > > > > > > > +1. > > > > > > > > > > > > On Tue, Sep 22, 2020 at 3:27 PM Kyle Evans < > > > > > > kevans@freebsd.org> > > > > > > > > wrote: > > > > > > > > > > > > > > I'm running a build at the suggestion of mjg to confirm > > > > > > > there aren't > > > > > > > any others hiding that can be converted, and I will > > > > > > > commit after I've > > > > > > > verified that this is it. > > > > > > > > > > > > > > On Tue, Sep 22, 2020 at 4:02 PM Alan Somers < > > > > > > > asomers@freebsd.org> > > > > > > > > wrote: > > > > > > > > > > > > > > > > LGTM. > > > > > > > > > > > > > > > > On Tue, Sep 22, 2020 at 2:59 PM Kyle Evans < > > > > > > > > kevans@freebsd.org> > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > Perhaps: > > > > > > > > > > > > > > > > > > diff --git a/stand/i386/zfsboot/Makefile > > > > > > > > b/stand/i386/zfsboot/Makefile > > > > > > > > > index ff315abc0ef..7e362b43a39 100644 > > > > > > > > > --- a/stand/i386/zfsboot/Makefile > > > > > > > > > +++ b/stand/i386/zfsboot/Makefile > > > > > > > > > @@ -81,7 +81,7 @@ zfsboot.ld: zfsboot.ldr zfsboot.bin > > > > > > > > > ${BTXKERN} > > > > > > > > > -o ${.TARGET} -P 1 zfsboot.bin > > > > > > > > > > > > > > > > > > zfsboot.ldr: > > > > > > > > > - cp /dev/null ${.TARGET} > > > > > > > > > + :> ${.TARGET} > > > > > > > > > > > > > > > > > > zfsboot.bin: zfsboot.out > > > > > > > > > ${OBJCOPY} -S -O binary zfsboot.out > > > > > > > > > ${.TARGET} > > > > > > > > > diff --git a/stand/libsa/Makefile > > > > > > > > > b/stand/libsa/Makefile > > > > > > > > > index effece9e01b..63cd46a9c54 100644 > > > > > > > > > --- a/stand/libsa/Makefile > > > > > > > > > +++ b/stand/libsa/Makefile > > > > > > > > > @@ -122,7 +122,7 @@ beforedepend: > > > > > > > > > ln -sf ${SRCTOP}/include/arpa/inet.h > > > > > > > > > arpa/inet.h; \ > > > > > > > > > ln -sf ${SRCTOP}/include/arpa/t > > > > > > > > > ftp.h arpa/tftp.h; \ > > > > > > > > > for i in _time.h _strings.h _string.h; do \ > > > > > > > > > - [ -f xlocale/$$i ] || cp /dev/null > > > > > > > > > xlocale/$$i; \ > > > > > > > > > + [ -f xlocale/$$i ] || :> xlocale/$$i; > > > > > > > > > \ > > > > > > > > > done; \ > > > > > > > > > for i in ${STAND_H_INC}; do \ > > > > > > > > > ln -sf ${SASRC}/stand.h $$i; \ > > > > > > > > > > > > > > > > > > > > > > > > > > > On Tue, Sep 22, 2020 at 3:58 PM Alan Somers < > > > > > > > > > asomers@freebsd.org> > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > Looks like two places in stand. Is there any > > > > > > > > > > reason why > > > > > > > > Mateusz's suggestion wouldn't work? > > > > > > > > > > > > > > > > > > > > > rg -g Makefile 'cp.*/dev/null' > > > > > > > > > > > > > > > > > > > > stand/libsa/Makefile > > > > > > > > > > 125: [ -f xlocale/$$i ] || cp /dev/null > > > > > > > > > > xlocale/$$i; \ > > > > > > > > > > > > > > > > > > > > stand/i386/zfsboot/Makefile > > > > > > > > > > 82: cp /dev/null ${.TARGET} > > > > > > > > > > > > > > > > > > > > On Tue, Sep 22, 2020 at 2:54 PM Mateusz Guzik < > > > > > > > > mjguzik@gmail.com> wrote: > > > > > > > > > > > > > > > > > > > > > > Can we instead add a workaround to the build > > > > > > > > > > > tree? > > > > > > > > > > > > > > > > > > > > > > Where is cp /dev/null coming from anyway? Perhaps > > > > > > > > > > > this can be > > > > > > > > patched > > > > > > > > > > > to touch the target file. > > > > > > > > > > > > > > > > > > > > > > On 9/22/20, Alan Somers > > > > > > > > > > > wrote: > > > > > > > > > > > > On Tue, Sep 22, 2020 at 2:48 PM Kyle Evans < > > > > > > > > kevans@freebsd.org> wrote: > > > > > > > > > > > > > > > > > > > > > > > > > On Fri, Sep 11, 2020 at 3:49 PM Alan Somers < > > > > > > > > asomers@freebsd.org> wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > Author: asomers > > > > > > > > > > > > > > Date: Fri Sep 11 20:49:36 2020 > > > > > > > > > > > > > > New Revision: 365643 > > > > > > > > > > > > > > URL: > > > > > > > > > > > > > > https://svnweb.freebsd.org/changeset/base/365643 > > > > > > > > > > > > > > > > > > > > > > > > > > > > Log: > > > > > > > > > > > > > > cp: fall back to read/write if > > > > > > > > > > > > > > copy_file_range fails > > > > > > > > > > > > > > > > > > > > > > > > > > > > Even though copy_file_range has a file- > > > > > > > > > > > > > > system agnostic > > > > > > > > version, it > > > > > > > > > > > > > still > > > > > > > > > > > > > > fails on devfs (perhaps because the file > > > > > > > > > > > > > > descriptor is > > > > > > > > non-seekable?) > > > > > > > > > > > > > In > > > > > > > > > > > > > > that case, fallback to old-fashioned > > > > > > > > > > > > > > read/write. Fixes > > > > > > > > > > > > > > "cp /dev/null /tmp/null" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > > > > > > > > > Any objection to adding a quick UPDATING > > > > > > > > > > > > > entry for this? > > > > > > > > I'm seeing > > > > > > > > > > > > > occasional reports of this breakage as recent > > > > > > > > > > > > > as today on > > > > > > > > IRC from > > > > > > > > > > > > > folks that were a little bit thrown off by > > > > > > > > > > > > > this because it > > > > > > > > throws up > > > > > > > > > > > > > fairly far into the build and looks like a > > > > > > > > > > > > > stand build > > > > > > > > regression > > > > > > > > > > > > > instead of a cp regression. > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > > > > > > > > > > > > > Kyle Evans > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > No objection. Can you suggest the proper > > > > > > > > > > > > wording? > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > svn-src-all@freebsd.org mailing list > > > > > > > > > > > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > > > > > > > > > > > To unsubscribe, send any mail to " > > > > > > > > svn-src-all-unsubscribe@freebsd.org" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > Mateusz Guzik