Re: [PATCH v2] deb-pkg: generate correct build dependencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 19, 2019 at 1:00 AM Masahiro Yamada
<yamada.masahiro@xxxxxxxxxxxxx> wrote:
>
> Hi Riku,
>
>
> On Thu, Jan 3, 2019 at 6:28 AM Masahiro Yamada
> <yamada.masahiro@xxxxxxxxxxxxx> wrote:
> >
> > Hi Riku,
> >
> >
> >
> > On Wed, Jan 2, 2019 at 6:28 PM <riku.voipio@xxxxxxxxxx> wrote:
> > >
> > > From: Riku Voipio <riku.voipio@xxxxxxxxxx>
> > >
> > > bison/flex is now needed always for building for kconfig. Some build
> > > dependencies depend on kernel configuration, enable them as needed:
> > >
> > > - libelf-dev when UNWINDER_ORC is set
> > > - libssl-dev for SYSTEM_TRUSTED_KEYRING
> > >
> > > Since the libssl-dev is needed for extract_cert binary, denote with
> > > :native to install the libssl-dev for the build machines architecture,
> > > rather than for the architecture of the kernel being built.
> > >
> > > Tested-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
> > > Signed-off-by: Riku Voipio <riku.voipio@xxxxxxxxxx>
> > > ---
> > > v2: commit message updated
> > > ---
> >
> >
> > $ make defconfig && make bindeb-pkg
> >
> > worked for me, but
> >
> > $ make allnoconfig && make bindeb-pkg
> >
> > failed with
> >
> > dpkg-checkbuilddeps: error: Unmet build dependencies: flex
> >
> >
> > I do not know why.
>
>
>
> I looked into this build error.
>
> This happens depending on 'debian/arch'.
>
> My host machine is x86_64.
>
>
> When I run "make defconfig; make bindeb-pkg",
>
> $ cat debian/arch
> amd64
>
>
>
> When I run "make allnoconfig; make bindeb-pkg",
>
> $ cat debian/arch
> i386
>
>
>
> $ head -n 6 debian/control
> Source: linux-5.0.0-rc7+
> Section: kernel
> Priority: optional
> Maintainer: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
> Build-Depends: bc, kmod, cpio, bison, flex , ,
> Homepage: http://www.kernel.org/
>
> $ dpkg-buildpackage -r"fakeroot -u" -ai386 -b -nc
> -ucdpkg-buildpackage: source package linux-5.0.0-rc7+
> dpkg-buildpackage: source version 5.0.0-rc7+-1
> dpkg-buildpackage: source distribution xenial
> dpkg-buildpackage: source changed by Masahiro Yamada
> <yamada.masahiro@xxxxxxxxxxxxx>
> dpkg-architecture: warning: specified GNU system type i686-linux-gnu
> does not match CC system type x86_64-linux-gnu, try setting a correct
> CC environment variable
> dpkg-buildpackage: host architecture i386
>  dpkg-source --before-build linux
> dpkg-checkbuilddeps: error: Unmet build dependencies: flex
> dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
> dpkg-buildpackage: warning: (Use -d flag to override.)
>
>
> After I applied the following patch,
> I was able to build "make allnoconfig; make bindeb-pkg".
>
>
>
> diff --git a/scripts/package/Makefile b/scripts/package/Makefile
> index 453fece..6793642 100644
> --- a/scripts/package/Makefile
> +++ b/scripts/package/Makefile
> @@ -72,11 +72,11 @@ deb-pkg: FORCE
>         $(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) -i.git -us -uc
> +       +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) --target-arch
> $$(cat debian/arch) -i.git -us -uc
>
>  bindeb-pkg: FORCE
>         $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
> -       +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat
> debian/arch) -b -nc -uc
> +       +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) --target-arch
> $$(cat debian/arch) -b -nc -uc
>
>  intdeb-pkg: FORCE
>         +$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb


This is not the right answer.


"make allnoconfig; make bindeb-pkg"
failed on Ubuntu 16.04, but succeeded on Ubuntu 18.04

I am puzzled...



foo@4066694d5e03:/ref/linux$ git log --oneline -1
bd8f27f deb-pkg: generate correct build dependencies
foo@4066694d5e03:/ref/linux$ make bindeb-pkg
/bin/bash ./scripts/package/mkdebian
Using default distribution of 'unstable' in the changelog
Install lsb-release or set $KDEB_CHANGELOG_DIST explicitly
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch) -b -nc -uc
dpkg-buildpackage: source package linux-5.0.0-rc7+
dpkg-buildpackage: source version 5.0.0-rc7+-1
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by foo <foo@4066694d5e03>
dpkg-architecture: warning: specified GNU system type i686-linux-gnu
does not match CC system type x86_64-linux-gnu, try setting a correct
CC environment variable
dpkg-buildpackage: host architecture i386
 dpkg-source --before-build linux
dpkg-checkbuilddeps: error: Unmet build dependencies: flex
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
scripts/package/Makefile:78: recipe for target 'bindeb-pkg' failed
make[1]: *** [bindeb-pkg] Error 3
Makefile:1390: recipe for target 'bindeb-pkg' failed
make: *** [bindeb-pkg] Error 2


The docker file I used is below.

If I change "FROM ubuntu:16.04" to "FROM ubuntu:18.04",
it goes well.




------------------->8------------------
FROM ubuntu:16.04

# user name
ARG USER=foo

# packages to install
ARG PKGS=" \
bc \
bison \
build-essential \
flex \
git \
strace \
sudo \
cpio \
kmod \
"

RUN \
apt-get update && \
DEBCONF_NOWARNINGS=yes apt-get install -y apt-utils && \
apt-get install -y ${PKGS} && \
useradd -m ${USER} && \
echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

USER ${USER}
WORKDIR /home/${USER}
---------------------->8--------------------------





-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux