diff mbox series

[meta-multimedia] libcamera: Avoid build break in signature recalculation

Message ID 20231002173644.3284604-1-tom.hochstein@nxp.com
State Under Review
Headers show
Series [meta-multimedia] libcamera: Avoid build break in signature recalculation | expand

Commit Message

Tom Hochstein Oct. 2, 2023, 5:36 p.m. UTC
The signature recalculation task can fail:
```
/.../build/tmp/work/armv8a-poky-linux/libcamera/1_0.0.4-r0/temp/run.do_recalculate_ipa_signatures_package.937421: line 154: /.../build/tmp/work/armv8a-poky-linux/libcamera/1_0.0.4-r0/git/src/ipa/ipa-sign-install.sh: No such file or directory
```

This happens whenever ${S} is removed and packages are retrieved from
sstate cache.

Instead of trying to fix the task, avoid the issue altogether by
performing the signature recalculation directly in do_package.

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
---
 .../recipes-multimedia/libcamera/libcamera_0.1.0.bb        | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Kieran Bingham Oct. 3, 2023, 9:29 a.m. UTC | #1
Quoting Tom Hochstein (2023-10-02 18:36:44)
> The signature recalculation task can fail:
> ```
> /.../build/tmp/work/armv8a-poky-linux/libcamera/1_0.0.4-r0/temp/run.do_recalculate_ipa_signatures_package.937421: line 154: /.../build/tmp/work/armv8a-poky-linux/libcamera/1_0.0.4-r0/git/src/ipa/ipa-sign-install.sh: No such file or directory
> ```
> 
> This happens whenever ${S} is removed and packages are retrieved from
> sstate cache.
> 
> Instead of trying to fix the task, avoid the issue altogether by
> performing the signature recalculation directly in do_package.

Will this still happen after any calls to strip? (i.e. the binaries will
not be modified after this step?)

--
Kieran


