[PATCH 4/5] dpkg: Account for changes in mk-build-deps in bullseye

9 views
Skip to first unread message

Jan Kiszka

unread,
Sep 24, 2020, 11:49:54 AM9/24/20
to isar-users
From: Jan Kiszka <jan.k...@siemens.com>

In bullseye, mk-build-deps now emits two log files. When rebuilding
debian packages, those files end up in ${S} and will be recognized by
the package build as deviation from the source file. Avoid this failure
by stepping out of ${S} before calling mk-build-deps.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---
meta/recipes-devtools/buildchroot/files/deps.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/buildchroot/files/deps.sh b/meta/recipes-devtools/buildchroot/files/deps.sh
index 93bc9cf5..1d617bc8 100644
--- a/meta/recipes-devtools/buildchroot/files/deps.sh
+++ b/meta/recipes-devtools/buildchroot/files/deps.sh
@@ -33,17 +33,20 @@ if ! grep "^Architecture:" debian/control | grep -qv "all"; then
set_arch=""
fi

+control_file=$(pwd)/debian/control
+cd ..
+
# Install all build deps
if [ "$3" = "--download-only" ]; then
# this will not return 0 even when it worked
- mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control &> \
+ mk-build-deps $set_arch -t "${install_cmd}" -i -r $control_file &> \
mk-build-deps.output || true
cat mk-build-deps.output
# we assume success when we find this
grep "mk-build-deps: Unable to install all build-dep packages" mk-build-deps.output
rm -f mk-build-deps.output
else
- mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control
+ mk-build-deps $set_arch -t "${install_cmd}" -i -r $control_file

# Upgrade any already installed packages in case we are partially rebuilding
apt-get upgrade -y --allow-downgrades
--
2.26.2

Henning Schild

unread,
Sep 24, 2020, 5:32:14 PM9/24/20
to [ext] Jan Kiszka, isar-users
On Thu, 24 Sep 2020 17:49:50 +0200
"[ext] Jan Kiszka" <jan.k...@siemens.com> wrote:

> From: Jan Kiszka <jan.k...@siemens.com>
>
> In bullseye, mk-build-deps now emits two log files. When rebuilding
> debian packages, those files end up in ${S} and will be recognized by
> the package build as deviation from the source file. Avoid this
> failure by stepping out of ${S} before calling mk-build-deps.
>
> Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
> ---
> meta/recipes-devtools/buildchroot/files/deps.sh | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-devtools/buildchroot/files/deps.sh
> b/meta/recipes-devtools/buildchroot/files/deps.sh index
> 93bc9cf5..1d617bc8 100644 ---
> a/meta/recipes-devtools/buildchroot/files/deps.sh +++
> b/meta/recipes-devtools/buildchroot/files/deps.sh @@ -33,17 +33,20 @@
> if ! grep "^Architecture:" debian/control | grep -qv "all"; then
> set_arch="" fi
>
> +control_file=$(pwd)/debian/control
> +cd ..

Would it be a good idea to make this absolute instead of relative? Or
maybe we can make mk-build-deps place those temporary files somewhere
else?

Changing the working directory somewhere inbetween can be pretty
confusing when extending later.

Henning

Jan Kiszka

unread,
Sep 25, 2020, 2:21:27 AM9/25/20
to Henning Schild, isar-users
On 24.09.20 23:32, Henning Schild wrote:
> On Thu, 24 Sep 2020 17:49:50 +0200
> "[ext] Jan Kiszka" <jan.k...@siemens.com> wrote:
>
>> From: Jan Kiszka <jan.k...@siemens.com>
>>
>> In bullseye, mk-build-deps now emits two log files. When rebuilding
>> debian packages, those files end up in ${S} and will be recognized by
>> the package build as deviation from the source file. Avoid this
>> failure by stepping out of ${S} before calling mk-build-deps.
>>
>> Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
>> ---
>> meta/recipes-devtools/buildchroot/files/deps.sh | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-devtools/buildchroot/files/deps.sh
>> b/meta/recipes-devtools/buildchroot/files/deps.sh index
>> 93bc9cf5..1d617bc8 100644 ---
>> a/meta/recipes-devtools/buildchroot/files/deps.sh +++
>> b/meta/recipes-devtools/buildchroot/files/deps.sh @@ -33,17 +33,20 @@
>> if ! grep "^Architecture:" debian/control | grep -qv "all"; then
>> set_arch="" fi
>>
>> +control_file=$(pwd)/debian/control
>> +cd ..
>
> Would it be a good idea to make this absolute instead of relative? Or
> maybe we can make mk-build-deps place those temporary files somewhere
> else?

The latter was my first thought as well (or some switch to suppress it),
but I found nothing in the mk-build-deps manual.

The former depends on a good suggestion for a path. Would possibly mean
refactoring the interface of this script, passing in ${PP} and ${PPS}
separately. Would that be better?

Jan

>
> Changing the working directory somewhere inbetween can be pretty
> confusing when extending later.
>
> Henning
>
>> +
>> # Install all build deps
>> if [ "$3" = "--download-only" ]; then
>> # this will not return 0 even when it worked
>> - mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control
>> &> \
>> + mk-build-deps $set_arch -t "${install_cmd}" -i -r $control_file
>> &> \ mk-build-deps.output || true
>> cat mk-build-deps.output
>> # we assume success when we find this
>> grep "mk-build-deps: Unable to install all build-dep packages"
>> mk-build-deps.output rm -f mk-build-deps.output
>> else
>> - mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control
>> + mk-build-deps $set_arch -t "${install_cmd}" -i -r $control_file
>>
>> # Upgrade any already installed packages in case we are
>> partially rebuilding apt-get upgrade -y --allow-downgrades
>


--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

Henning Schild

unread,
Sep 25, 2020, 3:02:56 AM9/25/20
to Jan Kiszka, isar-users
Well whatever these logs say, we probably want them somewhere under
WORKDIR for debugging outside of the chroot.

> The former depends on a good suggestion for a path. Would possibly
> mean refactoring the interface of this script, passing in ${PP} and
> ${PPS} separately. Would that be better?

I do not feel strong about it and it can probably stay the way it is.

We are covered by conventions and from S (PPS) .. means WORKDIR (PP).

Henning
Reply all
Reply to author
Forward
0 new messages