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

Message ID d5688a50474525c2ef1ad209a3f73ab42745dc89.1600962590.git.jan.kiszka@siemens.com
State Superseded, archived
Headers show
Series More fixes and cleanups | expand

Commit Message

Jan Kiszka Sept. 24, 2020, 7:49 a.m. UTC
From: Jan Kiszka <jan.kiszka@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.kiszka@siemens.com>
---
 meta/recipes-devtools/buildchroot/files/deps.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Henning Schild Sept. 24, 2020, 1:32 p.m. UTC | #1
On Thu, 24 Sep 2020 17:49:50 +0200
"[ext] Jan Kiszka" <jan.kiszka@siemens.com> wrote:

> From: Jan Kiszka <jan.kiszka@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.kiszka@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

> +
>  # 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
Jan Kiszka Sept. 24, 2020, 10:21 p.m. UTC | #2
On 24.09.20 23:32, Henning Schild wrote:
> On Thu, 24 Sep 2020 17:49:50 +0200
> "[ext] Jan Kiszka" <jan.kiszka@siemens.com> wrote:
> 
>> From: Jan Kiszka <jan.kiszka@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.kiszka@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
>
Henning Schild Sept. 24, 2020, 11:02 p.m. UTC | #3
On Fri, 25 Sep 2020 08:21:25 +0200
Jan Kiszka <jan.kiszka@siemens.com> wrote:

> On 24.09.20 23:32, Henning Schild wrote:
> > On Thu, 24 Sep 2020 17:49:50 +0200
> > "[ext] Jan Kiszka" <jan.kiszka@siemens.com> wrote:
> >   
> >> From: Jan Kiszka <jan.kiszka@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.kiszka@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.

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

> 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  
> >   
> 
>

Patch

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