Discussion:
Pbuilder problem
Paul van der Vlis
2018-09-06 19:40:37 UTC
Permalink
Hello,

I use pbuilder for backporting packages. My problem is that a package
does not build, when there are build-dependencies from backports.
What can I do to make this work?

Some more info:

For example the package dh-linktree does not build, because debhelper >=
11 is needed, what's in backports. How do you backport such a package
with pbuilder?

I will add my .pbuilderrc as an attachment.

The error is:
dpkg-checkbuilddeps: Unmet build dependencies: debhelper (>= 11)
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied;
aborting
dpkg-buildpackage: warning: (Use -d flag to override.)

With regards,
Paul van der Vlis
--
Paul van der Vlis Linux systeembeheer Groningen
https://www.vandervlis.nl/
Paul Gevers
2018-09-06 19:51:49 UTC
Permalink
Hi Paul,
Post by Paul van der Vlis
I use pbuilder for backporting packages. My problem is that a package
does not build, when there are build-dependencies from backports.
What can I do to make this work?
I don't know if it is the cleanest option, but I use the attached hook.

Paul
Rodrigo Campos
2018-09-06 19:52:25 UTC
Permalink
Post by Paul van der Vlis
Hello,
I use pbuilder for backporting packages. My problem is that a package
does not build, when there are build-dependencies from backports.
What can I do to make this work?
For example the package dh-linktree does not build, because debhelper >=
11 is needed, what's in backports. How do you backport such a package
with pbuilder?
You can modify the sources.list that the chroot uses, and just add the backports
repo
Nicholas D Steeves
2018-09-06 20:22:29 UTC
Permalink
Hi Paul,
Post by Rodrigo Campos
Post by Paul van der Vlis
Hello,
I use pbuilder for backporting packages. My problem is that a package
does not build, when there are build-dependencies from backports.
What can I do to make this work?
For example the package dh-linktree does not build, because debhelper >=
11 is needed, what's in backports. How do you backport such a package
with pbuilder?
You can modify the sources.list that the chroot uses, and just add the backports
repo
P.S. debhelper >= 11 cannot be fulfilled in stretch-backports;
however, >= 11~ (eg: 11~bpo9) can.

