Skip to contentSkip to conversation

samhain: rework due to changed oe cache handling

PATCH In review Max Krummenacher 3 participants 6 messages Jan 27, 2023 – Jan 28, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 samhain: rework due to changed oe cache handling

From: Max Krummenacher <[email protected]>

OE-Core changed the cache handling which made the use of ${BPN} fail.

| Parsing recipes...WARNING: .../samhain-standalone.bb: Exception during build_dependencies for do_configure
| WARNING: .../samhain-standalone.bb: Error during finalise of .../samhain-standalone.bb
| ERROR: ExpansionError during parsing .../samhain-standalone.bb
| Traceback (most recent call last):
|   File "Var <MODE_NAME>", line 1, in <module>
| bb.data_smart.ExpansionError: Failure expanding variable MODE_NAME, expression was ${@d.getVar('BPN').split('-')[1]} which triggered exception IndexError: list index out of range
| The variable dependency chain for the failure is: MODE_NAME -> SAMHAIN_MODE -> do_configure

Simplify the setting of MODE_NAME and SAMHAIN_MODE by moving them from the inc file to the recipe files where we know their values.

Relevant commits to produce the error:
bitbake:
ee89ade5 cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location oe-core:
7c15e03dd3 bitbake.conf: Add BB_HASH_CODEPARSER_VALS

---
 recipes-ids/samhain/samhain-client.bb     | 3 +++
 recipes-ids/samhain/samhain-server.bb     | 3 +++
 recipes-ids/samhain/samhain-standalone.bb | 3 +++
 recipes-ids/samhain/samhain.inc           | 8 --------
 4 files changed, 9 insertions(+), 8 deletions(-)
recipes-ids/samhain/samhain-client.bb +3 -0
index 2b99e20..0de9c34 100644
@@ -8,5 +8,8 @@ EXTRA_OECONF += " \
         --with-port=${SAMHAIN_PORT} \
         "
 
+MODE_NAME = "client"
+SAMHAIN_MODE = "client"
+
 RDEPENDS:${PN} = "acl zlib attr bash"
 RCONFLICTS:${PN} = "samhain-standalone"
recipes-ids/samhain/samhain-server.bb +3 -0
index 51bce07..8bae2d2 100644
@@ -8,6 +8,9 @@ SRC_URI += "file://samhain-server-volatiles \
             file://samhain-server-volatiles.conf \
            "
 
