[OE-core] [PATCH] rootfs.py: check depmodwrapper execution result

2024-01-09 Thread Yang Xu via lists.openembedded.org
From: Yang Xu 

The execution result of depmodwrapper is not checked which makes depmod
generation failed sliently and hard to detect.

So check exection result and stop building if depmodwrapper failed.

Signed-off-by: Yang Xu 
---
 meta/lib/oe/rootfs.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 1a48ed10b3..3f27164536 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -349,7 +349,8 @@ class Rootfs(object, metaclass=ABCMeta):
 bb.utils.mkdirhier(versioned_modules_dir)
 
 bb.note("Running depmodwrapper for %s ..." % versioned_modules_dir)
-self._exec_shell_cmd(['depmodwrapper', '-a', '-b', 
self.image_rootfs, kernel_ver, kernel_package_name])
+if self._exec_shell_cmd(['depmodwrapper', '-a', '-b', 
self.image_rootfs, kernel_ver, kernel_package_name]):
+bb.fatal("Kernel modules dependency generation failed")
 
 """
 Create devfs:
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#193451): 
https://lists.openembedded.org/g/openembedded-core/message/193451
Mute This Topic: https://lists.openembedded.org/mt/103617576/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] meson: don't fail if no .pyc exists

2023-09-06 Thread Yang Xu via lists.openembedded.org
From: Yang Xu 

If PYTHONDONTWRITEBYTECODE set to 1, do_install:append will fail because
no .pyc is removed.

Add -f flag to prevent command fail.

Signed-off-by: Yang Xu 
---
 meta/recipes-devtools/meson/meson_1.1.1.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/meson/meson_1.1.1.bb 
b/meta/recipes-devtools/meson/meson_1.1.1.bb
index 500e13775f..dd97f93aef 100644
--- a/meta/recipes-devtools/meson/meson_1.1.1.bb
+++ b/meta/recipes-devtools/meson/meson_1.1.1.bb
@@ -30,7 +30,7 @@ do_install:append () {
# Upstream is discussing ways to solve the issue properly, until then 
let's
# just not install the problematic files.
# More info: http://benno.id.au/blog/2013/01/15/python-determinism
-   rm 
${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython*
+   rm -f 
${D}${libdir}/python*/site-packages/mesonbuild/dependencies/__pycache__/mpi.cpython*
 }
 
 BBCLASSEXTEND = "native nativesdk"
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#187291): 
https://lists.openembedded.org/g/openembedded-core/message/187291
Mute This Topic: https://lists.openembedded.org/mt/101190165/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 v4] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-08-08 Thread Yang Xu via lists.openembedded.org
I got it, thank you :)

Yang

On Tue, 2023-08-08 at 11:39 +0100, Richard Purdie wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  
> On Tue, 2023-08-08 at 10:15 +, Yang Xu (徐扬) wrote:
> > It is a elegant solution for current issue. I will test and update
> my
> > patch to only include testcase part soon.
> > 
> > Thank you
> 
> I did end up tweaking your patch to this:
> 
> 
https://git.yoctoproject.org/poky/commit/?h=master-next&id=3a79452507846756f6d78cab4dc4adafa0cb2be7
> 
> Cheers,
> 
> Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#185659): 
https://lists.openembedded.org/g/openembedded-core/message/185659
Mute This Topic: https://lists.openembedded.org/mt/100113209/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 v4] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-08-08 Thread Yang Xu via lists.openembedded.org
It is a elegant solution for current issue. I will test and update my
patch to only include testcase part soon.

Thank you

Yang

On Sat, 2023-08-05 at 11:36 +0100, Richard Purdie wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  
> On Fri, 2023-08-04 at 17:13 +0100, Richard Purdie via
> lists.openembedded.org wrote:
> > On Thu, 2023-07-13 at 02:16 +, Yang Xu via
> lists.openembedded.org
> > wrote:
> > > From: Yang Xu 
> > > 
> > > The `bb.siggen.compare_sigfiles` method transforms the key format
> from
> > > `[mc::][virtual:][native:]:` to
> > > `/ name>:[:virtual][:native][:mc:]`
> > > by `clean_basepaths`. However, `find_siginfo` uses the original
> format
> > > to get the package name (pn) and task name.
> > > 
> > > This commit corrects the method for deriving the pn and task name
> in
> > > `find_siginfo` and adds handling for multilib name.
> > > And add test for compare_sigfiles and find_siginfo working
> together.
> > > 
> > > Signed-off-by: Yang Xu 
> > > ---
> > > 
> > > Notes:
> > > v1: correct handling for pn and taskname for native target in
> find_siginfo
> > > v2: add handling for multilib target in find_siginfo
> > > v3: add testcase for compare_sigfiles and find_siginfo work
> together.
> > > v4: optimize testcase to avoid non-deterministic fail
> > > 
> > >  .../recipes-test/binutils/binutils_%.bbappend |  2 +
> > >  meta/lib/oe/sstatesig.py  | 17 ++--
> > >  meta/lib/oeqa/selftest/cases/sstatetests.py   | 83
> +++
> > >  3 files changed, 97 insertions(+), 5 deletions(-)
> > >  create mode 100644 meta-selftest/recipes-
> test/binutils/binutils_%.bbappend
> > > 
> > > diff --git a/meta-selftest/recipes-
> test/binutils/binutils_%.bbappend b/meta-selftest/recipes-
> test/binutils/binutils_%.bbappend
> > > new file mode 100644
> > > index 00..205720982c
> > > --- /dev/null
> > > +++ b/meta-selftest/recipes-test/binutils/binutils_%.bbappend
> > > @@ -0,0 +1,2 @@
> > > +# This bbappend is used to alter the recipe using the
> test_recipe.inc file created by tests.
> > > +include test_recipe.inc
> > > diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
> > > index f943df181e..f041a0c430 100644
> > > --- a/meta/lib/oe/sstatesig.py
> > > +++ b/meta/lib/oe/sstatesig.py
> > > @@ -321,11 +321,18 @@ def find_siginfo(pn, taskname,
> taskhashlist, d):
> > >  if not taskname:
> > >  # We have to derive pn and taskname
> > >  key = pn
> > > -splitit = key.split('.bb:')
> > > -taskname = splitit[1]
> > > -pn = os.path.basename(splitit[0]).split('_')[0]
> > > -if key.startswith('virtual:native:'):
> > > -pn = pn + '-native'
> > > +if key.count(':') >= 2:
> > > +splitit, taskname, affix = key.split(':', 2)
> > > +else:
> > > +splitit, taskname = key.split(':', 1)
> > > +affix = ''
> > > +pn =
> os.path.splitext(os.path.basename(splitit))[0].split('_')[0]
> > > +affixitems = affix.split(':')
> > > +if affixitems[0] == 'virtual':
> > > +if affixitems[1] == 'native':
> > > +pn = pn + '-native'
> > > +if affixitems[1] == 'multilib':
> > > +pn = affixitems[2] + '-' + pn
> > >  
> > >  hashfiles = {}
> > >  filedates = {}
> > 
> > 
> > I've stared at this patch long and hard and I'm coming to the
> > conclusion that whilst what you're doing improves things, there are
> > more corner cases remaining and we're just moving the problem to
> new
> > ones down the road. Having to hardcode in each of the class names
> and
> > special case them is a big warning sign.
> > 
> > I started wondering why we encode pathnames into the siginfo files.
> The
> > reason is that is how bitbake handles them within runqueue. In
> earlier
> > times when this was being built, that was fine but things have been
> > extended many times over since that decision was made.
> > 
> >

[OE-core] [RESEND][PATCH v4] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-07-25 Thread Yang Xu via lists.openembedded.org
From: Yang Xu 

The `bb.siggen.compare_sigfiles` method transforms the key format from
`[mc::][virtual:][native:]:` to
`/:[:virtual][:native][:mc:]`
by `clean_basepaths`. However, `find_siginfo` uses the original format
to get the package name (pn) and task name.

This commit corrects the method for deriving the pn and task name in
`find_siginfo` and adds handling for multilib name.
And add test for compare_sigfiles and find_siginfo working together.

Signed-off-by: Yang Xu 
---

Notes:
v1: correct handling for pn and taskname for native target in find_siginfo
v2: add handling for multilib target in find_siginfo
v3: add testcase for compare_sigfiles and find_siginfo work together.
v4: optimize testcase to avoid non-deterministic fail

 .../recipes-test/binutils/binutils_%.bbappend |  2 +
 meta/lib/oe/sstatesig.py  | 17 ++--
 meta/lib/oeqa/selftest/cases/sstatetests.py   | 83 +++
 3 files changed, 97 insertions(+), 5 deletions(-)
 create mode 100644 meta-selftest/recipes-test/binutils/binutils_%.bbappend

diff --git a/meta-selftest/recipes-test/binutils/binutils_%.bbappend 
b/meta-selftest/recipes-test/binutils/binutils_%.bbappend
new file mode 100644
index 00..205720982c
--- /dev/null
+++ b/meta-selftest/recipes-test/binutils/binutils_%.bbappend
@@ -0,0 +1,2 @@
+# This bbappend is used to alter the recipe using the test_recipe.inc file 
created by tests.
+include test_recipe.inc
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index f943df181e..f041a0c430 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -321,11 +321,18 @@ def find_siginfo(pn, taskname, taskhashlist, d):
 if not taskname:
 # We have to derive pn and taskname
 key = pn
-splitit = key.split('.bb:')
-taskname = splitit[1]
-pn = os.path.basename(splitit[0]).split('_')[0]
-if key.startswith('virtual:native:'):
-pn = pn + '-native'
+if key.count(':') >= 2:
+splitit, taskname, affix = key.split(':', 2)
+else:
+splitit, taskname = key.split(':', 1)
+affix = ''
+pn = os.path.splitext(os.path.basename(splitit))[0].split('_')[0]
+affixitems = affix.split(':')
+if affixitems[0] == 'virtual':
+if affixitems[1] == 'native':
+pn = pn + '-native'
+if affixitems[1] == 'multilib':
+pn = affixitems[2] + '-' + pn
 
 hashfiles = {}
 filedates = {}
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py 
b/meta/lib/oeqa/selftest/cases/sstatetests.py
index febafdb2f7..3fa3038218 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -691,3 +691,86 @@ TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
 self.maxDiff = None
 self.assertCountEqual(files1, files2)
 
+class SStateFindSiginfo(SStateBase):
+def test_sstate_compare_sigfiles_and_find_siginfo(self):
+"""
+Test the functionality of the find_siginfo: basic function and 
callback in compare_sigfiles
+"""
+self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstates-findsiginfo\"
+TCLIBCAPPEND = \"\"
+MACHINE = \"qemux86-64\"
+require conf/multilib.conf
+MULTILIBS = "multilib:lib32"
+DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
+BB_SIGNATURE_HANDLER = "OEBasicHash"
+""")
+self.track_for_cleanup(self.topdir + "/tmp-sstates-findsiginfo")
+
+pns = ["binutils", "binutils-native", "lib32-binutils"]
+target_configs = [
+"""
+TMPVAL1 = "tmpval1"
+TMPVAL2 = "tmpval2"
+do_tmptask1() {
+echo ${TMPVAL1}
+}
+do_tmptask2() {
+echo ${TMPVAL2}
+}
+addtask do_tmptask1
+addtask tmptask2 before do_tmptask1
+""",
+"""
+TMPVAL3 = "tmpval3"
+TMPVAL4 = "tmpval4"
+do_tmptask1() {
+echo ${TMPVAL3}
+}
+do_tmptask2() {
+echo ${TMPVAL4}
+}
+addtask do_tmptask1
+addtask tmptask2 before do_tmptask1
+"""
+]
+
+for target_config in target_configs:
+self.write_recipeinc("binutils", target_config)
+for pn in pns:
+bitbake("%s -c do_tmptask1 -S none" % pn)
+self.delete_recipeinc("binutils")
+
+with bb.tinfoil.Tinfoil() as tinfoil:
+tinfoil.prepare(config_only=True)
+
+def find_siginfo(pn, taskname, sigs=None):
+result = None
+tinfoil.set_event_mask(["bb.event.FindSigInfoResult",
+"bb.command.CommandCompleted"])
+ret = tinfoil.run_command("findSigInfo", pn, taskname, sigs)
+if ret:
+while True:
+event = tinfoil.wait_event(1)
+if event:
+if isinstance(event, bb.command.CommandCompleted):
+break
+elif isinstance(event, bb.event.FindSigInfoResult):
+  

