Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37B50C636CC for ; Sun, 29 Jan 2023 08:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233379AbjA2IW3 (ORCPT ); Sun, 29 Jan 2023 03:22:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230489AbjA2IW0 (ORCPT ); Sun, 29 Jan 2023 03:22:26 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F03D1204C; Sun, 29 Jan 2023 00:22:25 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id f34so14742207lfv.10; Sun, 29 Jan 2023 00:22:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hKBnKR2iW3XxM9u27njnGJ4qF4jEIutX4Q4b0kirsZs=; b=DtAGRxVmOqZbLVSXMFja8IUkY5CHCp8lje31f8iSPCyxDFREP/hcGoSROd5z0xdzSK URaUrGZ+WfSmV4xyllpsZTW9Us3hjkKQaOvAwdUrko3CfVrb2psF3rJqnOc9Z6WzlPk5 Rj/jHSj2/tpqY9FO2R9IgzBzBmlWmVSwKziST8njOqSTTFRNawQ8MijJ82r16K8EEoLa SB/yr5/yKC99zcYPPf0jsEwf2wP0YpQ8822gXqnfoFLOJtylOYtvDhJb4Xz7dOHNN3jW 1cUpnNqeOtuTx762t28xv4959Lb5DIoVv66JS/KhNi5UlIOBH0W0LtCxDxRs45tZABVd x3hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hKBnKR2iW3XxM9u27njnGJ4qF4jEIutX4Q4b0kirsZs=; b=HPH8zclsZ9ZVzoSfafxgy4hQGncvL1mkIwswrSPdsnYlza9bd2K0QsRwKh1StAOrkW sgrQu3BegVcFBm+DzIlHWYt2YXKt2TORgu4aNJMcLfAbQFoDxx4nZIOuNbsCgIakRIo2 3R7wqbvAbx29IRoJ6e32rE6hqD4lp1Sn0uSv+7jJ9/B4BDLaL/mwOQOIR6FQxIME5due A2q7j9BaInFbXxsdrIibsUn106tmXxH+Ova3G7PtFIrHOh5vIVHNnxauDrlH/No2nbGU mnnMEThB1KcVvir6wL3uH10eCTSqokOJ4HlMmexRFO4p+nGHiNLFja8iN99lYcrpf0sU bGyw== X-Gm-Message-State: AFqh2krLjin1yZov2kQRjXyvDheKgq+Z8oILXCk8Cv08MJZQEnTkSroK uC7jCITzt4AjJGyScBXFKE8StxXA7w1DNyhp+8jUqiL9OQU= X-Google-Smtp-Source: AMrXdXt3zTUW1/rT8yTMHEqwbBtNV+lMZJT5DHJEzzu6Ci94ZyAmSzzftThcsQZTA5k2MHKNz3OFI8zsWUmhvGclAhA= X-Received: by 2002:ac2:4c51:0:b0:4a2:2c23:a6d4 with SMTP id o17-20020ac24c51000000b004a22c23a6d4mr2822884lfk.257.1674980543255; Sun, 29 Jan 2023 00:22:23 -0800 (PST) MIME-Version: 1.0 References: <20230128173843.765212-1-masahiroy@kernel.org> <20230128173843.765212-2-masahiroy@kernel.org> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Sun, 29 Jan 2023 09:21:45 +0100 Message-ID: Subject: Re: [PATCH 2/4] kbuild: deb-pkg: create source package without cleaning To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Tom Rix , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 29, 2023 at 9:08 AM Masahiro Yamada wrote: > > On Sun, Jan 29, 2023 at 8:31 AM Sedat Dilek wrote: > > > > On Sat, Jan 28, 2023 at 6:40 PM Masahiro Yamada wrote: > > > > > > If you run 'make deb-pkg', all objects are lost due to 'make clean', > > > which makes the incremental builds impossible. > > > > > > Instead of cleaning, pass the exclude list to tar's --exclude-from > > > option. > > > > > > Previously, *.diff.gz contained some check-in files such as > > > .clang-format, .cocciconfig. > > > > > > With this commit, *.diff.gz will only contain the .config and debian/. > > > The other source files will go into the tarball. > > > > > > > Thanks for the patch. > > > > While at this... > > > > ...why not switch over to Debian's packaging default XZ compressor: > > *.orig.xz and *.diff.xz (or *.debian.tar.xz)? > > > Does debian support *.diff.xz? > I do not think so. > > *.debian.tar.xz requires "Format: 3.0 (quilt)" migration. > > > See scripts/package/mkdebian. > We use "Format: 1.0", which only supports gzip. > Ah OK. > > It is true the Debian kernel uses "Format: 3.0 (quilt)", > but I do not think it will fit to the upstream kernel. > > Rather, I want to use the Native format since I do not > see much sense in the *.orig.tar.gz / *.diff.gz split > for the upstream project. > > > My plan is to stop cleaning first, > then change the source format if it is desirable. > Yes, makes sense. -Sedat- > > > > > > > > EXAMPLE binutils: > > > > DSC: http://deb.debian.org/debian/pool/main/b/binutils/binutils_2.40-2.dsc > > This is "Format: 3.0 (quilt)". > > > > TAR: http://deb.debian.org/debian/pool/main/b/binutils/binutils_2.40.orig.tar.xz > > DIFF: http://deb.debian.org/debian/pool/main/b/binutils/binutils_2.40-2.debian.tar.xz > > > This is not a diff. It is a tarball of the debian/ directory. > Real diffs are stored in debian/patches/. > > > > > > > > > -Sedat- > > > > [1] https://packages.debian.org/sid/binutils > > > > > Signed-off-by: Masahiro Yamada > > > --- > > > > > > scripts/Makefile.package | 27 ++++++++++++++++++++++----- > > > scripts/package/mkdebian | 27 +++++++++++++++++++++++++++ > > > 2 files changed, 49 insertions(+), 5 deletions(-) > > > > > > diff --git a/scripts/Makefile.package b/scripts/Makefile.package > > > index dfbf40454a99..cb135c99a273 100644 > > > --- a/scripts/Makefile.package > > > +++ b/scripts/Makefile.package > > > @@ -50,6 +50,21 @@ fi ; \ > > > tar -I $(KGZIP) -c $(RCS_TAR_IGNORE) -f $(2).tar.gz \ > > > --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3) > > > > > > +# Source Tarball > > > +# --------------------------------------------------------------------------- > > > + > > > +quiet_cmd_exclude_list = GEN $@ > > > + cmd_exclude_list = $(srctree)/scripts/gen-exclude.py --prefix=./ --rootdir=$(srctree) > $@; echo "./$@" >> $@ > > > + > > > +.exclude-list: FORCE > > > + $(call cmd,exclude_list) > > > + > > > +quiet_cmd_tar = TAR $@ > > > + cmd_tar = tar -I $(KGZIP) -c -f $@ -C $(srctree) --exclude-from=$< --exclude=./$@ --transform 's:^\.:linux:S' . > > > + > > > +%.tar.gz: .exclude-list > > > + $(call cmd,tar) > > > + > > > # rpm-pkg > > > # --------------------------------------------------------------------------- > > > PHONY += rpm-pkg > > > @@ -81,12 +96,11 @@ binrpm-pkg: > > > > > > PHONY += deb-pkg > > > deb-pkg: > > > - $(MAKE) clean > > > $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian > > > - $(call cmd,src_tar,$(KDEB_SOURCENAME)) > > > - origversion=$$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$$//');\ > > > - mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz > > > - +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) --source-option=-sP -i.git -us -uc > > > + $(Q)origversion=$$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$$//');\ > > > + $(MAKE) -f $(srctree)/scripts/Makefile.package ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz > > > + +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) \ > > > + --build=source,binary --source-option=-sP -nc -us -uc > > > > > > PHONY += bindeb-pkg > > > bindeb-pkg: > > > @@ -174,4 +188,7 @@ help: > > > @echo ' perf-tarxz-src-pkg - Build $(perf-tar).tar.xz source tarball' > > > @echo ' perf-tarzst-src-pkg - Build $(perf-tar).tar.zst source tarball' > > > > > > +PHONY += FORCE > > > +FORCE: > > > + > > > .PHONY: $(PHONY) > > > diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian > > > index c3bbef7a6754..12c057ffbe6e 100755 > > > --- a/scripts/package/mkdebian > > > +++ b/scripts/package/mkdebian > > > @@ -84,6 +84,8 @@ set_debarch() { > > > fi > > > } > > > > > > +rm -rf debian > > > + > > > # Some variables and settings used throughout the script > > > version=$KERNELRELEASE > > > if [ -n "$KDEB_PKGVERSION" ]; then > > > @@ -135,6 +137,31 @@ fi > > > mkdir -p debian/source/ > > > echo "1.0" > debian/source/format > > > > > > +cat<<'EOF' > debian/source/local-options > > > +# > > > +# Ugly: ignore anything except .config or debian/ > > > +# (is there a cleaner way to do this?) > > > +# > > > +diff-ignore > > > + > > > +extend-diff-ignore = ^[^.d] > > > + > > > +extend-diff-ignore = ^\.[^c] > > > +extend-diff-ignore = ^\.c($|[^o]) > > > +extend-diff-ignore = ^\.co($|[^n]) > > > +extend-diff-ignore = ^\.con($|[^f]) > > > +extend-diff-ignore = ^\.conf($|[^i]) > > > +extend-diff-ignore = ^\.confi($|[^g]) > > > +extend-diff-ignore = ^\.config. > > > + > > > +extend-diff-ignore = ^d($|[^e]) > > > +extend-diff-ignore = ^de($|[^b]) > > > +extend-diff-ignore = ^deb($|[^i]) > > > +extend-diff-ignore = ^debi($|[^a]) > > > +extend-diff-ignore = ^debia($|[^n]) > > > +extend-diff-ignore = ^debian[^/] > > > +EOF > > > + > > > echo $debarch > debian/arch > > > extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev:native)" > > > extra_build_depends="$extra_build_depends, $(if_enabled_echo CONFIG_SYSTEM_TRUSTED_KEYRING libssl-dev:native)" > > > -- > > > 2.34.1 > > > > > > > -- > Best Regards > Masahiro Yamada