Cheers,
Nicholas
Holger Levsen
2018-09-07 10:11:41 UTC
Permalink
Post by Nicholas D Steeves
P.S. debhelper >= 11 cannot be fulfilled in stretch-backports;
sure it can (nowadays), stretch-backports has 11.3.5~bpo9. (a few months
ago only >= 11~ was possible, but that's a thing of the past.)
--
cheers,
Holger

-------------------------------------------------------------------------------
holger@(debian|reproducible-builds|layer-acht).org
PGP fingerprint: B8BF 5413 7B09 D35C F026 FE9D 091A B856 069A AA1C
Paul van der Vlis
2018-09-07 10:37:35 UTC
Permalink
Post by Rodrigo Campos
Post by Paul van der Vlis
Hello,
I use pbuilder for backporting packages. My problem is that a package
does not build, when there are build-dependencies from backports.
What can I do to make this work?
For example the package dh-linktree does not build, because debhelper >=
11 is needed, what's in backports. How do you backport such a package
with pbuilder?
You can modify the sources.list that the chroot uses, and just add the backports
repo
What is the correct way to modify the chroot? I have tried things like:

mkdir /tmp/test; cd /tmp/test/
tar zxpf /var/cache/pbuilder/stable-amd64-base.tgz
nano etc/apt/sources.list
tar cfz ../stable-amd64-base.tgz .

Is this a good way?

It does not work, I get now:
----
I: Extracting source
/sbin/start-stop-daemon: unable to start /bin/sh (Permission denied)
E: pbuilder: Failed extracting the source
----
Not sure what this is.

What I saw, is that stable-amd64-base.tgz has in sources.list lines with
"stable", but for backports it has "jessie-backports"! I have changed that.

When I run:
sudo pbuilder --create --distribution stretch
It's creating a testing-amd64-base.tgz
When I try to login with:
pbuilder --login --distribution stable
I see it's using testing-amd64-base.tgz

Very confusing. Is there something wrong on my system, is this a bug, or
is this normal?

With regards,
Paul
--
Paul van der Vlis Linux systeembeheer Groningen
https://www.vandervlis.nl/
Dominic Benson
2018-09-07 10:56:04 UTC
Permalink
Post by Paul van der Vlis
Post by Rodrigo Campos
Post by Paul van der Vlis
Hello,
I use pbuilder for backporting packages. My problem is that a package
does not build, when there are build-dependencies from backports.
What can I do to make this work?
For example the package dh-linktree does not build, because debhelper >=
11 is needed, what's in backports. How do you backport such a package
with pbuilder?
You can modify the sources.list that the chroot uses, and just add the backports
repo
mkdir /tmp/test; cd /tmp/test/
tar zxpf /var/cache/pbuilder/stable-amd64-base.tgz
nano etc/apt/sources.list
tar cfz ../stable-amd64-base.tgz .
Is this a good way?
The best way to modify the chroot is to:

pbuilder login --save-after-login [--basetgz /path/to/tarball]
Post by Paul van der Vlis
----
I: Extracting source
/sbin/start-stop-daemon: unable to start /bin/sh (Permission denied)
E: pbuilder: Failed extracting the source
----
Not sure what this is.
At a guess, permissions and/or ownership have changed over the course of
your unpacking and repacking the tar.
Post by Paul van der Vlis
What I saw, is that stable-amd64-base.tgz has in sources.list lines with
"stable", but for backports it has "jessie-backports"! I have changed that.
sudo pbuilder --create --distribution stretch
It's creating a testing-amd64-base.tgz
pbuilder --login --distribution stable
I see it's using testing-amd64-base.tgz
I'm not sure about this; personally I use --basetgz explicitly rather
than --distribution after the initial create, so I can't really speak as
to what should happen. If you have a BASETGZ in a relevant pbuilderrc
then that may be responsible for overriding it.
Post by Paul van der Vlis
Very confusing. Is there something wrong on my system, is this a bug, or
is this normal?
With regards,
Paul
Dominic
Alex Mestiashvili
2018-09-07 11:08:12 UTC
Permalink
Post by Paul van der Vlis
mkdir /tmp/test; cd /tmp/test/
tar zxpf /var/cache/pbuilder/stable-amd64-base.tgz
nano etc/apt/sources.list
tar cfz ../stable-amd64-base.tgz .
Is this a good way?
----
I: Extracting source
/sbin/start-stop-daemon: unable to start /bin/sh (Permission denied)
E: pbuilder: Failed extracting the source
----
Not sure what this is.
What I saw, is that stable-amd64-base.tgz has in sources.list lines with
"stable", but for backports it has "jessie-backports"! I have changed that.
sudo pbuilder --create --distribution stretch
It's creating a testing-amd64-base.tgz
pbuilder --login --distribution stable
I see it's using testing-amd64-base.tgz
Very confusing. Is there something wrong on my system, is this a bug, or
is this normal?
May be it also needs the --basetgz option, don't know.
I guess these 2 links might be helpful:

- https://wiki.debian.org/cowbuilder
- https://wiki.debian.org/PbuilderTricks

Best,
Alex
Alex Mestiashvili
2018-09-07 12:29:29 UTC
Permalink
Post by Paul van der Vlis
mkdir /tmp/test; cd /tmp/test/
tar zxpf /var/cache/pbuilder/stable-amd64-base.tgz
nano etc/apt/sources.list
tar cfz ../stable-amd64-base.tgz .
Is this a good way?
----
I: Extracting source
/sbin/start-stop-daemon: unable to start /bin/sh (Permission denied)
E: pbuilder: Failed extracting the source
----
Not sure what this is.
What I saw, is that stable-amd64-base.tgz has in sources.list lines with
"stable", but for backports it has "jessie-backports"! I have changed that.
sudo pbuilder --create --distribution stretch
It's creating a testing-amd64-base.tgz
pbuilder --login --distribution stable
I see it's using testing-amd64-base.tgz
Very confusing. Is there something wrong on my system, is this a bug, or
is this normal?
Out of curiosity tried to build dh-linktree on a stretch for stretch.
Here are the steps:

Install cowbuilder and create stretch chroot:

export DISTR=stretch;cowbuilder --create --architecture amd64
--distribution ${DISTR} --basepath
/var/cache/pbuilder/base-${DISTR}-amd64.cow

mkdir pkg; cd pkg

dget -x
http://http.debian.net/debian/pool/main/d/dh-linktree/dh-linktree_0.6.dsc

export DISTR=stretch;cowbuilder build dh-linktree_0.6.dsc --architecture
amd64 --distribution ${DISTR} --basepath
/var/cache/pbuilder/base-${DISTR}-amd64.cow


pbuilder-satisfydepends-dummy : Depends: debhelper (>= 11) but it is
not going to be installed
Unable to resolve dependencies! Giving up...

Ok, doesn't work.

Let's add backports to our chroot

echo 'HOOKDIR="/var/cache/pbuilder/hook.d/"' >> /etc/pbuilderrc

mkdir /var/cache/pbuilder/hook.d/

cp /usr/share/doc/pbuilder/examples/D20addnonfree
/var/cache/pbuilder/hook.d/D20addbackports

perl -pi -e 's/sid\scontrib\snon-free/stretch-backports main/'
/var/cache/pbuilder/hook.d/D20addbackports

cat /var/cache/pbuilder/hook.d/D20addbackports
#!/bin/bash
# example file to be used with --hookdir
#
# add non-free and contrib distributions to
# /etc/apt/sources.list

echo ' Add sid non-free mirror to distribution'
echo 'deb '$(awk '/^deb / {print $2} ' < /etc/apt/sources.list | head -1
)' stretch-backports main' >> /etc/apt/sources.list
apt-get update


export DISTR=stretch;cowbuilder build dh-linktree_0.6.dsc --architecture
amd64 --distribution ${DISTR} --basepath
/var/cache/pbuilder/base-${DISTR}-amd64.cow

Seem to work
<skip>
...
<skip>

#ls -latrh /var/cache/pbuilder/result
total 44K
drwxr-xr-x 10 root root 4.0K Sep 7 08:05 ..
-rw-r--r-- 1 root root 5.9K Sep 7 08:22 dh-linktree_0.6.tar.xz
-rw-r--r-- 1 root root 636 Sep 7 08:22 dh-linktree_0.6.dsc
-rw-r--r-- 1 root root 11K Sep 7 08:22 dh-linktree_0.6_all.deb
-rw-r--r-- 1 root root 4.8K Sep 7 08:22 dh-linktree_0.6_amd64.buildinfo
-rw-r--r-- 1 root root 1.6K Sep 7 08:22 dh-linktree_0.6_amd64.changes
drwxr-xr-x 2 root root 4.0K Sep 7 08:22 .

lsb_release -a

No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch


Hope this helps!

Best,
Alex
Ben Hutchings
2018-09-07 13:12:32 UTC
Permalink
Post by Paul van der Vlis
Post by Rodrigo Campos
Post by Paul van der Vlis
Hello,
I use pbuilder for backporting packages. My problem is that a package
does not build, when there are build-dependencies from backports.
What can I do to make this work?
For example the package dh-linktree does not build, because debhelper >=
11 is needed, what's in backports. How do you backport such a package
with pbuilder?
You can modify the sources.list that the chroot uses, and just add the backports
repo
What is the correct way to modify the chroot?
[...]

As was already stated: pbuilder login --save-after-login.

However, ideally you should be able to throw away and re-create your
pbuilder environment at any time, rather than relying on manual
customisation. So your customisations should be done in a "G" hook
script.

Also, for the specific instance of adding another APT source, you can
use the --othermirror option to pbuilder create.

Ben.
--
Ben Hutchings
A free society is one where it is safe to be unpopular.
- Adlai Stevenson
Ben Hutchings
2018-09-06 23:00:56 UTC
Permalink
Post by Paul van der Vlis
Hello,
I use pbuilder for backporting packages. My problem is that a package
does not build, when there are build-dependencies from backports.
What can I do to make this work?
For example the package dh-linktree does not build, because debhelper >=
11 is needed, what's in backports. How do you backport such a package
with pbuilder?
I will add my .pbuilderrc as an attachment.
dpkg-checkbuilddeps: Unmet build dependencies: debhelper (>= 11)
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied;
aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
You need to add the APT source inside the chroot, and also set:

PBUILDERSATISFYDEPENDSCMD=/usr/lib/pbuilder/pbuilder-satisfydepends-experimental

Ben.
--
Ben Hutchings
I'm always amazed by the number of people who take up solipsism because
they heard someone else explain it. - E*Borg on alt.fan.pratchett
Paul van der Vlis
2018-09-07 14:00:21 UTC
Permalink
Post by Paul van der Vlis
Hello,
I use pbuilder for backporting packages. My problem is that a package
does not build, when there are build-dependencies from backports.
What can I do to make this work?
For example the package dh-linktree does not build, because debhelper >=
11 is needed, what's in backports. How do you backport such a package
with pbuilder?
I will add my .pbuilderrc as an attachment.
dpkg-checkbuilddeps: Unmet build dependencies: debhelper (>= 11)
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied;
aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
I've got it working now with dh-linktree.

I created a new tarball and modified it something like:
pbuilder login --save-after-login --basetgz
/var/cache/pbuilder/stable-amd64-base.tgz

I've added apt sources inside the chroot, and set:
PBUILDERSATISFYDEPENDSCMD=/usr/lib/pbuilder/pbuilder-satisfydepends-experimental

I understand hooks are better, I will try them later.

Thanks for all the help!

With regards,
Paul
--
Paul van der Vlis Linux systeembeheer Groningen
https://www.vandervlis.nl/
Loading...