Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #191532 > unrolled thread

How to rebuild a Debian package for a foreign architecture?

Started byVincent Lefevre <vincent@vinc17.net>
First post2018-01-25 15:00 +0100
Last post2018-05-15 13:40 +0200
Articles 8 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  How to rebuild a Debian package for a foreign architecture? Vincent Lefevre <vincent@vinc17.net> - 2018-01-25 15:00 +0100
    Re: How to rebuild a Debian package for a foreign architecture? <tomas@tuxteam.de> - 2018-01-25 15:40 +0100
      Re: How to rebuild a Debian package for a foreign architecture? Curt <curty@free.fr> - 2018-01-25 16:00 +0100
        Re: How to rebuild a Debian package for a foreign architecture? Vincent Lefevre <vincent@vinc17.net> - 2018-01-25 23:10 +0100
          Re: How to rebuild a Debian package for a foreign architecture? Curt <curty@free.fr> - 2018-01-26 11:00 +0100
            Re: How to rebuild a Debian package for a foreign architecture? Vincent Lefevre <vincent@vinc17.net> - 2018-01-29 13:00 +0100
      Re: How to rebuild a Debian package for a foreign architecture? Vincent Lefevre <vincent@vinc17.net> - 2018-01-25 23:10 +0100
        [SOLVED] How to rebuild a Debian package for a foreign architecture? Vincent Lefevre <vincent@vinc17.net> - 2018-05-15 13:40 +0200

#191532 — How to rebuild a Debian package for a foreign architecture?

FromVincent Lefevre <vincent@vinc17.net>
Date2018-01-25 15:00 +0100
SubjectHow to rebuild a Debian package for a foreign architecture?
Message-ID<vbQem-6FO-9@gated-at.bofh.it>
To rebuild a Debian package, one can use:

  debuild -i -us -uc -b

But how to rebuild a Debian package for a foreign architecture?
In my case for i386 from an amd64 machine. I've tried

  debuild -i -us -uc -b -a i386

but the build fails at some point:

[...]
dh_strip -a
dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
Can't exec "i686-linux-gnu-strip": No such file or directory at /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm line 358.
[...]

If I need binutils-i686-linux-gnu, shouldn't dpkg-buildpackage fail
when checking the build dependencies?

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

[toc] | [next] | [standalone]


#191534

From<tomas@tuxteam.de>
Date2018-01-25 15:40 +0100
Message-ID<vbQR3-79g-7@gated-at.bofh.it>
In reply to#191532
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Jan 25, 2018 at 02:56:17PM +0100, Vincent Lefevre wrote:
> To rebuild a Debian package, one can use:
> 
>   debuild -i -us -uc -b
> 
> But how to rebuild a Debian package for a foreign architecture?
> In my case for i386 from an amd64 machine. I've tried
> 
>   debuild -i -us -uc -b -a i386
> 
> but the build fails at some point:
> 
> [...]
> dh_strip -a
> dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
> dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
> dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
> Can't exec "i686-linux-gnu-strip": No such file or directory at /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm line 358.
> [...]

It seems that you are missing the '386 (or more precisely the '686)
executables. Perhaps you need the package dpkg-cross.

> If I need binutils-i686-linux-gnu, shouldn't dpkg-buildpackage fail
> when checking the build dependencies?

I'll leave that question to someone more knowledgeable.

Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlpp6eoACgkQBcgs9XrR2kbzfwCfWeMl36zg2mSBoDSuj4s/yam6
/TkAniKmKJKviZoyjwvE5wEDwYXS+Ree
=Z/As
-----END PGP SIGNATURE-----

[toc] | [prev] | [next] | [standalone]


#191536

FromCurt <curty@free.fr>
Date2018-01-25 16:00 +0100
Message-ID<vbRap-7g3-1@gated-at.bofh.it>
In reply to#191534
On 2018-01-25, <tomas@tuxteam.de> <tomas@tuxteam.de> wrote:
>
> It seems that you are missing the '386 (or more precisely the '686)
> executables. Perhaps you need the package dpkg-cross.
>
>> If I need binutils-i686-linux-gnu, shouldn't dpkg-buildpackage fail
>> when checking the build dependencies?
>
> I'll leave that question to someone more knowledgeable.

I'm much less so, but I've heard people recommending pbuilder for this (chroot).

 pbuilder --create --architecture i386
 pbuilder --build mypackage.dsc

