Re: [OE-core] [PATCH] archiver.bbclass: Fix work-shared checking for kernel recipes

2024-06-13 Thread Livius
I also tested, it works nicely for symbolic link sources (it returns the real 
path). As we see the best to use os.path.realpath() to check the source path in 
is_work_shared() function.
I will send a V2 patch soon to get it in the code.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200602): 
https://lists.openembedded.org/g/openembedded-core/message/200602
Mute This Topic: https://lists.openembedded.org/mt/106531570/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] archiver.bbclass: Fix work-shared checking for kernel recipes

2024-06-13 Thread Jose Quaresma
Jose Quaresma via lists.openembedded.org  escreveu (quarta, 12/06/2024 à(s) 10:32):

> Hi Livius,
>
> In reality, although the kernel has its code in S = "${WORKDIR}/git" it
> ends up being moved to ${STAGING_KERNEL_DIR} in the do_symlink_kernsrc
> kernel.bbclass function.
>
> https://github.com/openembedded/openembedded-core/blob/07b4c7a2bd23f8645810e13439e814caaaf9cd94/meta/classes-recipe/kernel.bbclass#L182C8-L199
>
> After this, the source S becomes a symbolic link for STAGING_KERNEL_DIR
> so I think if we check the real path following the symbolic link we solve
> the problem.
>
> - return d.getVar('S').startswith(sharedworkdir)
> + return os.path.realpath(d.getVar('S')).startswith(sharedworkdir)
>
> Could you try using os.path.realpath in S to see if it works?
>

I have tested the os.path.realpath and it fixes this issue when S is a
symbolic link pointing to STAGING_KERNEL_DIR.
I also have sent a follow up fix to meta-freescale [1] so the master branch
should work now without this change.
[1] https://github.com/Freescale/meta-freescale/pull/1843


>
> Jose
>
> Livius via lists.openembedded.org  freemail...@lists.openembedded.org> escreveu (quarta, 12/06/2024 à(s)
> 00:35):
>
>> [Edited Message Follows]
>>
>> S = "${WORKDIR}/git" does not contain "${TMPDIR}/work-shared" path,
>> therefore "def is_work_shared(d):" will be returned with False and archiver
>> is failed for linux kernel recipe (somewhy unpack is broken and kernel
>> source is missing in work-shared folder in this situation).
>> https://github.com/openembedded/bitbake/blob/master/conf/bitbake.conf#L45
>>
>> In default S = "${STAGING_KERNEL_DIR}" is the source path for a kernel.
>> Now, archiver works only in this case when it is not changed to
>> "${WORKDIR}/git" symbolic link folder. We can see
>> "bb.data.inherits_class('kernel', d)" was in the old code for checking it
>> because of this situation, when somebody like to use this kind of symbolic
>> link git source solution. This should not have been dropped in last commit.
>>
>>
>> https://github.com/openembedded/openembedded-core/commit/5fbb4ca8da4f4f1ea426275c45634802dcb5a575#diff-7a2ccc0d645ec49c87c4956f90ab24ace5292140dff665459bbc94e4e72a8e07L473
>>
>> https://github.com/openembedded/openembedded-core/blob/master/meta/classes-recipe/kernel.bbclass#L26
>>
>>
>>
>>
>>
>
> --
> Best regards,
>
> José Quaresma
>
> 
>
>

-- 
Best regards,

José Quaresma

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200598): 
https://lists.openembedded.org/g/openembedded-core/message/200598
Mute This Topic: https://lists.openembedded.org/mt/106531570/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] archiver.bbclass: Fix work-shared checking for kernel recipes

2024-06-12 Thread Jose Quaresma
Hi Livius,

In reality, although the kernel has its code in S = "${WORKDIR}/git" it
ends up being moved to ${STAGING_KERNEL_DIR} in the do_symlink_kernsrc
kernel.bbclass function.
https://github.com/openembedded/openembedded-core/blob/07b4c7a2bd23f8645810e13439e814caaaf9cd94/meta/classes-recipe/kernel.bbclass#L182C8-L199

After this, the source S becomes a symbolic link for STAGING_KERNEL_DIR
so I think if we check the real path following the symbolic link we solve
the problem.

- return d.getVar('S').startswith(sharedworkdir)
+ return os.path.realpath(d.getVar('S')).startswith(sharedworkdir)

Could you try using os.path.realpath in S to see if it works?

