diff mbox series

[meta-swupdate] swupdate: fix DESTDIR

Message ID 20220222085716.11602-1-ceggers@arri.de
State Rejected
Headers show
Series [meta-swupdate] swupdate: fix DESTDIR | expand

Commit Message

Christian Eggers Feb. 22, 2022, 8:57 a.m. UTC
DESTDIR must include ${base_prefix} which is set differently for
nativesdk. LIBDIR must not be set as ${libdir} includes ${base_prefix},
so this will be applied twice.

Signed-off-by: Christian Eggers <ceggers@arri.de>
---
 recipes-support/swupdate/swupdate.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic Feb. 22, 2022, 2:31 p.m. UTC | #1
Hi Christian,

On 22.02.22 09:57, Christian Eggers wrote:
> DESTDIR must include ${base_prefix} which is set differently for
> nativesdk.

So do you want to have a native-swupdate ? Which is the goal, maybe to 
let it check the SWU (with -c) before deploying ?

> LIBDIR must not be set as ${libdir} includes ${base_prefix},

libdir is set, but LIBDIR not...

> so this will be applied twice.
> 

> Signed-off-by: Christian Eggers <ceggers@arri.de>
> ---
>   recipes-support/swupdate/swupdate.inc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
> index fa548d639f40..7578449ca9f5 100644
> --- a/recipes-support/swupdate/swupdate.inc
> +++ b/recipes-support/swupdate/swupdate.inc
> @@ -91,7 +91,7 @@ RDEPENDS:${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \
>   S = "${WORKDIR}/git"
>   B = "${WORKDIR}/build"
>   
> -EXTRA_OEMAKE += " O=${B} HOSTCC="${BUILD_CC}" HOSTCXX="${BUILD_CXX}" LD="${CC}" DESTDIR="${D}" LIBDIR="${libdir}" V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
> +EXTRA_OEMAKE += " O=${B} HOSTCC="${BUILD_CC}" HOSTCXX="${BUILD_CXX}" LD="${CC}" DESTDIR="${D}${base_prefix}" V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"

I cannot confirm this and I guess your patch creates issues in case of 
multiconfig. If we drop LIBDIR, it installs in /usr/lib, but this is for 
aarch64 and x86 wrong if via multiconfig a lib32 is on.

In SWUpdate's Makefile :

  BINDIR ?= /usr/bin
  LIBDIR ?= /usr/lib
  INCLUDEDIR ?= /usr/include

No problem for include and bin, but I need to set LIBDIR for some 
architecture and I do not see issues with current TOT (and in all 
supported OE releases).


Best regards,
Stefano Babic
Christian Eggers Feb. 22, 2022, 6:21 p.m. UTC | #2
Hi Stefano,

On Tuesday, 22 February 2022, 15:31:04 CET, Stefano Babic wrote:
> Hi Christian,
> 
> On 22.02.22 09:57, Christian Eggers wrote:
> > DESTDIR must include ${base_prefix} which is set differently for
> > nativesdk.
> 
> So do you want to have a native-swupdate ? Which is the goal, maybe to 
> let it check the SWU (with -c) before deploying ?

Sorry for not explaining the use case of my patch.

We build our embedded application for two platforms:
- Embedded system (ARM)
- PC (x86_64)

As the x86_64 software from our host distribution is incomplete/outdated,
we use the Yocto nativesdk for building (I think that this isn't the
primary use case of the nativesdk, but it works fine and saves me from
using two SDKs).

> 
> > LIBDIR must not be set as ${libdir} includes ${base_prefix},
> 
> libdir is set, but LIBDIR not...
Without my patch, LIBDIR is forced in EXTRA_OECMAKE. After DESTDIR
is set "correctly" (including ${base_prefix}), LIBDIR must be kept
as its default value.

The easiest way to test this is to extend swupdate.bb to nativesdk:

BBCLASSEXTEND = "nativesdk"


> 
> > so this will be applied twice.
> > 
> 
> > Signed-off-by: Christian Eggers <ceggers@arri.de>
> > ---
> >   recipes-support/swupdate/swupdate.inc | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
> > index fa548d639f40..7578449ca9f5 100644
> > --- a/recipes-support/swupdate/swupdate.inc
> > +++ b/recipes-support/swupdate/swupdate.inc
> > @@ -91,7 +91,7 @@ RDEPENDS:${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \
> >   S = "${WORKDIR}/git"
> >   B = "${WORKDIR}/build"
> >   
> > -EXTRA_OEMAKE += " O=${B} HOSTCC="${BUILD_CC}" HOSTCXX="${BUILD_CXX}" LD="${CC}" DESTDIR="${D}" LIBDIR="${libdir}" V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
> > +EXTRA_OEMAKE += " O=${B} HOSTCC="${BUILD_CC}" HOSTCXX="${BUILD_CXX}" LD="${CC}" DESTDIR="${D}${base_prefix}" V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
> 
> I cannot confirm this and I guess your patch creates issues in case of 
> multiconfig. If we drop LIBDIR, it installs in /usr/lib, but this is for 
> aarch64 and x86 wrong if via multiconfig a lib32 is on.
> 
> In SWUpdate's Makefile :
> 
>   BINDIR ?= /usr/bin
>   LIBDIR ?= /usr/lib
>   INCLUDEDIR ?= /usr/include
> 
> No problem for include and bin, but I need to set LIBDIR for some 
> architecture and I do not see issues with current TOT (and in all 
> supported OE releases)

ok, I understand. So we need a solution which works for both,
multiconfig and nativesdk...

regards
Christian
Stefano Babic Feb. 22, 2022, 9:51 p.m. UTC | #3
Hi Christian,

On 22.02.22 19:21, Christian Eggers wrote:
> Hi Stefano,
> 
> On Tuesday, 22 February 2022, 15:31:04 CET, Stefano Babic wrote:
>> Hi Christian,
>>
>> On 22.02.22 09:57, Christian Eggers wrote:
>>> DESTDIR must include ${base_prefix} which is set differently for
>>> nativesdk.
>>
>> So do you want to have a native-swupdate ? Which is the goal, maybe to
>> let it check the SWU (with -c) before deploying ?
> 
> Sorry for not explaining the use case of my patch.
> 
> We build our embedded application for two platforms:
> - Embedded system (ARM)
> - PC (x86_64)
> 

Ok

So you have not multilib-32, that should break with your patch.

> As the x86_64 software from our host distribution is incomplete/outdated,
> we use the Yocto nativesdk for building (I think that this isn't the
> primary use case of the nativesdk, but it works fine and saves me from
> using two SDKs).

Yes, it just works because mative and target share the same 
architecture. nativesdk is not really thought for this use case.

> 
>>
>>> LIBDIR must not be set as ${libdir} includes ${base_prefix},
>>
>> libdir is set, but LIBDIR not...
> Without my patch, LIBDIR is forced in EXTRA_OECMAKE. After DESTDIR
> is set "correctly" (including ${base_prefix}), LIBDIR must be kept
> as its default value.

But this is /usr/lib, and that breaks in case of multilib. Just tested 
your patch on one project of mine, x86_64 + multilib-32:



ERROR: swupdate-2021.11-r0 do_package: QA Issue: swupdate: 
Files/directories were installed but not shipped in any package:

   /usr/lib/libswupdate.so.0.1

   /usr/lib/libswupdate.so

   /usr/lib/lua/5.3/lua_swupdate.so

   /usr/lib/lua/5.3/lua_swupdate.so.0.1

Please set FILES such that these items are packaged. Alternatively if 
they are unneeded, avoid installing them or delete them within do_install.

swupdate: 4 installed and not shipped files. [installed-vs-shipped]



but this is expected as LIBDIR is not set anymore by OE.

I do not know what you mean as default, except that this is set to 
/usr/lib in case no multiconfig is set (with arm or just x86_64).

> 
> The easiest way to test this is to extend swupdate.bb to nativesdk:
> 
> BBCLASSEXTEND = "nativesdk"

But to build SWUpdate as nativesdk, the libraries used by SWUpdate 
should have a nativesdk package, too. If I just add BBCLASSEXTEND and 
try to build, I get:

$ bitbake  nativesdk-swupdate

NOTE: Resolving any missing task queue dependencies

ERROR: Nothing PROVIDES 'nativesdk-libconfig' (but 
virtual:nativesdk:/media/sdc1-1TB/work/vitestro/meta-swupdate/recipes-support/swupdate/swupdate_2021.11.bb 
DEPENDS on or otherwise requires it). Close matches:

   nativesdk-libdnf

   nativesdk-libffi

   nativesdk-libpng


but it is expected, too, because there is no nativesdk-libconfig.

Best regards,
Stefano Babic

> 
> 
>>
>>> so this will be applied twice.
>>>
>>
>>> Signed-off-by: Christian Eggers <ceggers@arri.de>
>>> ---
>>>    recipes-support/swupdate/swupdate.inc | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
>>> index fa548d639f40..7578449ca9f5 100644
>>> --- a/recipes-support/swupdate/swupdate.inc
>>> +++ b/recipes-support/swupdate/swupdate.inc
>>> @@ -91,7 +91,7 @@ RDEPENDS:${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \
>>>    S = "${WORKDIR}/git"
>>>    B = "${WORKDIR}/build"
>>>    
>>> -EXTRA_OEMAKE += " O=${B} HOSTCC="${BUILD_CC}" HOSTCXX="${BUILD_CXX}" LD="${CC}" DESTDIR="${D}" LIBDIR="${libdir}" V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
>>> +EXTRA_OEMAKE += " O=${B} HOSTCC="${BUILD_CC}" HOSTCXX="${BUILD_CXX}" LD="${CC}" DESTDIR="${D}${base_prefix}" V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
>>
>> I cannot confirm this and I guess your patch creates issues in case of
>> multiconfig. If we drop LIBDIR, it installs in /usr/lib, but this is for
>> aarch64 and x86 wrong if via multiconfig a lib32 is on.
>>
>> In SWUpdate's Makefile :
>>
>>    BINDIR ?= /usr/bin
>>    LIBDIR ?= /usr/lib
>>    INCLUDEDIR ?= /usr/include
>>
>> No problem for include and bin, but I need to set LIBDIR for some
>> architecture and I do not see issues with current TOT (and in all
>> supported OE releases)
> 
> ok, I understand. So we need a solution which works for both,
> multiconfig and nativesdk...
> 
> regards
> Christian
> 
> 
>
diff mbox series

Patch

diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
index fa548d639f40..7578449ca9f5 100644
--- a/recipes-support/swupdate/swupdate.inc
+++ b/recipes-support/swupdate/swupdate.inc
@@ -91,7 +91,7 @@  RDEPENDS:${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \
 S = "${WORKDIR}/git"
 B = "${WORKDIR}/build"
 
-EXTRA_OEMAKE += " O=${B} HOSTCC="${BUILD_CC}" HOSTCXX="${BUILD_CXX}" LD="${CC}" DESTDIR="${D}" LIBDIR="${libdir}" V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
+EXTRA_OEMAKE += " O=${B} HOSTCC="${BUILD_CC}" HOSTCXX="${BUILD_CXX}" LD="${CC}" DESTDIR="${D}${base_prefix}" V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
 
 DEPENDS += "kern-tools-native"