etc...

> Cheers
> - -- tomás
>
>


-- 
“True terror is to wake up one morning and discover that your high school class
is running the country.” – Kurt Vonnegut

[toc] | [prev] | [next] | [standalone]


#191563

FromVincent Lefevre <vincent@vinc17.net>
Date2018-01-25 23:10 +0100
Message-ID<vbXSz-3dW-57@gated-at.bofh.it>
In reply to#191536
On 2018-01-25 14:53:14 +0000, Curt wrote:
> On 2018-01-25, <tomas@tuxteam.de> <tomas@tuxteam.de> wrote:
> >
> > It seems that you are missing the '386 (or more precisely the '686)
> > executables. Perhaps you need the package dpkg-cross.
> >
> >> If I need binutils-i686-linux-gnu, shouldn't dpkg-buildpackage fail
> >> when checking the build dependencies?
> >
> > I'll leave that question to someone more knowledgeable.
> 
> I'm much less so, but I've heard people recommending pbuilder for
> this (chroot).
> 
>  pbuilder --create --architecture i386
>  pbuilder --build mypackage.dsc

IMHO, this is overkill, at least in my case. And I don't like to
require root just to build a package.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

[toc] | [prev] | [next] | [standalone]


#191585

FromCurt <curty@free.fr>
Date2018-01-26 11:00 +0100
Message-ID<vc8XD-1AB-1@gated-at.bofh.it>
In reply to#191563
On 2018-01-25, Vincent Lefevre <vincent@vinc17.net> wrote:
> On 2018-01-25 14:53:14 +0000, Curt wrote:
>> On 2018-01-25, <tomas@tuxteam.de> <tomas@tuxteam.de> wrote:
>> >
>> > It seems that you are missing the '386 (or more precisely the '686)
>> > executables. Perhaps you need the package dpkg-cross.
>> >
>> >> If I need binutils-i686-linux-gnu, shouldn't dpkg-buildpackage fail
>> >> when checking the build dependencies?
>> >
>> > I'll leave that question to someone more knowledgeable.
>> 
>> I'm much less so, but I've heard people recommending pbuilder for
>> this (chroot).
>> 
>>  pbuilder --create --architecture i386
>>  pbuilder --build mypackage.dsc
>
> IMHO, this is overkill, at least in my case. And I don't like to
> require root just to build a package.
>

Apparently you need root to satisfy the build *dependencies* (which
means you need to be root to install a package--but we new that
already).

However 

 ...most packages do not need root privilege to build, or even
 refused to build when they are built as root. pbuilder can create a user
 which is only used inside pbuilder and use that user id when building,
 and use the fakeroot command when root privilege is required.

https://pbuilder.alioth.debian.org/#nonrootchroot

Anyhow, nothing is more convincing than success, and if your "lighter"
and less "mortal" method is successful, God bless and full speed ahead!



-- 
“True terror is to wake up one morning and discover that your high school class
is running the country.” – Kurt Vonnegut

[toc] | [prev] | [next] | [standalone]


#191717

FromVincent Lefevre <vincent@vinc17.net>
Date2018-01-29 13:00 +0100
Message-ID<vdggp-3LG-1@gated-at.bofh.it>
In reply to#191585
On 2018-01-26 09:47:58 +0000, Curt wrote:
> On 2018-01-25, Vincent Lefevre <vincent@vinc17.net> wrote:
> > On 2018-01-25 14:53:14 +0000, Curt wrote:
> >> On 2018-01-25, <tomas@tuxteam.de> <tomas@tuxteam.de> wrote:
> >> >
> >> > It seems that you are missing the '386 (or more precisely the '686)
> >> > executables. Perhaps you need the package dpkg-cross.
> >> >
> >> >> If I need binutils-i686-linux-gnu, shouldn't dpkg-buildpackage fail
> >> >> when checking the build dependencies?
> >> >
> >> > I'll leave that question to someone more knowledgeable.
> >> 
> >> I'm much less so, but I've heard people recommending pbuilder for
> >> this (chroot).
> >> 
> >>  pbuilder --create --architecture i386
> >>  pbuilder --build mypackage.dsc
> >
> > IMHO, this is overkill, at least in my case. And I don't like to
> > require root just to build a package.
> 
> Apparently you need root to satisfy the build *dependencies* (which
> means you need to be root to install a package--but we new that
> already).

