mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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	[thread overview]
Message-ID: <e0b06d9aa9f37156c4317f9915a7a0e247edb70f.1678907179.git.leon@kernel.org> (raw)

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(-)

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


             reply	other threads:[~2023-03-15 19:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 19:09 Leon Romanovsky [this message]
2023-03-15 20:18 ` Nicolas Schier
2023-03-16  7:10   ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0b06d9aa9f37156c4317f9915a7a0e247edb70f.1678907179.git.leon@kernel.org \
    --to=leon@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=riada@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®