Message ID | e0b06d9aa9f37156c4317f9915a7a0e247edb70f.1678907179.git.leon@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp77559wrt; Wed, 15 Mar 2023 12:23:42 -0700 (PDT) X-Google-Smtp-Source: AK7set9mRx1D7pMXuWTUFEt/lFuEXy3cyyvMGAK68gb1Svg5a2tXQOmrhey2W/YPVWKCoMgzfN9n X-Received: by 2002:a05:6a20:389e:b0:cb:9db3:e5e2 with SMTP id n30-20020a056a20389e00b000cb9db3e5e2mr741467pzf.17.1678908222026; Wed, 15 Mar 2023 12:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678908222; cv=none; d=google.com; s=arc-20160816; b=wFc0i7J/e3GSNjNw8eJ/KcA7YDw+7RWqEHDui09aC9Bl1AMpY0tH/9SuJ0TOfgRxrz t+iuBk0rhw89hvPdsF39rIaTz75MHrh8xRSDtOPL4bH/xrp2NBl3Lj4fg3RKDKvsgyAa 6Ughf91as7qf2QZB+8V84tk73A4dIS0fCFhrTQXeSMYj+527z0gocIxv4ThEAwx1G6/8 5U+75/GkO4dWLCE7LIG6FhqlcNPWd9ikZ2Wm72TV5nhLYdtrox/xjJQ2PxLK9tIF9NBE dCckaXhyh6FDe0HmiHoq45jmiIhatpVx5xap2R85kQxN9FxVj8BvpClgm0nIsSCi2Tyz 7eRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=D44YWnk8C7qMf2318g52uO2X9WFuSDLDG6Y1YTGs4rI=; b=Bx2Pa2pxrmEyKRsRWTqhdZg23ZZtGCNnzdskJdkXVH31hv6DXOcacy8P0jFcynHXRN D0RyVT5fxiA43am/jvX4mcaIES8O38PTyZ8WshzA7VxQ39b4W9Xm+rQ3oThsl8H1LTfx GhfN3YvlR9zBwZQdfUdfoX8lxyFKeZ5aCuxeBQR0djW1gmyU3DITrxSlu+a0APSzWOzO t8VK1K+J4V5szC9vpO1z6xxvwA2LgjzFBk7UbiJ4cUad78rDJtV7EPdpche6DsjYVrfl qvgTFGCU2k5hST7gaMsT2MwWjQCNPlOL4DqATMOBMrLMp9QeLiykpjAY4u9O5JrrTjPn J5ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ciim0dx8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j1-20020a625501000000b005a8cdb17b9bsi5480694pfb.102.2023.03.15.12.23.26; Wed, 15 Mar 2023 12:23:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ciim0dx8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231293AbjCOTKE (ORCPT <rfc822;ruipengqi7@gmail.com> + 99 others); Wed, 15 Mar 2023 15:10:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231743AbjCOTKC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Mar 2023 15:10:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 262C158B4B; Wed, 15 Mar 2023 12:09:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B99B361E5A; Wed, 15 Mar 2023 19:09:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DA5BC433D2; Wed, 15 Mar 2023 19:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678907394; bh=9BJPwTVMMlp2aU3GiprummHDcOkkaAFm3bnxPHRdWN4=; h=From:To:Cc:Subject:Date:From; b=Ciim0dx8hiMREWkki909Fi445o3pjTl1da6WJFj7m0YY3HE4aTMhuEsobWz6wagYj oPVoQ8KG5/W34jb8V+vAVh2xy4nGz103U6tjyjqcSNT9tpaIYvz/RdlALeidCReE/4 GOz3mtDAJv8fT7jE7ofA35hXHnfQwpQK+kcC1anZAFktk2BL/icQpPrZeCKTKDoAe7 T5pG4MN4B9RfJZG5COfQef0cJDBTW9v8UUtHj5GOxtB9prGQYwH9rN/Z+pSKAEUIqY l1DlkTytirUBsYm3MhM5Seh1/yAf4okbGkxQXxg6buR7KXh10mPj1Mqr90y+l76vKX 8Nzz4XQ7KuGlQ== From: Leon Romanovsky <leon@kernel.org> To: Masahiro Yamada <masahiroy@kernel.org> Cc: Leon Romanovsky <leonro@nvidia.com>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Nicolas Schier <nicolas@fjasle.eu>, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Riad Abo Raed <riada@nvidia.com> Subject: [PATCH -rc] kbuild: properly exclude linux.tar.gz from tar archive Date: Wed, 15 Mar 2023 21:09:33 +0200 Message-Id: <e0b06d9aa9f37156c4317f9915a7a0e247edb70f.1678907179.git.leon@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760462867977996649?= X-GMAIL-MSGID: =?utf-8?q?1760462867977996649?= |
Series |
[-rc] kbuild: properly exclude linux.tar.gz from tar archive
|
|
Commit Message
Leon Romanovsky
March 15, 2023, 7:09 p.m. UTC
From: Leon Romanovsky <leonro@nvidia.com> Attempt to build rpm-pkg randomly fails in tar stage, with same error as was reported by Nicolas [1] tar -c -f linux.tar.gz -I pigz --exclude=./linux.tar.gz --exclude-from=.tmp_filelist_exclude --owner=0 --group=0 --sort=name --transform 's:^\.:linux:S' -C . . tar: .: file changed as we read it make[1]: *** [scripts/Makefile.package:58: linux.tar.gz] Error 1 make[1]: *** Deleting file 'linux.tar.gz' make: *** [Makefile:1657: rpm-pkg] Error 2 The reason to it that tar is dependent on order of command line arguments and needs to have excluded file before creating it. So as a solution, touch that file to create it and move --exclude list before any tar arguments. [1] https://lore.kernel.org/all/Y%2Fk+v%2FYj8VQ6q32H@fjasle.eu/ Cc: Nicolas Schier <nicolas@fjasle.eu> Fixes: 7bf4582d7aad ("kbuild: deb-pkg: create source package without cleaning") Signed-off-by: Riad Abo Raed <riada@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> --- scripts/Makefile.package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed 15 Mar 2023 21:09:33 GMT, Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@nvidia.com> > > Attempt to build rpm-pkg randomly fails in tar stage, with same error > as was reported by Nicolas [1] > > tar -c -f linux.tar.gz -I pigz --exclude=./linux.tar.gz --exclude-from=.tmp_filelist_exclude --owner=0 --group=0 --sort=name --transform 's:^\.:linux:S' -C . . > tar: .: file changed as we read it > make[1]: *** [scripts/Makefile.package:58: linux.tar.gz] Error 1 > make[1]: *** Deleting file 'linux.tar.gz' > make: *** [Makefile:1657: rpm-pkg] Error 2 > > The reason to it that tar is dependent on order of command line > arguments and needs to have excluded file before creating it. So as a > solution, touch that file to create it and move --exclude list before > any tar arguments. thanks for digging into and proposing a solution! I'm afraid it will not be taken because of [2] will make the whole cmd_tar definition redundant due to the use of 'git archive'. Nevertheless, this works for me. Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> Kind regards, Nicolas [2]: https://lore.kernel.org/linux-kbuild/20230312200731.599706-7-masahiroy@kernel.org/ > [1] https://lore.kernel.org/all/Y%2Fk+v%2FYj8VQ6q32H@fjasle.eu/ > Cc: Nicolas Schier <nicolas@fjasle.eu> > Fixes: 7bf4582d7aad ("kbuild: deb-pkg: create source package without cleaning") > Signed-off-by: Riad Abo Raed <riada@nvidia.com> > Signed-off-by: Leon Romanovsky <leonro@nvidia.com> > --- > scripts/Makefile.package | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/Makefile.package b/scripts/Makefile.package > index b941e6341b36..be4623481ca2 100644 > --- a/scripts/Makefile.package > +++ b/scripts/Makefile.package > @@ -44,7 +44,7 @@ filechk_filelist = \ > # --------------------------------------------------------------------------- > > quiet_cmd_tar = TAR $@ > - cmd_tar = tar -c -f $@ $(tar-compress-opt) $(tar-exclude-opt) \ > + cmd_tar = touch ./$@ && tar $(tar-exclude-opt) -c -f $@ $(tar-compress-opt) \ > --owner=0 --group=0 --sort=name \ > --transform 's:^\.:$*:S' -C $(tar-rootdir) . > > -- > 2.39.2
On Wed, Mar 15, 2023 at 09:18:08PM +0100, Nicolas Schier wrote: > On Wed 15 Mar 2023 21:09:33 GMT, Leon Romanovsky wrote: > > From: Leon Romanovsky <leonro@nvidia.com> > > > > Attempt to build rpm-pkg randomly fails in tar stage, with same error > > as was reported by Nicolas [1] > > > > tar -c -f linux.tar.gz -I pigz --exclude=./linux.tar.gz --exclude-from=.tmp_filelist_exclude --owner=0 --group=0 --sort=name --transform 's:^\.:linux:S' -C . . > > tar: .: file changed as we read it > > make[1]: *** [scripts/Makefile.package:58: linux.tar.gz] Error 1 > > make[1]: *** Deleting file 'linux.tar.gz' > > make: *** [Makefile:1657: rpm-pkg] Error 2 > > > > The reason to it that tar is dependent on order of command line > > arguments and needs to have excluded file before creating it. So as a > > solution, touch that file to create it and move --exclude list before > > any tar arguments. > > thanks for digging into and proposing a solution! I'm afraid it will > not be taken because of [2] will make the whole cmd_tar definition > redundant due to the use of 'git archive'. OK, good to know. > > Nevertheless, this works for me. > > Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> Thanks > > Kind regards, > Nicolas > > > [2]: https://lore.kernel.org/linux-kbuild/20230312200731.599706-7-masahiroy@kernel.org/ > > > [1] https://lore.kernel.org/all/Y%2Fk+v%2FYj8VQ6q32H@fjasle.eu/ > > Cc: Nicolas Schier <nicolas@fjasle.eu> > > Fixes: 7bf4582d7aad ("kbuild: deb-pkg: create source package without cleaning") > > Signed-off-by: Riad Abo Raed <riada@nvidia.com> > > Signed-off-by: Leon Romanovsky <leonro@nvidia.com> > > --- > > scripts/Makefile.package | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/scripts/Makefile.package b/scripts/Makefile.package > > index b941e6341b36..be4623481ca2 100644 > > --- a/scripts/Makefile.package > > +++ b/scripts/Makefile.package > > @@ -44,7 +44,7 @@ filechk_filelist = \ > > # --------------------------------------------------------------------------- > > > > quiet_cmd_tar = TAR $@ > > - cmd_tar = tar -c -f $@ $(tar-compress-opt) $(tar-exclude-opt) \ > > + cmd_tar = touch ./$@ && tar $(tar-exclude-opt) -c -f $@ $(tar-compress-opt) \ > > --owner=0 --group=0 --sort=name \ > > --transform 's:^\.:$*:S' -C $(tar-rootdir) . > > > > -- > > 2.39.2 > > -- > Nicolas Schier > > epost|xmpp: nicolas@fjasle.eu irc://oftc.net/nsc > ↳ gpg: 18ed 52db e34f 860e e9fb c82b 7d97 0932 55a0 ce7f > -- frykten for herren er opphav til kunnskap --
diff --git a/scripts/Makefile.package b/scripts/Makefile.package index b941e6341b36..be4623481ca2 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -44,7 +44,7 @@ filechk_filelist = \ # --------------------------------------------------------------------------- quiet_cmd_tar = TAR $@ - cmd_tar = tar -c -f $@ $(tar-compress-opt) $(tar-exclude-opt) \ + cmd_tar = touch ./$@ && tar $(tar-exclude-opt) -c -f $@ $(tar-compress-opt) \ --owner=0 --group=0 --sort=name \ --transform 's:^\.:$*:S' -C $(tar-rootdir) .