Re: [OE-core] [PATCH v4] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-07-17 Thread Yang Xu via lists.openembedded.org
Dear Sirs,

Sorry, could you please help to review patch v4?
In patch v4, I optimize the testcase to avoid non-deterministic fail.

Thank you

On Thu, 2023-07-13 at 02:16 +, yang...@mediatek.com wrote:
> From: Yang Xu 
> 
> The `bb.siggen.compare_sigfiles` method transforms the key format
> from
> `[mc::][virtual:][native:]:` to
> `/ name>:[:virtual][:native][:mc:]`
> by `clean_basepaths`. However, `find_siginfo` uses the original
> format
> to get the package name (pn) and task name.
> 
> This commit corrects the method for deriving the pn and task name in
> `find_siginfo` and adds handling for multilib name.
> And add test for compare_sigfiles and find_siginfo working together.
> 
> Signed-off-by: Yang Xu 
> ---
> 
> Notes:
> v1: correct handling for pn and taskname for native target in
> find_siginfo
> v2: add handling for multilib target in find_siginfo
> v3: add testcase for compare_sigfiles and find_siginfo work
> together.
> v4: optimize testcase to avoid non-deterministic fail
> 
>  .../recipes-test/binutils/binutils_%.bbappend |  2 +
>  meta/lib/oe/sstatesig.py  | 17 ++--
>  meta/lib/oeqa/selftest/cases/sstatetests.py   | 83
> +++
>  3 files changed, 97 insertions(+), 5 deletions(-)
>  create mode 100644 meta-selftest/recipes-
> test/binutils/binutils_%.bbappend
> 
> diff --git a/meta-selftest/recipes-test/binutils/binutils_%.bbappend
> b/meta-selftest/recipes-test/binutils/binutils_%.bbappend
> new file mode 100644
> index 00..205720982c
> --- /dev/null
> +++ b/meta-selftest/recipes-test/binutils/binutils_%.bbappend
> @@ -0,0 +1,2 @@
> +# This bbappend is used to alter the recipe using the
> test_recipe.inc file created by tests.
> +include test_recipe.inc
> diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
> index f943df181e..f041a0c430 100644
> --- a/meta/lib/oe/sstatesig.py
> +++ b/meta/lib/oe/sstatesig.py
> @@ -321,11 +321,18 @@ def find_siginfo(pn, taskname, taskhashlist,
> d):
>  if not taskname:
>  # We have to derive pn and taskname
>  key = pn
> -splitit = key.split('.bb:')
> -taskname = splitit[1]
> -pn = os.path.basename(splitit[0]).split('_')[0]
> -if key.startswith('virtual:native:'):
> -pn = pn + '-native'
> +if key.count(':') >= 2:
> +splitit, taskname, affix = key.split(':', 2)
> +else:
> +splitit, taskname = key.split(':', 1)
> +affix = ''
> +pn =
> os.path.splitext(os.path.basename(splitit))[0].split('_')[0]
> +affixitems = affix.split(':')
> +if affixitems[0] == 'virtual':
> +if affixitems[1] == 'native':
> +pn = pn + '-native'
> +if affixitems[1] == 'multilib':
> +pn = affixitems[2] + '-' + pn
>  
>  hashfiles = {}
>  filedates = {}
> diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py
> b/meta/lib/oeqa/selftest/cases/sstatetests.py
> index febafdb2f7..3fa3038218 100644
> --- a/meta/lib/oeqa/selftest/cases/sstatetests.py
> +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
> @@ -691,3 +691,86 @@ TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
>  self.maxDiff = None
>  self.assertCountEqual(files1, files2)
>  
> +class SStateFindSiginfo(SStateBase):
> +def test_sstate_compare_sigfiles_and_find_siginfo(self):
> +"""
> +Test the functionality of the find_siginfo: basic function
> and callback in compare_sigfiles
> +"""
> +self.write_config("""
> +TMPDIR = \"${TOPDIR}/tmp-sstates-findsiginfo\"
> +TCLIBCAPPEND = \"\"
> +MACHINE = \"qemux86-64\"
> +require conf/multilib.conf
> +MULTILIBS = "multilib:lib32"
> +DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
> +BB_SIGNATURE_HANDLER = "OEBasicHash"
> +""")
> +self.track_for_cleanup(self.topdir + "/tmp-sstates-
> findsiginfo")
> +
> +pns = ["binutils", "binutils-native", "lib32-binutils"]
> +target_configs = [
> +"""
> +TMPVAL1 = "tmpval1"
> +TMPVAL2 = "tmpval2"
> +do_tmptask1() {
> +echo ${TMPVAL1}
> +}
> +do_tmptask2() {
> +echo ${TMPVAL2}
> +}
> +addtask do_tmptask1
> +addtask tmptask2 before do_tmptask1
> +""",
> +"""
> +TMPVAL3 = "tmpval3"
> +TMPVAL4 = "tmpval4"
> +do_tmptask1() {
> +echo ${TMPVAL3}
> +}
> +do_tmptask2() {
> +echo ${TMPVAL4}
> +}
> +addtask do_tmptask1
> +addtask tmptask2 before do_tmptask1
> +"""
> +]
> +
> +for target_config in target_configs:
> +self.write_recipeinc("binutils", target_config)
> +for pn in pns:
> +bitbake("%s -c do_tmptask1 -S none" % pn)
> +self.delete_recipeinc("binutils")
> +
> +with bb.tinfoil.Tinfoil() as tinfoil:
> +tinfoil.prepare(config_only=True)
> +
> +def find_siginfo(pn, taskname, sigs=None):
> +result = None
> +tinfoil.set_event_mask(["bb.event.FindSigInfoResult"
> ,
> +  

[OE-core] [PATCH v4] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-07-12 Thread Yang Xu via lists.openembedded.org
From: Yang Xu 

The `bb.siggen.compare_sigfiles` method transforms the key format from
`[mc::][virtual:][native:]:` to
`/:[:virtual][:native][:mc:]`
by `clean_basepaths`. However, `find_siginfo` uses the original format
to get the package name (pn) and task name.

This commit corrects the method for deriving the pn and task name in
`find_siginfo` and adds handling for multilib name.
And add test for compare_sigfiles and find_siginfo working together.

Signed-off-by: Yang Xu 
---

Notes:
v1: correct handling for pn and taskname for native target in find_siginfo
v2: add handling for multilib target in find_siginfo
v3: add testcase for compare_sigfiles and find_siginfo work together.
v4: optimize testcase to avoid non-deterministic fail

 .../recipes-test/binutils/binutils_%.bbappend |  2 +
 meta/lib/oe/sstatesig.py  | 17 ++--
 meta/lib/oeqa/selftest/cases/sstatetests.py   | 83 +++
 3 files changed, 97 insertions(+), 5 deletions(-)
 create mode 100644 meta-selftest/recipes-test/binutils/binutils_%.bbappend

diff --git a/meta-selftest/recipes-test/binutils/binutils_%.bbappend 
b/meta-selftest/recipes-test/binutils/binutils_%.bbappend
new file mode 100644
index 00..205720982c
--- /dev/null
+++ b/meta-selftest/recipes-test/binutils/binutils_%.bbappend
@@ -0,0 +1,2 @@
+# This bbappend is used to alter the recipe using the test_recipe.inc file 
created by tests.
+include test_recipe.inc
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index f943df181e..f041a0c430 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -321,11 +321,18 @@ def find_siginfo(pn, taskname, taskhashlist, d):
 if not taskname:
 # We have to derive pn and taskname
 key = pn
-splitit = key.split('.bb:')
-taskname = splitit[1]
-pn = os.path.basename(splitit[0]).split('_')[0]
-if key.startswith('virtual:native:'):
-pn = pn + '-native'
+if key.count(':') >= 2:
+splitit, taskname, affix = key.split(':', 2)
+else:
+splitit, taskname = key.split(':', 1)
+affix = ''
+pn = os.path.splitext(os.path.basename(splitit))[0].split('_')[0]
+affixitems = affix.split(':')
+if affixitems[0] == 'virtual':
+if affixitems[1] == 'native':
+pn = pn + '-native'
+if affixitems[1] == 'multilib':
+pn = affixitems[2] + '-' + pn
 
 hashfiles = {}
 filedates = {}
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py 
b/meta/lib/oeqa/selftest/cases/sstatetests.py
index febafdb2f7..3fa3038218 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -691,3 +691,86 @@ TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
 self.maxDiff = None
 self.assertCountEqual(files1, files2)
 
+class SStateFindSiginfo(SStateBase):
+def test_sstate_compare_sigfiles_and_find_siginfo(self):
+"""
+Test the functionality of the find_siginfo: basic function and 
callback in compare_sigfiles
+"""
+self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstates-findsiginfo\"
+TCLIBCAPPEND = \"\"
+MACHINE = \"qemux86-64\"
+require conf/multilib.conf
+MULTILIBS = "multilib:lib32"
+DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
+BB_SIGNATURE_HANDLER = "OEBasicHash"
+""")
+self.track_for_cleanup(self.topdir + "/tmp-sstates-findsiginfo")
+
+pns = ["binutils", "binutils-native", "lib32-binutils"]
+target_configs = [
+"""
+TMPVAL1 = "tmpval1"
+TMPVAL2 = "tmpval2"
+do_tmptask1() {
+echo ${TMPVAL1}
+}
+do_tmptask2() {
+echo ${TMPVAL2}
+}
+addtask do_tmptask1
+addtask tmptask2 before do_tmptask1
+""",
+"""
+TMPVAL3 = "tmpval3"
+TMPVAL4 = "tmpval4"
+do_tmptask1() {
+echo ${TMPVAL3}
+}
+do_tmptask2() {
+echo ${TMPVAL4}
+}
+addtask do_tmptask1
+addtask tmptask2 before do_tmptask1
+"""
+]
+
+for target_config in target_configs:
+self.write_recipeinc("binutils", target_config)
+for pn in pns:
+bitbake("%s -c do_tmptask1 -S none" % pn)
+self.delete_recipeinc("binutils")
+
+with bb.tinfoil.Tinfoil() as tinfoil:
+tinfoil.prepare(config_only=True)
+
+def find_siginfo(pn, taskname, sigs=None):
+result = None
+tinfoil.set_event_mask(["bb.event.FindSigInfoResult",
+"bb.command.CommandCompleted"])
+ret = tinfoil.run_command("findSigInfo", pn, taskname, sigs)
+if ret:
+while True:
+event = tinfoil.wait_event(1)
+if event:
+if isinstance(event, bb.command.CommandCompleted):
+break
+elif isinstance(event, bb.event.FindSigInfoResult):
+  

Re: [OE-core] [PATCH v3] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-07-09 Thread Yang Xu via lists.openembedded.org
Dear Alexandre,

Thank you for your reminder.

v1: correct handing for pn and taskname for native target in
find_siginfo
v2: add handling for multilib target in find_siginfo
v3: add test for compare_sigfiles and find_siginfo work together 

Do I need submit a patch v4 to add these changelog information?

Thank you


On Fri, 2023-07-07 at 14:36 +0200, Alexandre Belloni wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  Hello,
> 
> On 07/07/2023 06:52:39+, Yang Xu via lists.openembedded.org
> wrote:
> > From: Yang Xu 
> > 
> > The `bb.siggen.compare_sigfiles` method transforms the key format
> from
> > `[mc::][virtual:][native:]:` to
> > `/ name>:[:virtual][:native][:mc:]`
> > by `clean_basepaths`. However, `find_siginfo` uses the original
> format
> > to get the package name (pn) and task name.
> > 
> > This commit corrects the method for deriving the pn and task name
> in
> > `find_siginfo` and adds handling for multilib name.
> > And add test for compare_sigfiles and find_siginfo working
> together.
> > 
> > Signed-off-by: Yang Xu 
> > ---
> 
> Please always include a changelog in this location, else we can't
> know
> easily what changed since v2.
> 
> >  .../recipes-test/binutils/binutils_%.bbappend |  2 +
> >  meta/lib/oe/sstatesig.py  | 17 --
> >  meta/lib/oeqa/selftest/cases/sstatetests.py   | 53
> +++
> >  3 files changed, 67 insertions(+), 5 deletions(-)
> >  create mode 100644 meta-selftest/recipes-
> test/binutils/binutils_%.bbappend
> > 
> > diff --git a/meta-selftest/recipes-
> test/binutils/binutils_%.bbappend b/meta-selftest/recipes-
> test/binutils/binutils_%.bbappend
> > new file mode 100644
> > index 00..205720982c
> > --- /dev/null
> > +++ b/meta-selftest/recipes-test/binutils/binutils_%.bbappend
> > @@ -0,0 +1,2 @@
> > +# This bbappend is used to alter the recipe using the
> test_recipe.inc file created by tests.
> > +include test_recipe.inc
> > diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
> > index f943df181e..f041a0c430 100644
> > --- a/meta/lib/oe/sstatesig.py
> > +++ b/meta/lib/oe/sstatesig.py
> > @@ -321,11 +321,18 @@ def find_siginfo(pn, taskname, taskhashlist,
> d):
> >  if not taskname:
> >  # We have to derive pn and taskname
> >  key = pn
> > -splitit = key.split('.bb:')
> > -taskname = splitit[1]
> > -pn = os.path.basename(splitit[0]).split('_')[0]
> > -if key.startswith('virtual:native:'):
> > -pn = pn + '-native'
> > +if key.count(':') >= 2:
> > +splitit, taskname, affix = key.split(':', 2)
> > +else:
> > +splitit, taskname = key.split(':', 1)
> > +affix = ''
> > +pn =
> os.path.splitext(os.path.basename(splitit))[0].split('_')[0]
> > +affixitems = affix.split(':')
> > +if affixitems[0] == 'virtual':
> > +if affixitems[1] == 'native':
> > +pn = pn + '-native'
> > +if affixitems[1] == 'multilib':
> > +pn = affixitems[2] + '-' + pn
> >  
> >  hashfiles = {}
> >  filedates = {}
> > diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py
> b/meta/lib/oeqa/selftest/cases/sstatetests.py
> > index febafdb2f7..818d8b623d 100644
> > --- a/meta/lib/oeqa/selftest/cases/sstatetests.py
> > +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
> > @@ -691,3 +691,56 @@ TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
> >  self.maxDiff = None
> >  self.assertCountEqual(files1, files2)
> >  
> > +class SStateFindSiginfo(SStateBase):
> > +def test_sstate_compare_sigfiles_and_find_siginfo(self):
> > +"""
> > +Test the functionality of the find_siginfo: basic function
> and callback in compare_sigfiles
> > +"""
> > +self.write_config("""
> > +TMPDIR = \"${TOPDIR}/tmp-sstates-findsiginfo\"
> > +TCLIBCAPPEND = \"\"
> > +MACHINE = \"qemux86\"
> > +require conf/multilib.conf
> > +MULTILIBS = "multilib:lib32"
> > +DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
> > +BB_SIGNATURE_HANDLER = "

Re: [OE-core] [PATCH v3] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-07-09 Thread Yang Xu via lists.openembedded.org
Dear Alexandre,

Thank you for your reminder.

v1: correct handling for pn and taskname for native target in find_siginfo
v2: add handling for multilib target in find_siginfo
v3: add testcase for compare_sigfiles and find_siginfo work together.

Do I need submit a patch v4 to add these changlog information?

Thank you

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#184039): 
https://lists.openembedded.org/g/openembedded-core/message/184039
Mute This Topic: https://lists.openembedded.org/mt/11305/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 v3] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-07-06 Thread Yang Xu via lists.openembedded.org
From: Yang Xu 

The `bb.siggen.compare_sigfiles` method transforms the key format from
`[mc::][virtual:][native:]:` to
`/:[:virtual][:native][:mc:]`
by `clean_basepaths`. However, `find_siginfo` uses the original format
to get the package name (pn) and task name.

This commit corrects the method for deriving the pn and task name in
`find_siginfo` and adds handling for multilib name.
And add test for compare_sigfiles and find_siginfo working together.

Signed-off-by: Yang Xu 
---
 .../recipes-test/binutils/binutils_%.bbappend |  2 +
 meta/lib/oe/sstatesig.py  | 17 --
 meta/lib/oeqa/selftest/cases/sstatetests.py   | 53 +++
 3 files changed, 67 insertions(+), 5 deletions(-)
 create mode 100644 meta-selftest/recipes-test/binutils/binutils_%.bbappend

diff --git a/meta-selftest/recipes-test/binutils/binutils_%.bbappend 
b/meta-selftest/recipes-test/binutils/binutils_%.bbappend
new file mode 100644
index 00..205720982c
--- /dev/null
+++ b/meta-selftest/recipes-test/binutils/binutils_%.bbappend
@@ -0,0 +1,2 @@
+# This bbappend is used to alter the recipe using the test_recipe.inc file 
created by tests.
+include test_recipe.inc
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index f943df181e..f041a0c430 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -321,11 +321,18 @@ def find_siginfo(pn, taskname, taskhashlist, d):
 if not taskname:
 # We have to derive pn and taskname
 key = pn
-splitit = key.split('.bb:')
-taskname = splitit[1]
-pn = os.path.basename(splitit[0]).split('_')[0]
-if key.startswith('virtual:native:'):
-pn = pn + '-native'
+if key.count(':') >= 2:
+splitit, taskname, affix = key.split(':', 2)
+else:
+splitit, taskname = key.split(':', 1)
+affix = ''
+pn = os.path.splitext(os.path.basename(splitit))[0].split('_')[0]
+affixitems = affix.split(':')
+if affixitems[0] == 'virtual':
+if affixitems[1] == 'native':
+pn = pn + '-native'
+if affixitems[1] == 'multilib':
+pn = affixitems[2] + '-' + pn
 
 hashfiles = {}
 filedates = {}
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py 
b/meta/lib/oeqa/selftest/cases/sstatetests.py
index febafdb2f7..818d8b623d 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -691,3 +691,56 @@ TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
 self.maxDiff = None
 self.assertCountEqual(files1, files2)
 
+class SStateFindSiginfo(SStateBase):
+def test_sstate_compare_sigfiles_and_find_siginfo(self):
+"""
+Test the functionality of the find_siginfo: basic function and 
callback in compare_sigfiles
+"""
+self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstates-findsiginfo\"
+TCLIBCAPPEND = \"\"
+MACHINE = \"qemux86\"
+require conf/multilib.conf
+MULTILIBS = "multilib:lib32"
+DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
+BB_SIGNATURE_HANDLER = "OEBasicHash"
+""")
+self.track_for_cleanup(self.topdir + "/tmp-sstates-findsiginfo")
+
+pns = ["binutils", "binutils-native", "lib32-binutils"]
+
+#forcing generate different stamps for binutils every time
+self.write_recipeinc("binutils", 'do_fetch[nostamp] = "1"')
+for pn in pns*2:
+bitbake("%s -S none" % pn)
+self.delete_recipeinc("binutils")
+
+with bb.tinfoil.Tinfoil() as tinfoil:
+tinfoil.prepare(config_only=True)
+
+def find_siginfo(pn, taskname, sigs=None):
+result = None
+tinfoil.set_event_mask(["bb.event.FindSigInfoResult",
+"bb.command.CommandCompleted"])
+ret = tinfoil.run_command("findSigInfo", pn, taskname, sigs)
+if ret:
+while True:
+event = tinfoil.wait_event(1)
+if event:
+if isinstance(event, bb.command.CommandCompleted):
+break
+elif isinstance(event, bb.event.FindSigInfoResult):
+result = event.result
+return result
+
+def recursecb(key, hash1, hash2):
+hashes = [hash1, hash2]
+hashfiles = find_siginfo(key, None, hashes)
+self.assertCountEqual(hashes, hashfiles)
+bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], 
recursecb)
+
+for pn in pns:
+filedates = find_siginfo(pn, "do_compile")
+self.assertGreaterEqual(len(filedates), 2)
+latestfiles = sorted(filedates.keys(), key=lambda f: 
filedates[f])[-2:]
+bb.siggen.compare_sigfiles(latestfiles[-2], latestfiles[-1], 
recursecb)
-- 
2.2

Re: [OE-core] [PATCH v2] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-07-04 Thread Yang Xu via lists.openembedded.org
When I investiage some package tasks cache missing problem by bitbake-diffsigs, 
I found that 'find_siginfo' called by bitbake-diffsigs is unable to construct 
the correct package name(pn) when dealing with virtual targets.

Patch v2 introduces handling for 'lib64-' and 'lib32-' case besides '-native' 
case.

And for test case, I'm currently not familiar with oe-selftest.However, I will 
learn how to add test case to oe-selftest and will attempt to write a test case 
for this.

Thank you.

Yang

On Tue, 2023-07-04 at 11:19 +, Ross Burton wrote:

> The `bb.siggen.compare_sigfiles` method transforms the key format from

> `[mc::][virtual:][native:]:` to

> `/:[:virtual][:native][:mc:]`

> by `clean_basepaths`. However, `find_siginfo` uses the original format

> to get the package name (pn) and task name.

>

> This commit corrects the method for deriving the pn and task name in

> `find_siginfo` and adds handling for multilib name.

>

> Signed-off-by: Yang Xu 

> ---

> meta/lib/oe/sstatesig.py | 17 -

> 1 file changed, 12 insertions(+), 5 deletions(-)

>

> diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py

> index f943df181e..f041a0c430 100644

> --- a/meta/lib/oe/sstatesig.py

> +++ b/meta/lib/oe/sstatesig.py

> @@ -321,11 +321,18 @@ def find_siginfo(pn, taskname, taskhashlist, d):

> if not taskname:

> # We have to derive pn and taskname

> key = pn

> -splitit = key.split('.bb:')

> -taskname = splitit[1]

> -pn = os.path.basename(splitit[0]).split('_')[0]

> -if key.startswith('virtual:native:'):

> -pn = pn + '-native'

> +if key.count(':') >= 2:

> +splitit, taskname, affix = key.split(':', 2)

> +else:

> +splitit, taskname = key.split(':', 1)

> +affix = ''

> +pn = os.path.splitext(os.path.basename(splitit))[0].split('_')[0]

> +affixitems = affix.split(':')

> +if affixitems[0] == 'virtual':

> +if affixitems[1] == 'native':

> +pn = pn + '-native'

> +if affixitems[1] == 'multilib':

> +pn = affixitems[2] + '-' + pn


How did you notice this problem, what’s the actual change between this and v1, 
and more importantly can we add a test case for this obviously complex code?


Ross


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183832): 
https://lists.openembedded.org/g/openembedded-core/message/183832
Mute This Topic: https://lists.openembedded.org/mt/99940440/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 v2] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-07-03 Thread Yang Xu via lists.openembedded.org
From: Yang Xu 

The `bb.siggen.compare_sigfiles` method transforms the key format from
`[mc::][virtual:][native:]:` to
`/:[:virtual][:native][:mc:]`
by `clean_basepaths`. However, `find_siginfo` uses the original format
to get the package name (pn) and task name.

This commit corrects the method for deriving the pn and task name in
`find_siginfo` and adds handling for multilib name.

Signed-off-by: Yang Xu 
---
 meta/lib/oe/sstatesig.py | 17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index f943df181e..f041a0c430 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -321,11 +321,18 @@ def find_siginfo(pn, taskname, taskhashlist, d):
 if not taskname:
 # We have to derive pn and taskname
 key = pn
-splitit = key.split('.bb:')
-taskname = splitit[1]
-pn = os.path.basename(splitit[0]).split('_')[0]
-if key.startswith('virtual:native:'):
-pn = pn + '-native'
+if key.count(':') >= 2:
+splitit, taskname, affix = key.split(':', 2)
+else:
+splitit, taskname = key.split(':', 1)
+affix = ''
+pn = os.path.splitext(os.path.basename(splitit))[0].split('_')[0]
+affixitems = affix.split(':')
+if affixitems[0] == 'virtual':
+if affixitems[1] == 'native':
+pn = pn + '-native'
+if affixitems[1] == 'multilib':
+pn = affixitems[2] + '-' + pn
 
 hashfiles = {}
 filedates = {}
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183810): 
https://lists.openembedded.org/g/openembedded-core/message/183810
Mute This Topic: https://lists.openembedded.org/mt/99940440/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] sstatesig: Fix pn and taskname derivation in find_siginfo

2023-06-28 Thread Yang Xu via lists.openembedded.org
From: Yang Xu 

The `bb.siggen.compare_sigfiles` method transforms the key format from
`[mc:mc_name:][virtual:][native:]:` to
`/:[:virtual][:native][:mc:mc_name]`
in `clean_basepaths`. However, `find_siginfo` uses the original format
to get the package name (pn) and task name. This commit corrects the
method for deriving the pn and task name in `find_siginfo`.

Signed-off-by: Yang Xu 
---
 meta/lib/oe/sstatesig.py | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index f943df181e..a52dacd1a0 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -321,10 +321,13 @@ def find_siginfo(pn, taskname, taskhashlist, d):
 if not taskname:
 # We have to derive pn and taskname
 key = pn
-splitit = key.split('.bb:')
-taskname = splitit[1]
-pn = os.path.basename(splitit[0]).split('_')[0]
-if key.startswith('virtual:native:'):
+if key.count(":") >= 2:
+splitit,taskname,affix = key.split(":", 2)
+else:
+splitit,taskname = key.split(":", 1)
+affix = ""
+pn = os.path.splitext(os.path.basename(splitit))[0].split('_')[0]
+if affix.startswith('virtual:native'):
 pn = pn + '-native'
 
 hashfiles = {}
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183595): 
https://lists.openembedded.org/g/openembedded-core/message/183595
Mute This Topic: https://lists.openembedded.org/mt/99833800/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 v3] openssl: set package level PERL5LIB

2023-04-24 Thread Yang Xu via lists.openembedded.org
Dear Sirs,

Sorry, please NOT accept this patch because I found it will break its
own sstate cache.

I will found other solution for this openssl/perl co-work issue.

On Fri, 2023-04-21 at 03:38 +, yang...@mediatek.com wrote:
> From: Yang Xu 
> 
> Build openssl with shared state cache may meet problem under below
> conditions:
> 1. sstate cache generated by another user on same machine
> 2. inappropriate PERL5LIB setting
> 3. openssl build from scratch but perl using cache
> 
> When build openssl from scratch with perl using cache, it will be
> aborted at do_configure stage,
> error message is like "Can't locate Text/Template.pm at
> /home/A/[build path]/[perl module path]/Text/Template.pm : Permission
> Denied".
> 
> The simplified environment and scenarios is:
> 1) User A, his home directory is /home/A, generate one sstate cache
> under /home/A.
> 2) This sstate cache moved to /home/Public, act as shared sstate
> cache
> 3) User B, his home directory is /home/B, using sstate cache in
> /home/Public and build yocto.
> 4) User B has no permission to access /home/A.
> 
> Some information about perl behavior:
> 1. perl will hardcode buildtime path in @INC in binary (module search
> directories)
> 2. when "use MODULE", perl will search @INC from begin to end until
> it found MODULE.
> 3. when perl search module through directories in @INC
>  3.1 if [directory]/MODULE.pm is not exist, search in next
> directory in @INC.
>  3.2 if [directory]/MODULE.pm has no permission to access, perl
> will ABORT.
> 
> While build openssl from from scratch with perl using cache, @INC
> directory order is:
> 1.
> 2.
> 3.
> 4.
> 
> Without appropriate PERL5LIB setting, perl can't find
> Text/Template.pm in
> , and it also can't find it in .
> 
> Then perl search Text/Template.pm in  binary>,
> *if /home/A is not existed, perl will search in  FindBin> and found Text/Template.pm finally. (OK case)
> *if /home/A is existed but has no permission access, perl will ABORT
> immediately. (NG case)
> 
> So this patch does some fixup for NG case:
> 1) set appropriate PERL5LIB to make perl can found Text/Tempalte.pm
> at highest priority folder .
> 2) add other perl module directories needed by openssl build in
> PERL5LIB
> 3) set PERL5LIB as package environment variable
> 
> Signed-off-by: Yang Xu 
> ---
>  meta/recipes-connectivity/openssl/openssl_3.1.0.bb | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
> b/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
> index b319c66044..613451f265 100644
> --- a/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
> +++ b/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
> @@ -54,6 +54,10 @@ CFLAGS:append:class-nativesdk = "
> -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/bu
>  # The default is to trust upstream choices.
>  DEPRECATED_CRYPTO_FLAGS ?= ""
>  
> +# Set package level PERL5LIB
> +PERL5LIB = "${S}/external/perl/Text-Template-
> 1.56/lib/:${S}/crypto/perlasm"
> +export PERL5LIB
> +
>  do_configure () {
>   # When we upgrade glibc but not uninative we see obtuse
> failures in openssl. Make
>   # the issue really clear that perl isn't functional due to
> symbol mismatch issues.
> @@ -138,7 +142,7 @@ do_configure () {
>   fi
>   # WARNING: do not set compiler/linker flags (-I/-D etc.) in
> EXTRA_OECONF, as they will fully replace the
>   # environment variables set by bitbake. Adjust the environment
> variables instead.
> - HASHBANGPERL="/usr/bin/env perl" PERL=perl
> PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \
> + HASHBANGPERL="/usr/bin/env perl" PERL=perl \
>   perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS}
> ${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --
> openssldir=${libdir}/ssl-3 --libdir=${libdir} $target
>   perl ${B}/configdata.pm --dump
>  }

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#180374): 
https://lists.openembedded.org/g/openembedded-core/message/180374
Mute This Topic: https://lists.openembedded.org/mt/98403807/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 v2] openssl: set package level PERL5LIB

2023-04-24 Thread Yang Xu via lists.openembedded.org
Dear Sirs,

Sorry, please NOT accept this patch because I found it will break its
own sstate cache.

I will found other solution for this openssl/perl co-work issue.

On Thu, 2023-04-20 at 10:43 +0200, Luca Ceresoli wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> Hello Yang,
> 
> thanks for you patch. However there is an issue with your e-mail, see
> below
> 
> On Thu, 20 Apr 2023 06:30:34 +
> "Yang Xu via lists.openembedded.org"
>  wrote:
> 
> 
> As you can see your sender address has been mangled, and as a result
> the patch is rejected by the the openembedded git server. This is not
> your fault, but we need you to modify your git configuration to
> prevent
> this from happening in the future. Have a look at the wiki for more
> info and how to solve that:
> 
> 
https://urldefense.com/v3/__https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded*Fixing_your_From_identity__;Iw!!CTRNKA9wMg0ARbw!mqd2E9hIGSyXX1IuHHAsZENlRGaglvctXM4n_aGmmPesGsE7KMIxiBwRhAo_7H7IP7fVwq1ICYPKoQVXgz6U1ZFvnQ$
> 
> I'm taking your patch for testing on the autobuilders, fixing it
> manually so you don't need to resend it.
> 
> Best regards,
> Luca
> 
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> 
https://urldefense.com/v3/__https://bootlin.com__;!!CTRNKA9wMg0ARbw!mqd2E9hIGSyXX1IuHHAsZENlRGaglvctXM4n_aGmmPesGsE7KMIxiBwRhAo_7H7IP7fVwq1ICYPKoQVXgz6LUphplw$

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#180373): 
https://lists.openembedded.org/g/openembedded-core/message/180373
Mute This Topic: https://lists.openembedded.org/mt/98383945/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] openssl: set package level PERL5LIB

2023-04-24 Thread Yang Xu via lists.openembedded.org
Dear Sirs,

Sorry, please NOT accept this patch because I found it will break its
own sstate cache.

I will found other solution for this openssl/perl co-work issue.

On Thu, 2023-04-20 at 21:11 +0100, Richard Purdie wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Thu, 2023-04-20 at 19:20 +0200, Alexander Kanavin wrote:
> > Thank you, I understand this now. I'm fine with the fix, but can
> > you
> > add this additional information to the commit message? So that it's
> > available in git history if anyone needs to understand it.
> 
> I think there is something additional we need to do. If the path
> compiled into perl breaks when it is installed from sstate, we should
> make sure this path is *always* incorrect. That way things will work
> or
> fail deterministicly.
> 
> Cheers,
> 
> Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#180372): 
https://lists.openembedded.org/g/openembedded-core/message/180372
Mute This Topic: https://lists.openembedded.org/mt/98383506/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 v3] openssl: set package level PERL5LIB

2023-04-20 Thread Yang Xu via lists.openembedded.org
From: Yang Xu 

Build openssl with shared state cache may meet problem under below conditions:
1. sstate cache generated by another user on same machine
2. inappropriate PERL5LIB setting
3. openssl build from scratch but perl using cache

When build openssl from scratch with perl using cache, it will be aborted at 
do_configure stage,
error message is like "Can't locate Text/Template.pm at /home/A/[build 
path]/[perl module path]/Text/Template.pm : Permission Denied".

The simplified environment and scenarios is:
1) User A, his home directory is /home/A, generate one sstate cache under 
/home/A.
2) This sstate cache moved to /home/Public, act as shared sstate cache
3) User B, his home directory is /home/B, using sstate cache in /home/Public 
and build yocto.
4) User B has no permission to access /home/A.

Some information about perl behavior:
1. perl will hardcode buildtime path in @INC in binary (module search 
directories)
2. when "use MODULE", perl will search @INC from begin to end until it found 
MODULE.
3. when perl search module through directories in @INC
 3.1 if [directory]/MODULE.pm is not exist, search in next directory in 
@INC.
 3.2 if [directory]/MODULE.pm has no permission to access, perl will ABORT.

While build openssl from from scratch with perl using cache, @INC directory 
order is:
1.
2.
3.
4.

Without appropriate PERL5LIB setting, perl can't find Text/Template.pm in
, and it also can't find it in .

Then perl search Text/Template.pm in ,
*if /home/A is not existed, perl will search in  and 
found Text/Template.pm finally. (OK case)
*if /home/A is existed but has no permission access, perl will ABORT 
immediately. (NG case)

So this patch does some fixup for NG case:
1) set appropriate PERL5LIB to make perl can found Text/Tempalte.pm at highest 
priority folder .
2) add other perl module directories needed by openssl build in PERL5LIB
3) set PERL5LIB as package environment variable

Signed-off-by: Yang Xu 
---
 meta/recipes-connectivity/openssl/openssl_3.1.0.bb | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-connectivity/openssl/openssl_3.1.0.bb 
b/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
index b319c66044..613451f265 100644
--- a/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
+++ b/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
@@ -54,6 +54,10 @@ CFLAGS:append:class-nativesdk = " -DOPENSSLDIR=/not/builtin 
-DENGINESDIR=/not/bu
 # The default is to trust upstream choices.
 DEPRECATED_CRYPTO_FLAGS ?= ""
 
+# Set package level PERL5LIB
+PERL5LIB = "${S}/external/perl/Text-Template-1.56/lib/:${S}/crypto/perlasm"
+export PERL5LIB
+
 do_configure () {
# When we upgrade glibc but not uninative we see obtuse failures in 
openssl. Make
# the issue really clear that perl isn't functional due to symbol 
mismatch issues.
@@ -138,7 +142,7 @@ do_configure () {
fi
# WARNING: do not set compiler/linker flags (-I/-D etc.) in 
EXTRA_OECONF, as they will fully replace the
# environment variables set by bitbake. Adjust the environment 
variables instead.
-   HASHBANGPERL="/usr/bin/env perl" PERL=perl 
PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \
+   HASHBANGPERL="/usr/bin/env perl" PERL=perl \
perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} 
${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --openssldir=${libdir}/ssl-3 
--libdir=${libdir} $target
perl ${B}/configdata.pm --dump
 }
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#180264): 
https://lists.openembedded.org/g/openembedded-core/message/180264
Mute This Topic: https://lists.openembedded.org/mt/98403807/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] openssl: set package level PERL5LIB

2023-04-20 Thread Yang Xu via lists.openembedded.org
Thank you, I will submit a new patch with more detailed information.

Because two below behavior, I think it is a definite result under certain 
conditions.
1) @INC is set at build time with host hardcode path,
2) ABORT when searching module in @​INC paths exists but can not read.

Thank you

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#180262): 
https://lists.openembedded.org/g/openembedded-core/message/180262
Mute This Topic: https://lists.openembedded.org/mt/98383506/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] openssl: set package level PERL5LIB

2023-04-20 Thread Yang Xu via lists.openembedded.org

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#180252): 
https://lists.openembedded.org/g/openembedded-core/message/180252
Mute This Topic: https://lists.openembedded.org/mt/98383506/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 v2] openssl: set package level PERL5LIB

2023-04-19 Thread Yang Xu via lists.openembedded.org
Build openssl with shared state cache may meet problem under below conditions:
1. sstate cache generated by another user on same machine
2. inappropriate PERL5LIB setting
3. openssl build from scratch but perl using cache

When building openssl, without appropriate PERL5LIB setting, perl from cache
tries to search Text::Template and other modules in no permission path and
abort immediately.

This patch does three things:
1. openssl upgrades external Text-Template from 1.46 to 1.56,
correct perl module path.
2. add necessary module path while openssl build
3. set package level PERL5LIB to make perl found module in S

Signed-off-by: Yang Xu 
---
 meta/recipes-connectivity/openssl/openssl_3.1.0.bb | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-connectivity/openssl/openssl_3.1.0.bb 
b/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
index b319c66044..613451f265 100644
--- a/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
+++ b/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
@@ -54,6 +54,10 @@ CFLAGS:append:class-nativesdk = " -DOPENSSLDIR=/not/builtin 
-DENGINESDIR=/not/bu
 # The default is to trust upstream choices.
 DEPRECATED_CRYPTO_FLAGS ?= ""
 
+# Set package level PERL5LIB
+PERL5LIB = "${S}/external/perl/Text-Template-1.56/lib/:${S}/crypto/perlasm"
+export PERL5LIB
+
 do_configure () {
# When we upgrade glibc but not uninative we see obtuse failures in 
openssl. Make
# the issue really clear that perl isn't functional due to symbol 
mismatch issues.
@@ -138,7 +142,7 @@ do_configure () {
fi
# WARNING: do not set compiler/linker flags (-I/-D etc.) in 
EXTRA_OECONF, as they will fully replace the
# environment variables set by bitbake. Adjust the environment 
variables instead.
-   HASHBANGPERL="/usr/bin/env perl" PERL=perl 
PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \
+   HASHBANGPERL="/usr/bin/env perl" PERL=perl \
perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} 
${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --openssldir=${libdir}/ssl-3 
--libdir=${libdir} $target
perl ${B}/configdata.pm --dump
 }
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#180236): 
https://lists.openembedded.org/g/openembedded-core/message/180236
Mute This Topic: https://lists.openembedded.org/mt/98383945/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] openssl: set package level PERL5LIB

2023-04-19 Thread Yang Xu via lists.openembedded.org
Build openssl with shared state cache may meet problem under below conditions:
1. sstate cache generated by another user on same machine
2. inappropriate PERL5LIB setting
3. openssl build from scratch but perl using cache

When building openssl, without appropriate PERL5LIB setting, perl tries
to search Text::Template in no permission path and abort.

This patch does three things:
1. openssl upgrade external Text-Template from 1.46 to 1.56,
correct perl module path.
2. add necessary module path while openssl build
3. set package level PERL5LIB to make perl found module in S

Signed-off-by: Yang Xu 
---
 meta/recipes-connectivity/openssl/openssl_3.1.0.bb | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-connectivity/openssl/openssl_3.1.0.bb 
b/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
index b319c66044..ed1c579df9 100644
--- a/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
+++ b/meta/recipes-connectivity/openssl/openssl_3.1.0.bb
@@ -54,6 +54,10 @@ CFLAGS:append:class-nativesdk = " -DOPENSSLDIR=/not/builtin 
-DENGINESDIR=/not/bu
 # The default is to trust upstream choices.
 DEPRECATED_CRYPTO_FLAGS ?= ""
 
+# Set package level PERL5LIB
+PERL5LIB="${S}/external/perl/Text-Template-1.56/lib/:${S}/crypto/perlasm"
+export PERL5LIB
+
 do_configure () {
# When we upgrade glibc but not uninative we see obtuse failures in 
openssl. Make
# the issue really clear that perl isn't functional due to symbol 
mismatch issues.
@@ -138,7 +142,7 @@ do_configure () {
fi
# WARNING: do not set compiler/linker flags (-I/-D etc.) in 
EXTRA_OECONF, as they will fully replace the
# environment variables set by bitbake. Adjust the environment 
variables instead.
-   HASHBANGPERL="/usr/bin/env perl" PERL=perl 
PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \
+   HASHBANGPERL="/usr/bin/env perl" PERL=perl \
perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} 
${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --openssldir=${libdir}/ssl-3 
--libdir=${libdir} $target
perl ${B}/configdata.pm --dump
 }
-- 
2.25.1


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



[OE-core] [kirkstone][PATCH] insane.bbclass: Skip patches not in oe-core by full path

2022-09-01 Thread Yang Xu via lists.openembedded.org
The full path of patch may contain '/meta/' but not in oe-core, skip
patches by checking it starts with oe-core full path or not.

Signed-off-by: Yang Xu 
---
 meta/classes/insane.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index f3f80334f6..0d93d50e58 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -1196,11 +1196,12 @@ python do_qa_patch() {
 import re
 from oe import patch
 
+coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '')
 for url in patch.src_patches(d):
(_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
# skip patches not in oe-core
-   if '/meta/' not in fullpath:
+   if not os.path.abspath(fullpath).startswith(coremeta_path):
continue
 
kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | 
re.MULTILINE)
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170233): 
https://lists.openembedded.org/g/openembedded-core/message/170233
Mute This Topic: https://lists.openembedded.org/mt/93409994/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 v2] insane.bbclass: Skip patches not in oe-core by full path

2022-08-18 Thread Yang Xu via lists.openembedded.org
Hi Alexandre,

Sorry for my neglience. Error caused by the last "/" was eaten by
os.path.abspath.

I have fixed and submitted PATCH v3.

Thank you

On Wed, 2022-08-17 at 19:24 +0200, Alexandre Belloni wrote:
> Hello,
> 
> This doesn't seem to work as expected:
> 
> 
https://urldefense.com/v3/__https://autobuilder.yoctoproject.org/typhoon/*/builders/120/builds/1599/steps/12/logs/stdio__;Iw!!CTRNKA9wMg0ARbw!w2oEYTVQJHnJaZ1uIyOM8anxM71iSFQOOkD0yUlbiPPnPzMEZNzYT-4fATdVatAd$
>  
> 
> 
https://urldefense.com/v3/__https://autobuilder.yoctoproject.org/typhoon/*/builders/100/builds/3296/steps/12/logs/stdio__;Iw!!CTRNKA9wMg0ARbw!w2oEYTVQJHnJaZ1uIyOM8anxM71iSFQOOkD0yUlbiPPnPzMEZNzYT-4fAS5I-4JV$
>  
> 
> 
https://urldefense.com/v3/__https://autobuilder.yoctoproject.org/typhoon/*builders/128/builds/495/steps/13/logs/stdio__;Iw!!CTRNKA9wMg0ARbw!w2oEYTVQJHnJaZ1uIyOM8anxM71iSFQOOkD0yUlbiPPnPzMEZNzYT-4fAWjB-itS$
>  
> 
> On 15/08/2022 05:39:35+, Yang Xu via lists.openembedded.org
> wrote:
> > The full path of patch may contain '/meta/' but not in oe-core,
> > skip
> > patches by checking it starts with oe-core full path or not.
> > 
> > Signed-off-by: Yang Xu 
> > ---
> >  meta/classes-global/insane.bbclass | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meta/classes-global/insane.bbclass b/meta/classes-
> > global/insane.bbclass
> > index 46ea41e271..42daf4388e 100644
> > --- a/meta/classes-global/insane.bbclass
> > +++ b/meta/classes-global/insane.bbclass
> > @@ -1214,11 +1214,12 @@ python do_qa_patch() {
> >  import re
> >  from oe import patch
> >  
> > +coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta/')
> >  for url in patch.src_patches(d):
> > (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
> >  
> > # skip patches not in oe-core
> > -   if '/meta/' not in fullpath:
> > +   if not
> > os.path.abspath(fullpath).startswith(os.path.abspath(coremeta_path)
> > ):
> > continue
> >  
> > kinda_status_re = re.compile(r"^.*upstream.*status.*$",
> > re.IGNORECASE | re.MULTILINE)
> > -- 
> > 2.25.1
> > 
> > 
> > 
> > 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#169570): 
https://lists.openembedded.org/g/openembedded-core/message/169570
Mute This Topic: https://lists.openembedded.org/mt/93030817/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 v3] insane.bbclass: Skip patches not in oe-core by full path

2022-08-17 Thread Yang Xu via lists.openembedded.org
The full path of patch may contain '/meta/' but not in oe-core, skip
patches by checking it starts with oe-core full path or not.

Signed-off-by: Yang Xu 
---
 meta/classes-global/insane.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes-global/insane.bbclass 
b/meta/classes-global/insane.bbclass
index 46ea41e271..db34b4bdb5 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -1214,11 +1214,12 @@ python do_qa_patch() {
 import re
 from oe import patch
 
+coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '')
 for url in patch.src_patches(d):
(_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
# skip patches not in oe-core
-   if '/meta/' not in fullpath:
+   if not os.path.abspath(fullpath).startswith(coremeta_path):
continue
 
kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | 
re.MULTILINE)
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#169513): 
https://lists.openembedded.org/g/openembedded-core/message/169513
Mute This Topic: https://lists.openembedded.org/mt/93098787/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 v2] insane.bbclass: Skip patches not in oe-core by full path

2022-08-14 Thread Yang Xu via lists.openembedded.org
The full path of patch may contain '/meta/' but not in oe-core, skip
patches by checking it starts with oe-core full path or not.

Signed-off-by: Yang Xu 
---
 meta/classes-global/insane.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes-global/insane.bbclass 
b/meta/classes-global/insane.bbclass
index 46ea41e271..42daf4388e 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -1214,11 +1214,12 @@ python do_qa_patch() {
 import re
 from oe import patch
 
+coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta/')
 for url in patch.src_patches(d):
(_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
# skip patches not in oe-core
-   if '/meta/' not in fullpath:
+   if not 
os.path.abspath(fullpath).startswith(os.path.abspath(coremeta_path)):
continue
 
kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | 
re.MULTILINE)
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#169350): 
https://lists.openembedded.org/g/openembedded-core/message/169350
Mute This Topic: https://lists.openembedded.org/mt/93030817/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] insane.bbclass: Skip patches not in oe-core by full path in do_qa_patch

2022-08-11 Thread Yang Xu via lists.openembedded.org
ping

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#169273): 
https://lists.openembedded.org/g/openembedded-core/message/169273
Mute This Topic: https://lists.openembedded.org/mt/92907002/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] insane.bbclass: Skip patches not in oe-core by full path in do_qa_patch

2022-08-08 Thread Yang Xu via lists.openembedded.org
The full path of patch may contain '/meta/' but not in oe-core, skip
patches by checking it starts with oe-core full path or not.

Signed-off-by: Yang Xu 
---
 meta/classes/insane.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index c8b434bb54..5b2b91f6ff 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -1208,11 +1208,12 @@ python do_qa_patch() {
 import re
 from oe import patch
 
+oecore_path = os.path.join(d.getVar('COREBASE'), 'meta/')
 for url in patch.src_patches(d):
(_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
# skip patches not in oe-core
-   if '/meta/' not in fullpath:
+   if not os.path.abspath(fullpath).startswith(oecore_path):
continue
 
kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | 
re.MULTILINE)
-- 
2.25.1


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