Jose

Livius via lists.openembedded.org  escreveu (quarta, 12/06/2024 à(s)
00:35):

> [Edited Message Follows]
>
> S = "${WORKDIR}/git" does not contain "${TMPDIR}/work-shared" path,
> therefore "def is_work_shared(d):" will be returned with False and archiver
> is failed for linux kernel recipe (somewhy unpack is broken and kernel
> source is missing in work-shared folder in this situation).
> https://github.com/openembedded/bitbake/blob/master/conf/bitbake.conf#L45
>
> In default S = "${STAGING_KERNEL_DIR}" is the source path for a kernel.
> Now, archiver works only in this case when it is not changed to
> "${WORKDIR}/git" symbolic link folder. We can see
> "bb.data.inherits_class('kernel', d)" was in the old code for checking it
> because of this situation, when somebody like to use this kind of symbolic
> link git source solution. This should not have been dropped in last commit.
>
>
> https://github.com/openembedded/openembedded-core/commit/5fbb4ca8da4f4f1ea426275c45634802dcb5a575#diff-7a2ccc0d645ec49c87c4956f90ab24ace5292140dff665459bbc94e4e72a8e07L473
>
> https://github.com/openembedded/openembedded-core/blob/master/meta/classes-recipe/kernel.bbclass#L26
>
>
> 
>
>

-- 
Best regards,

José Quaresma

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200569): 
https://lists.openembedded.org/g/openembedded-core/message/200569
Mute This Topic: https://lists.openembedded.org/mt/106531570/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] archiver.bbclass: Fix work-shared checking for kernel recipes

2024-06-11 Thread Livius
[Edited Message Follows]

S = "${WORKDIR}/git" does not contain "${TMPDIR}/work-shared" path, therefore 
"def is_work_shared(d):" will be returned with False and archiver is failed for 
linux kernel recipe (somewhy unpack is broken and kernel source is missing in 
work-shared folder in this situation).
https://github.com/openembedded/bitbake/blob/master/conf/bitbake.conf#L45

In default S = "${STAGING_KERNEL_DIR}" is the source path for a kernel. Now, 
archiver works only in this case when it is not changed to "${WORKDIR}/git" 
symbolic link folder. We can see "bb.data.inherits_class('kernel', d)" was in 
the old code for checking it because of this situation, when somebody like to 
use this kind of symbolic link git source solution. This should not have been 
dropped in last commit.

https://github.com/openembedded/openembedded-core/commit/5fbb4ca8da4f4f1ea426275c45634802dcb5a575#diff-7a2ccc0d645ec49c87c4956f90ab24ace5292140dff665459bbc94e4e72a8e07L473
https://github.com/openembedded/openembedded-core/blob/master/meta/classes-recipe/kernel.bbclass#L26


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200551): 
https://lists.openembedded.org/g/openembedded-core/message/200551
Mute This Topic: https://lists.openembedded.org/mt/106531570/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] archiver.bbclass: Fix work-shared checking for kernel recipes

2024-06-11 Thread Livius
[Edited Message Follows]

S = "${WORKDIR}/git" does not contain "${TMPDIR}/work-shared" path, therefore 
"def is_work_shared(d):" will be returned with False and archiver is failed for 
linux kernel recipe (somewhy unpack is broken and kernel source is missing in 
work-shared folder in this situation).
https://github.com/openembedded/bitbake/blob/master/conf/bitbake.conf#L45

In default S = "${STAGING_KERNEL_DIR}" is the source path for a kernel. 
Archiver works only in this case when it is not changed to "${WORKDIR}/git" 
symbolic link folder. We can see "bb.data.inherits_class('kernel', d)" was in 
the of old code for checking it because of this situation when somebody like to 
use this kind of symbolic link git source solution. This should not have been 
dropped in last commit.

https://github.com/openembedded/openembedded-core/commit/5fbb4ca8da4f4f1ea426275c45634802dcb5a575#diff-7a2ccc0d645ec49c87c4956f90ab24ace5292140dff665459bbc94e4e72a8e07L473
https://github.com/openembedded/openembedded-core/blob/master/meta/classes-recipe/kernel.bbclass#L26


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200551): 
https://lists.openembedded.org/g/openembedded-core/message/200551
Mute This Topic: https://lists.openembedded.org/mt/106531570/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] archiver.bbclass: Fix work-shared checking for kernel recipes

