Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1204227rwl; Fri, 7 Apr 2023 11:34:28 -0700 (PDT) X-Google-Smtp-Source: AKy350YOhTSwuLIvYy/fkQ5MQUmaTghw/ETP7mpML9XWqYuCjAaEZgaWTpWMlDdJvKUlmE03dNoY X-Received: by 2002:aa7:c0c7:0:b0:4fa:d83b:f5da with SMTP id j7-20020aa7c0c7000000b004fad83bf5damr2871092edp.30.1680892467958; Fri, 07 Apr 2023 11:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680892467; cv=none; d=google.com; s=arc-20160816; b=jltvnz8OEd3ta2rcd/GzcAHLlCM1iwjHwmJm7eQMRUlNIl1ZWj+6tJQziPHz+rjM5q FUgIzEXdNNf8e5no5S8M2VAtnut8LuGXbWwNwy0TWhJ279l/MG6XpZnHe5YwFa0AL3iw xo40Z1diHmB7KMiZTLm/5ECKLJ5X2WHXpM129ded+mOQAzGlwcYR000uwwKgNJDV0bap X1zBBt97HjYxMQC3d1yMXbsjRv4zy5ZLON6SFebJ0jhlmMZ8XH6jCrRB3JZTyo3VDyus q2RZZwVkC7lmm1TEFES/k2nEWTC6YI/0RCLNVbcYY5/AWgcIu8Wswdw5ESXvP+oMP3+W AGlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pn8YcgxtKMC7cObm7yPhlRu0Jp3IKg1t8r7ZUZzu/c8=; b=n3jOgcfDOpJ6DRw5EzBIktpIEr55i1T3cJbXMenB3vzr/whuzlf3U67gQh0qp/rYIk gZrlDqkHdtHrW0PbHPiKwhb16uuSJkKlEY2d5jFT3KNwhGGRL/iCbiRWuFdMjupGlsqD B/lj5UKAjpmGA+8Tt5sheMffr1Ivk1hZMBT1QyznpQFy7mgp1wV5o4APgjmwLReZ5Mc1 0IQRsYiBh3AefXlD+z4Cc3kVvQbnvwTcyC5fxzDKhtchEzoIarcjFXK2nNjytjdOv26u aXsTytKWCT1pOnFYVeYki6NJb+O7BYnoi6KJ88lwsQa/0pgFFVv6zU+3r64tC2mrovZN vMiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CTCJ3vFM; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i18-20020a50fc12000000b005048909cdf8si35275edr.35.2023.04.07.11.34.02; Fri, 07 Apr 2023 11:34:27 -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=CTCJ3vFM; 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 S229827AbjDGSLL (ORCPT + 99 others); Fri, 7 Apr 2023 14:11:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbjDGSLJ (ORCPT ); Fri, 7 Apr 2023 14:11:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEFF4AD02; Fri, 7 Apr 2023 11:11:08 -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 2C31365055; Fri, 7 Apr 2023 18:11:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35A6CC433D2; Fri, 7 Apr 2023 18:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680891067; bh=BWzBViVw+Sgief90El4Js+Vc5AfQh5Kawzk2O+ZsBxc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CTCJ3vFMIo7YXyvsP7o0rn8wFKWxX3/XR0XGX0uR9Ga/OIDh3Yd57UNnkGyqRIciB Ej1rcv+4Ijw4urVEz93S2ZInfaZRRqaqPEQ0hUKIT4vkMZdReUDuTA96ocFWHtq8GC AaMq/J+oafcVulPJR/9cr05+784kNu9BfVXzcMLM3wB1J/DClUzmhzMekNfrW41n53 hb0aOLPaCdscGPGD3gvMdGzjygjVL8hlrECkjsFPRlIcqROvlnFAwFk10bPWiSJk7C QhD+j6AmIqM9J4e2j7NooOR6/+UUzCjcEOUE9W4rc1erVwS2I04kqTSOB74Pt2NMt1 hy0/qpXyoGvmA== Date: Fri, 7 Apr 2023 11:11:05 -0700 From: Nathan Chancellor To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Nicolas Schier Subject: Re: [PATCH 2/3] kbuild: do not create intermediate *.tar for source tarballs Message-ID: <20230407181105.GC1018455@dev-arch.thelio-3990X> References: <20230407101629.1298051-1-masahiroy@kernel.org> <20230407101629.1298051-2-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230407101629.1298051-2-masahiroy@kernel.org> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 07, 2023 at 07:16:28PM +0900, Masahiro Yamada wrote: > Since commit 05e96e96a315 ("kbuild: use git-archive for source package > creation"), source tarballs are created in two steps; create *.tar file > then compress it. I split the compression as a separate rule because I > just thought 'git archive' supported only gzip for compression. I admit > the unneeded *.tar file is annoying. > > For other compression algorithms, I could pipe the two commands: > > $ git archive HEAD | xz > linux.tar.xz > > I read git-archive(1) carefully, and I realized GIT had provided a > more elegant way: Hooray for documentation :) > $ git -c tar.tar.xz.command=xz archive -o linux.tar.xz HEAD > > This commit uses 'tar.tar.*.command' configuration to specify the > compression backend so we can create a compressed tarball directly. > > GIT commit 767cf4579f0e ("archive: implement configurable tar filters") > is more than a decade old, so it should be available on almost all build > environments. git 1.7.7 it seems, certainly ancientware in my opinion. If people have issues with this, they can just upgrade git; even RHEL7 has git 1.8.x. > Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor > --- > > scripts/Makefile.package | 24 +++++++++++++++++------- > 1 file changed, 17 insertions(+), 7 deletions(-) > > diff --git a/scripts/Makefile.package b/scripts/Makefile.package > index a205617730c6..7707975f729b 100644 > --- a/scripts/Makefile.package > +++ b/scripts/Makefile.package > @@ -57,16 +57,23 @@ check-git: > false; \ > fi > > +archive-config-tar.gz = -c tar.tar.gz.command="$(KGZIP)" > +archive-config-tar.bz2 = -c tar.tar.bz2.command="$(KBZIP2)" > +archive-config-tar.xz = -c tar.tar.xz.command="$(XZ)" > +archive-config-tar.zst = -c tar.tar.zst.command="$(ZSTD)" > + > quiet_cmd_archive = ARCHIVE $@ > - cmd_archive = git -C $(srctree) archive \ > + cmd_archive = git -C $(srctree) $(archive-config-tar$(suffix $@)) archive \ > --output=$$(realpath $@) --prefix=$(basename $@)/ $(archive-args) > > # Linux source tarball > # --------------------------------------------------------------------------- > > -targets += linux.tar > -linux.tar: archive-args = $$(cat $<) > -linux.tar: .tmp_HEAD FORCE > +linux-tarballs := $(addprefix linux, .tar.gz) Is there any reason not to allow other compression formats for linux like you do for perf? > + > +targets += $(linux-tarballs) > +$(linux-tarballs): archive-args = $$(cat $<) > +$(linux-tarballs): .tmp_HEAD FORCE > $(call if_changed,archive) > > # rpm-pkg > @@ -185,9 +192,12 @@ perf-archive-args = --add-file=$$(realpath $(word 2, $^)) \ > --add-file=$$(realpath $(word 3, $^)) \ > $$(cat $(word 2, $^))^{tree} $$(cat $<) > > -targets += perf-$(KERNELVERSION).tar > -perf-$(KERNELVERSION).tar: archive-args = $(perf-archive-args) > -perf-$(KERNELVERSION).tar: tools/perf/MANIFEST .tmp_perf/HEAD .tmp_perf/PERF-VERSION-FILE FORCE > + > +perf-tarballs := $(addprefix perf-$(KERNELVERSION), .tar .tar.gz .tar.bz2 .tar.xz .tar.zst) > + > +targets += $(perf-tarballs) > +$(perf-tarballs): archive-args = $(perf-archive-args) > +$(perf-tarballs): tools/perf/MANIFEST .tmp_perf/HEAD .tmp_perf/PERF-VERSION-FILE FORCE > $(call if_changed,archive) > > PHONY += perf-tar-src-pkg > -- > 2.37.2 >