When I want to build a package for the native architecture, I don't
need to be root. If there are missing build dependencies, then the
missing packages are listed, so that I can install them as root,
then I can retry the package build as a normal user. So, the only
things I do as root is to install packages. The build is entirely
done as a normal user.

> However 
> 
>  ...most packages do not need root privilege to build, or even
>  refused to build when they are built as root. pbuilder can create a user
>  which is only used inside pbuilder and use that user id when building,
>  and use the fakeroot command when root privilege is required.
> 
> https://pbuilder.alioth.debian.org/#nonrootchroot

Or perhaps I can try pbuilder-user-mode-linux.

The issue is that all this will require a major rewrite of my
scripts...

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

[toc] | [prev] | [next] | [standalone]


#191561

FromVincent Lefevre <vincent@vinc17.net>
Date2018-01-25 23:10 +0100
Message-ID<vbXSy-3dW-19@gated-at.bofh.it>
In reply to#191534
On 2018-01-25 15:30:02 +0100, tomas@tuxteam.de wrote:
> On Thu, Jan 25, 2018 at 02:56:17PM +0100, Vincent Lefevre wrote:
> > To rebuild a Debian package, one can use:
> > 
> >   debuild -i -us -uc -b
> > 
> > But how to rebuild a Debian package for a foreign architecture?
> > In my case for i386 from an amd64 machine. I've tried
> > 
> >   debuild -i -us -uc -b -a i386
> > 
> > but the build fails at some point:
> > 
> > [...]
> > dh_strip -a
> > dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
> > dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
> > dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
> > Can't exec "i686-linux-gnu-strip": No such file or directory at /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm line 358.
> > [...]
> 
> It seems that you are missing the '386 (or more precisely the '686)
> executables. Perhaps you need the package dpkg-cross.

Installing dpkg-cross just installs: cross-config dpkg-cross
libconfig-auto-perl libdebian-dpkgcross-perl. This is not
sufficient.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

[toc] | [prev] | [next] | [standalone]


#195765 — [SOLVED] How to rebuild a Debian package for a foreign architecture?

FromVincent Lefevre <vincent@vinc17.net>
Date2018-05-15 13:40 +0200
Subject[SOLVED] How to rebuild a Debian package for a foreign architecture?
Message-ID<vPGtb-41V-3@gated-at.bofh.it>
In reply to#191561
On 2018-01-25 23:03:50 +0100, Vincent Lefevre wrote:
> On 2018-01-25 15:30:02 +0100, tomas@tuxteam.de wrote:
> > On Thu, Jan 25, 2018 at 02:56:17PM +0100, Vincent Lefevre wrote:
> > > To rebuild a Debian package, one can use:
> > > 
> > >   debuild -i -us -uc -b
> > > 
> > > But how to rebuild a Debian package for a foreign architecture?
> > > In my case for i386 from an amd64 machine. I've tried
> > > 
> > >   debuild -i -us -uc -b -a i386
> > > 
> > > but the build fails at some point:
> > > 
> > > [...]
> > > dh_strip -a
> > > dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
> > > dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
> > > dh_strip: Compatibility levels before 9 are deprecated (level 7 in use)
> > > Can't exec "i686-linux-gnu-strip": No such file or directory at /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm line 358.
> > > [...]
> > 
> > It seems that you are missing the '386 (or more precisely the '686)
> > executables. Perhaps you need the package dpkg-cross.
> 
> Installing dpkg-cross just installs: cross-config dpkg-cross
> libconfig-auto-perl libdebian-dpkgcross-perl. This is not
> sufficient.

According to https://wiki.debian.org/CrossCompiling, it should
have been crossbuild-essential-i386, and indeed, this installs
binutils-i686-linux-gnu (which provides i686-linux-gnu-strip).
However, it seems to install more than necessary for the
particular case of i386 on an amd64 machine.

Now, this was just one of the issues. After installing
binutils-i686-linux-gnu, the other issue was that the architecture
wasn't taken into account by debuild itself, after running
dpkg-buildpackage successfully. I eventually found a bug / limitation
in the debuild source: to be taken into account by debuild, one
needs to write -ai386 *without a space*. I've reported this bug
(real bug or lack of documentation):

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898706

With "debuild -i -us -uc -b -ai386", I now do not get any error.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web