+MODE_NAME = "server"
+SAMHAIN_MODE = "server"
+
 TARGET_CC_ARCH += "${LDFLAGS}"
 
 do_install:append() {
recipes-ids/samhain/samhain-standalone.bb +3 -0
index b832dc8..ae9ed2b 100644
@@ -7,6 +7,9 @@ SRC_URI += "file://samhain-not-run-ptest-on-host.patch \
 
 PROVIDES += "samhain"
 
+MODE_NAME = "standalone"
+SAMHAIN_MODE = "no"
+
 SYSTEMD_SERVICE:${PN} = "samhain.service"
 
 inherit ptest
recipes-ids/samhain/samhain.inc +0 -8
index eb8592d..8967d72 100644
@@ -40,14 +40,6 @@ SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE:${PN} = "${INITSCRIPT_NAME}.service"
 SYSTEMD_AUTO_ENABLE = "disable"
 
-# mode mapping:
-# BPN                MODE_NAME   SAMHAIN_MODE
-# samhain-standalone standalone  no
-# samhain-client     client      client
-# samhain-server     server      server
-MODE_NAME = "${@d.getVar('BPN').split('-')[1]}"
-SAMHAIN_MODE = "${@oe.utils.ifelse(d.getVar('MODE_NAME') == 'standalone', 'no', '${MODE_NAME}')}"
-
 # supports mysql|postgresql|oracle|odbc but postgresql is the only one available
 
 PACKAGECONFIG ??= "postgresql ps \
Signature · 1 line
2.35.3
#1 lore raw

PATCH 1/1 samhain: rework due to changed cache handling

From: Max Krummenacher <[email protected]>

OE-Core changed the cache handling which made the use of ${BPN} no fail.

| Parsing recipes...WARNING: .../samhain-standalone.bb: Exception during build_dependencies for do_configure
| WARNING: .../samhain-standalone.bb: Error during finalise of .../samhain-standalone.bb
| ERROR: ExpansionError during parsing .../samhain-standalone.bb
| Traceback (most recent call last):
|   File "Var <MODE_NAME>", line 1, in <module>
| bb.data_smart.ExpansionError: Failure expanding variable MODE_NAME, expression was ${@d.getVar('BPN').split('-')[1]} which triggered exception IndexError: list index out of range
| The variable dependency chain for the failure is: MODE_NAME -> SAMHAIN_MODE -> do_configure

Simplify the setting of MODE_NAME and SAMHAIN_MODE by setting them in the recipe files where we know their values.

bitbake:
ee89ade5 cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location oe-core:
7c15e03dd3 bitbake.conf: Add BB_HASH_CODEPARSER_VALS

---
 recipes-ids/samhain/samhain-client.bb     | 3 +++
 recipes-ids/samhain/samhain-server.bb     | 3 +++
 recipes-ids/samhain/samhain-standalone.bb | 3 +++
 recipes-ids/samhain/samhain.inc           | 8 --------
 4 files changed, 9 insertions(+), 8 deletions(-)
recipes-ids/samhain/samhain-client.bb +3 -0
index 2b99e20..0de9c34 100644
@@ -8,5 +8,8 @@ EXTRA_OECONF += " \
         --with-port=${SAMHAIN_PORT} \
         "
 
+MODE_NAME = "client"
+SAMHAIN_MODE = "client"
+
 RDEPENDS:${PN} = "acl zlib attr bash"
 RCONFLICTS:${PN} = "samhain-standalone"
recipes-ids/samhain/samhain-server.bb +3 -0
index 51bce07..8bae2d2 100644
@@ -8,6 +8,9 @@ SRC_URI += "file://samhain-server-volatiles \
             file://samhain-server-volatiles.conf \
            "
 
+MODE_NAME = "server"
+SAMHAIN_MODE = "server"
+
 TARGET_CC_ARCH += "${LDFLAGS}"
 
 do_install:append() {
recipes-ids/samhain/samhain-standalone.bb +3 -0
index b832dc8..ae9ed2b 100644
@@ -7,6 +7,9 @@ SRC_URI += "file://samhain-not-run-ptest-on-host.patch \
 
 PROVIDES += "samhain"
 
+MODE_NAME = "standalone"
+SAMHAIN_MODE = "no"
+
 SYSTEMD_SERVICE:${PN} = "samhain.service"
 
 inherit ptest
recipes-ids/samhain/samhain.inc +0 -8
index eb8592d..8967d72 100644
@@ -40,14 +40,6 @@ SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE:${PN} = "${INITSCRIPT_NAME}.service"
 SYSTEMD_AUTO_ENABLE = "disable"
 
-# mode mapping:
-# BPN                MODE_NAME   SAMHAIN_MODE
-# samhain-standalone standalone  no
-# samhain-client     client      client
-# samhain-server     server      server
-MODE_NAME = "${@d.getVar('BPN').split('-')[1]}"
-SAMHAIN_MODE = "${@oe.utils.ifelse(d.getVar('MODE_NAME') == 'standalone', 'no', '${MODE_NAME}')}"
-
 # supports mysql|postgresql|oracle|odbc but postgresql is the only one available
 
 PACKAGECONFIG ??= "postgresql ps \
Signature · 1 line
2.35.3
#3 lore raw
In reply to Max Krummenacher
Quoted 21 lines · Max Krummenacher

From: Max Krummenacher <[email protected]>

OE-Core changed the cache handling which made the use of ${BPN} fail.

Quoted 7 lines

Parsing recipes...WARNING: .../samhain-standalone.bb: Exception during build_dependencies for do_configure
WARNING: .../samhain-standalone.bb: Error during finalise of .../samhain-standalone.bb
ERROR: ExpansionError during parsing .../samhain-standalone.bb
Traceback (most recent call last):
File "Var <MODE_NAME>", line 1, in <module>
bb.data_smart.ExpansionError: Failure expanding variable MODE_NAME, expression was ${@d.getVar('BPN').split('-')[1]} which triggered exception IndexError: list index out of range The variable dependency chain for the failure is: MODE_NAME -> SAMHAIN_MODE -> do_configure

Simplify the setting of MODE_NAME and SAMHAIN_MODE by moving them from the inc file to the recipe files where we know their values.

Relevant commits to produce the error:
bitbake:
ee89ade5 cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location oe-core:
7c15e03dd3 bitbake.conf: Add BB_HASH_CODEPARSER_VALS

Quoted 7 lines
---
 recipes-ids/samhain/samhain-client.bb     | 3 +++
 recipes-ids/samhain/samhain-server.bb     | 3 +++
 recipes-ids/samhain/samhain-standalone.bb | 3 +++
 recipes-ids/samhain/samhain.inc           | 8 --------
 4 files changed, 9 insertions(+), 8 deletions(-)

This is the second report I've seen of this. I'm wondering about changing the default PN dummy value in bitbake.conf to include a "-"...

Cheers,

Richard

author
#4 lore raw

Am Freitag, dem 27.01.2023 um 16:14 +0000 schrieb Richard Purdie:

Quoted 33 lines · Max Krummenacher
Quoted 24 lines

From: Max Krummenacher <[email protected]>

OE-Core changed the cache handling which made the use of ${BPN} fail.

Quoted 10 lines

Parsing recipes...WARNING: .../samhain-standalone.bb: Exception during build_dependencies for do_configure
WARNING: .../samhain-standalone.bb: Error during finalise of .../samhain-standalone.bb
ERROR: ExpansionError during parsing .../samhain-standalone.bb
Traceback (most recent call last):
  File "Var <MODE_NAME>", line 1, in <module>
bb.data_smart.ExpansionError: Failure expanding variable MODE_NAME, expression was ${@d.getVar('BPN').split('-')[1]} which triggered exception IndexError: list index out of range
The variable dependency chain for the failure is: MODE_NAME -> SAMHAIN_MODE -> do_configure

Simplify the setting of MODE_NAME and SAMHAIN_MODE by moving them from the inc file to the recipe files where we know their values.

Relevant commits to produce the error:
bitbake:
ee89ade5 cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location oe-core:
7c15e03dd3 bitbake.conf: Add BB_HASH_CODEPARSER_VALS

Quoted 7 lines

---
 recipes-ids/samhain/samhain-client.bb     | 3 +++ recipes-ids/samhain/samhain-server.bb     | 3 +++ recipes-ids/samhain/samhain-standalone.bb | 3 +++ recipes-ids/samhain/samhain.inc           | 8 --------

 4 files changed, 9 insertions(+), 8 deletions(-)
Quoted 6 lines

This is the second report I've seen of this. I'm wondering about changing the default PN dummy value in bitbake.conf to include a "-"...

Cheers,

Richard

Richards patch [1] fixes the parsing error too. So we can drop this one unless the simpler logic is worth taking it.

[1] https://lore.kernel.org/all/[email protected]/

Thanks Richard.

Regards
Max

#5 lore raw

Max,

Quoted 35 lines · Max Krummenacher

Am Freitag, dem 27.01.2023 um 16:14 +0000 schrieb Richard Purdie:

Quoted 34 lines · Max Krummenacher
Quoted 23 lines

From: Max Krummenacher <[email protected]>

OE-Core changed the cache handling which made the use of ${BPN} fail.

Quoted 10 lines

Parsing recipes...WARNING: .../samhain-standalone.bb: Exception during build_dependencies for do_configure
WARNING: .../samhain-standalone.bb: Error during finalise of .../samhain-standalone.bb
ERROR: ExpansionError during parsing .../samhain-standalone.bb
Traceback (most recent call last):
  File "Var <MODE_NAME>", line 1, in <module>
bb.data_smart.ExpansionError: Failure expanding variable MODE_NAME, expression was ${@d.getVar('BPN').split('-')[1]} which triggered exception IndexError: list index out of range
The variable dependency chain for the failure is: MODE_NAME -> SAMHAIN_MODE -> do_configure

Simplify the setting of MODE_NAME and SAMHAIN_MODE by moving them from the inc file to the recipe files where we know their values.

Relevant commits to produce the error:
bitbake:
ee89ade5 cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location oe-core:
7c15e03dd3 bitbake.conf: Add BB_HASH_CODEPARSER_VALS

Quoted 7 lines
---
  recipes-ids/samhain/samhain-client.bb     | 3 +++
  recipes-ids/samhain/samhain-server.bb     | 3 +++
  recipes-ids/samhain/samhain-standalone.bb | 3 +++
  recipes-ids/samhain/samhain.inc           | 8 --------
  4 files changed, 9 insertions(+), 8 deletions(-)

This is the second report I've seen of this. I'm wondering about changing the default PN dummy value in bitbake.conf to include a "-"...

Quoted 7 lines
Quoted 3 lines

Cheers,

Richard

Richards patch [1] fixes the parsing error too. So we can drop this one unless the simpler logic is worth taking it.

[1] https://lore.kernel.org/all/[email protected]/

I am going the simpler logic so I will be taking your patch.

thanks,
Armin

Quoted 16 lines

Thanks Richard.

Regards
Max

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#59087): https://lists.yoctoproject.org/g/yocto/message/59087
Mute This Topic: https://lists.yoctoproject.org/mt/96564509/3616698
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-