2024-06-11 Thread Livius
[Edited Message Follows]

S = "${WORKDIR}/git" does not contain "${TOPDIR}/work-shared" path, therefore 
"def is_work_shared(d):" will be returned with False and archiver is failed for 
linux kernel recipe (somewhy unpack is broken and kernel source is missing in 
work-shared folder in this situation).
https://github.com/openembedded/bitbake/blob/master/conf/bitbake.conf#L45

In default S = "${STAGING_KERNEL_DIR}" is the source path for a kernel. 
Archiver works only in this case when it is not changed to "${WORKDIR}/git" 
symbolic link folder. We can see "bb.data.inherits_class('kernel', d)" was in 
the of old code for checking it because of this situation when somebody like to 
use this kind of symbolic link git source solution. This should not have been 
dropped in last commit.

https://github.com/openembedded/openembedded-core/commit/5fbb4ca8da4f4f1ea426275c45634802dcb5a575#diff-7a2ccc0d645ec49c87c4956f90ab24ace5292140dff665459bbc94e4e72a8e07L473
https://github.com/openembedded/openembedded-core/blob/master/meta/classes-recipe/kernel.bbclass#L26


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200551): 
https://lists.openembedded.org/g/openembedded-core/message/200551
Mute This Topic: https://lists.openembedded.org/mt/106531570/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] archiver.bbclass: Fix work-shared checking for kernel recipes

2024-06-11 Thread Livius
S = "${WORKDIR}/git" does not contain "${TOPDIR}/work-shared" path, therefore 
"def is_work_shared(d):" will be returned with False and archiver is failed for 
linux kernel recipe (somewhy unpack is broken and kernel source is missing in 
work-shared folder in this situation).
https://github.com/openembedded/bitbake/blob/master/conf/bitbake.conf#L45

In default S = "${STAGING_KERNEL_DIR}" is the source path for a kernel. 
Archiver works only in this case when it is not changed to "${WORKDIR}/git" 
symbolic link folder. We can see "bb.data.inherits_class('kernel', d)" was in 
the of old code for checking it because of this situation when somebody like to 
use this kind of symbolic link git source solution. This should not have been 
dropped in last commit.
https://github.com/openembedded/openembedded-core/blob/master/meta/classes-recipe/kernel.bbclass#L26


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200551): 
https://lists.openembedded.org/g/openembedded-core/message/200551
Mute This Topic: https://lists.openembedded.org/mt/106531570/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] archiver.bbclass: Fix work-shared checking for kernel recipes

2024-06-11 Thread Ross Burton
On 6 Jun 2024, at 21:48, Livius via lists.openembedded.org 
 wrote:
> 
> From: Benjamin Szőke 
> 
> Restore to use checking inherited kernel class, because it possible
> that some BSP's linux kernel recipe (like linux-fslc in meta-freescale)
> change source dir to S = "${WORKDIR}/git" symbolic link and in this
> case work-shared checking is failed for kernel recipe.

If S is $WORKDIR/git, is it still a shared work directory though?  Can you 
explain further what the failure case is and what the solution is please.

Ross
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200505): 
https://lists.openembedded.org/g/openembedded-core/message/200505
Mute This Topic: https://lists.openembedded.org/mt/106531570/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] archiver.bbclass: Fix work-shared checking for kernel recipes

2024-06-06 Thread Livius
From: Benjamin Szőke 

Restore to use checking inherited kernel class, because it possible
that some BSP's linux kernel recipe (like linux-fslc in meta-freescale)
change source dir to S = "${WORKDIR}/git" symbolic link and in this
case work-shared checking is failed for kernel recipe.

Signed-off-by: Benjamin Szőke 
---
 meta/classes/archiver.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 2d0bbfbd42..fa285a1c10 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -473,7 +473,7 @@ def create_diff_gz(d, src_orig, src, ar_outdir):
 
 def is_work_shared(d):
 sharedworkdir = os.path.join(d.getVar('TMPDIR'), 'work-shared')
-return d.getVar('S').startswith(sharedworkdir)
+return d.getVar('S').startswith(sharedworkdir) or 
bb.data.inherits_class('kernel', d)
 
 # Run do_unpack and do_patch
 python do_unpack_and_patch() {
-- 
2.45.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200417): 
https://lists.openembedded.org/g/openembedded-core/message/200417
Mute This Topic: https://lists.openembedded.org/mt/106531570/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-