> 
> Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
> ---
>  .../recipes-multimedia/libcamera/libcamera_0.1.0.bb        | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
> index ece1be6f3..2a3c6473e 100644
> --- a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
> +++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
> @@ -50,8 +50,11 @@ do_install:append() {
>      chrpath -d ${D}${libexecdir}/libcamera/v4l2-compat.so
>  }
>  
> -addtask do_recalculate_ipa_signatures_package after do_package before do_packagedata
> -do_recalculate_ipa_signatures_package() {
> +do_package:append() {
> +    bb.build.exec_func("do_package_recalculate_ipa_signatures", d)
> +}
> +
> +do_package_recalculate_ipa_signatures() {
>      local modules
>      for module in $(find ${PKGD}/usr/lib/libcamera -name "*.so.sign"); do
>          module="${module%.sign}"
> -- 
> 2.25.1
> 
>
Tom Hochstein Oct. 3, 2023, 1:38 p.m. UTC | #2
> -----Original Message-----
> From: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Sent: Tuesday, October 3, 2023 4:29 AM
> To: Tom Hochstein <tom.hochstein@nxp.com>; openembedded-
> devel@lists.openembedded.org
> Cc: Tom Hochstein <tom.hochstein@nxp.com>
> Subject: Re: [meta-multimedia][PATCH] libcamera: Avoid build break in
> signature recalculation
> 
> Quoting Tom Hochstein (2023-10-02 18:36:44)
> > The signature recalculation task can fail:
> > ```
> > /.../build/tmp/work/armv8a-poky-linux/libcamera/1_0.0.4-
> r0/temp/run.do_recalculate_ipa_signatures_package.937421: line 154:
> /.../build/tmp/work/armv8a-poky-linux/libcamera/1_0.0.4-
> r0/git/src/ipa/ipa-sign-install.sh: No such file or directory
> > ```
> >
> > This happens whenever ${S} is removed and packages are retrieved from
> > sstate cache.
> >
> > Instead of trying to fix the task, avoid the issue altogether by
> > performing the signature recalculation directly in do_package.
> 
> Will this still happen after any calls to strip? (i.e. the binaries will
> not be modified after this step?)

Yes. The run.do_package script does have the recalculation call as the
final line in the do_package function, which is after the call to
split_and_strip.

> 
> --
> Kieran
> 
> 
> >
> > Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
> > ---
> >  .../recipes-multimedia/libcamera/libcamera_0.1.0.bb        | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta-multimedia/recipes-
> multimedia/libcamera/libcamera_0.1.0.bb b/meta-multimedia/recipes-
> multimedia/libcamera/libcamera_0.1.0.bb
> > index ece1be6f3..2a3c6473e 100644
> > --- a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
> > +++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
> > @@ -50,8 +50,11 @@ do_install:append() {
> >      chrpath -d ${D}${libexecdir}/libcamera/v4l2-compat.so
> >  }
> >
> > -addtask do_recalculate_ipa_signatures_package after do_package before
> do_packagedata
> > -do_recalculate_ipa_signatures_package() {
> > +do_package:append() {
> > +    bb.build.exec_func("do_package_recalculate_ipa_signatures", d)
> > +}
> > +
> > +do_package_recalculate_ipa_signatures() {
> >      local modules
> >      for module in $(find ${PKGD}/usr/lib/libcamera -name "*.so.sign"); do
> >          module="${module%.sign}"
> > --
> > 2.25.1
> >
> >
Kieran Bingham Oct. 3, 2023, 4:09 p.m. UTC | #3
Quoting Tom Hochstein (2023-10-03 14:38:41)
> 
> 
> > -----Original Message-----
> > From: Kieran Bingham <kieran.bingham@ideasonboard.com>
> > Sent: Tuesday, October 3, 2023 4:29 AM
> > To: Tom Hochstein <tom.hochstein@nxp.com>; openembedded-
> > devel@lists.openembedded.org
> > Cc: Tom Hochstein <tom.hochstein@nxp.com>
> > Subject: Re: [meta-multimedia][PATCH] libcamera: Avoid build break in
> > signature recalculation
> > 
> > Quoting Tom Hochstein (2023-10-02 18:36:44)
> > > The signature recalculation task can fail:
> > > ```
> > > /.../build/tmp/work/armv8a-poky-linux/libcamera/1_0.0.4-
> > r0/temp/run.do_recalculate_ipa_signatures_package.937421: line 154:
> > /.../build/tmp/work/armv8a-poky-linux/libcamera/1_0.0.4-
> > r0/git/src/ipa/ipa-sign-install.sh: No such file or directory
> > > ```
> > >
> > > This happens whenever ${S} is removed and packages are retrieved from
> > > sstate cache.
> > >
> > > Instead of trying to fix the task, avoid the issue altogether by
> > > performing the signature recalculation directly in do_package.
> > 
> > Will this still happen after any calls to strip? (i.e. the binaries will
> > not be modified after this step?)
> 
> Yes. The run.do_package script does have the recalculation call as the
> final line in the do_package function, which is after the call to
> split_and_strip.

That settles my worries then! - I'm not sure I'm expert enough on the
rest of the yocto syntax, but from libcamera perspective:

Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> > 
> > --
> > Kieran
> > 
> > 
> > >
> > > Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
> > > ---
> > >  .../recipes-multimedia/libcamera/libcamera_0.1.0.bb        | 7 +++++--
> > >  1 file changed, 5 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/meta-multimedia/recipes-
> > multimedia/libcamera/libcamera_0.1.0.bb b/meta-multimedia/recipes-
> > multimedia/libcamera/libcamera_0.1.0.bb
> > > index ece1be6f3..2a3c6473e 100644
> > > --- a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
> > > +++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
> > > @@ -50,8 +50,11 @@ do_install:append() {
> > >      chrpath -d ${D}${libexecdir}/libcamera/v4l2-compat.so
> > >  }
> > >
> > > -addtask do_recalculate_ipa_signatures_package after do_package before
> > do_packagedata
> > > -do_recalculate_ipa_signatures_package() {
> > > +do_package:append() {
> > > +    bb.build.exec_func("do_package_recalculate_ipa_signatures", d)
> > > +}
> > > +
> > > +do_package_recalculate_ipa_signatures() {
> > >      local modules
> > >      for module in $(find ${PKGD}/usr/lib/libcamera -name "*.so.sign"); do
> > >          module="${module%.sign}"
> > > --
> > > 2.25.1
> > >
> > >
diff mbox series

Patch

diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
index ece1be6f3..2a3c6473e 100644
--- a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
+++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
@@ -50,8 +50,11 @@  do_install:append() {
     chrpath -d ${D}${libexecdir}/libcamera/v4l2-compat.so
 }
 
-addtask do_recalculate_ipa_signatures_package after do_package before do_packagedata
-do_recalculate_ipa_signatures_package() {
+do_package:append() {
+    bb.build.exec_func("do_package_recalculate_ipa_signatures", d)
+}
+
+do_package_recalculate_ipa_signatures() {
     local modules
     for module in $(find ${PKGD}/usr/lib/libcamera -name "*.so.sign"); do
         module="${module%.sign}"