Re: [PATCH 1/2] kbuild: add srcdeb-pkg target

From: Masahiro Yamada
Date: Mon Apr 17 2023 - 21:18:31 EST


On Mon, Apr 17, 2023 at 11:52 PM Ben Hutchings <ben@xxxxxxxxxxxxxxx> wrote:
>
> On Mon, 2023-04-17 at 23:25 +0900, Masahiro Yamada wrote:
> > This new target builds only the debian source package.
> >
> > Unify the build rules of deb-pkg, srcdeb-pkg, bindeb-pkg to avoid
> > code duplication.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
> > Reviewed-by: Nicolas Schier <nicolas@xxxxxxxxx>
> > ---
> [...]
> > bindeb-pkg: debian
> > - +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc
> > +deb-pkg srcdeb-pkg bindeb-pkg:
> > + +$(strip dpkg-buildpackage \
> > + --build=$(build-type) --no-pre-clean --unsigned-changes \
> > + $(if $(findstring source, $(build-type)), \
> > + --unsigned-source) \
> > + $(if $(findstring binary, $(build-type)), \
> > + -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
> > + --no-check-builddeps) \
> [...]
>
> There is no need to make the use of --unsigned-source (-us) or -r
> conditional on the build type. They will be ignored if not applicable.



True, but you can also say there is no need
to pass options that we know are unnecessary.


My motivation is to make unneeded options
really don't-care.



2/2 will add KDEB_SOURCE_COMPRESS.

If I do not make it optional,
"KDEB_SOURCE_COMPRESS=foo make bindeb-pkg"
would fail.




dpkg-buildpackage --build=binary --no-pre-clean --unsigned-changes
--unsigned-source --compression=foo -r'fakeroot -u' -a$(cat
debian/arch)
dpkg-buildpackage: info: source package linux-upstream
dpkg-buildpackage: info: source version 6.3.0-rc7-00003-geb58366b57fe-33
dpkg-buildpackage: info: source distribution kinetic
dpkg-buildpackage: info: source changed by Masahiro Yamada
<masahiro.yamada@xxxxxxxxxxxxx>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --compression=foo --before-build .
dpkg-source: error: foo is not a supported compression

Use --help for program usage information.





"dpkg-buildpackage --build=binary" does not
generate a source package, but still checks
if --compression=foo is correct.



> This is also adding --no-check-builddeps (-d), which is not explained
> in the commit message. It might be valid to add this for srcdeb-pkg,
> but the build dependency check is valuable for bindeb-pkg and deb-pkg.


Yes.
So, I added --no-check-builddeps to the else arm.



I will add the following commit description:


--no-check-builddeps is added to srcbin-pkg
so that build dependencies will not be checked.





>
> Ben.
>
> --
> Ben Hutchings
> Sturgeon's Law: Ninety percent of everything is crap.



--
Best Regards
Masahiro Yamada