Skip to contentSkip to conversation

Ensure sdk.py knows about nativesdk-intercepts

PATCH New Eilís 'pidge' Ní Fhlannagáin 1 participant 3 messages Sep 12, 2023

lore
Share & tools
lore
#0 lore raw

cover Ensure sdk.py knows about nativesdk-intercepts

This patch series ensures that do_populate_sdk knows about nativesdk-intercepts. It also ensures that debian builds work with update_mandb.

Eilís 'pidge' Ní Fhlannagáin (2):
lib/oe/package_managegment: Add nativesdk-intercept PATH
update_mandb: deb fails due to missing man cache

 meta/lib/oe/package_manager/deb/sdk.py   | 5 +++++
 meta/lib/oe/package_manager/ipk/sdk.py   | 5 +++++
 meta/lib/oe/package_manager/rpm/sdk.py   | 5 +++++
 scripts/postinst-intercepts/update_mandb | 2 ++
 4 files changed, 17 insertions(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 lib/oe/package_managegment: Add nativesdk-intercept PATH

[YOCTO #15023]

This patch adds (and removes after function execution) the nativesdk-intercept/chown|chgrp PATH before target_pm.run_intercepts calls during populate_sdk builds.

This has been tested with cleanall builds and testsdk and fails on deb due to an issue where $D${localstatedir}/cache/man/ does not exist for some reason. I've a work around for that in the next patch in this series.

---
 meta/lib/oe/package_manager/deb/sdk.py | 5 +++++
 meta/lib/oe/package_manager/ipk/sdk.py | 5 +++++
 meta/lib/oe/package_manager/rpm/sdk.py | 5 +++++
 3 files changed, 15 insertions(+)
meta/lib/oe/package_manager/deb/sdk.py +5 -0
index 653e42ab3c0..6f3005053eb 100644
@@ -69,7 +69,12 @@ class PkgSdk(Sdk):
 
         self.target_pm.run_pre_post_installs()
 
+        env_bkp = os.environ.copy()
+        os.environ['PATH'] = self.d.expand("${COREBASE}/scripts/nativesdk-intercept") + \
+                             os.pathsep + os.environ["PATH"]
+
         self.target_pm.run_intercepts(populate_sdk='target')
+        os.environ.update(env_bkp)
 
         execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
 
meta/lib/oe/package_manager/ipk/sdk.py +5 -0
index 6a1f167fb77..cc7a7ede547 100644
@@ -63,7 +63,12 @@ class PkgSdk(Sdk):
 
         self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
 
+        env_bkp = os.environ.copy()
+        os.environ['PATH'] = self.d.expand("${COREBASE}/scripts/nativesdk-intercept") + \
+                             os.pathsep + os.environ["PATH"]
+
         self.target_pm.run_intercepts(populate_sdk='target')
+        os.environ.update(env_bkp)
 
         execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
 
meta/lib/oe/package_manager/rpm/sdk.py +5 -0
index 85df6e949cc..ea79fe050bc 100644
@@ -67,7 +67,12 @@ class PkgSdk(Sdk):
 
         self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
 
+        env_bkp = os.environ.copy()
+        os.environ['PATH'] = self.d.expand("${COREBASE}/scripts/nativesdk-intercept") + \
+                             os.pathsep + os.environ["PATH"]
+
         self.target_pm.run_intercepts(populate_sdk='target')
+        os.environ.update(env_bkp)
 
         execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
 
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/2 update_mandb: deb fails due to missing man cache

In reply to Eilís 'pidge' Ní Fhlannagáin

This only occurs in debian package builds when populating the sdk and is a work around that seems to work. Eventually we should look at why this is failing (I have ideas, it's somewhere in lib/oe/package_management/deb/sdk.py), but for now, do this so we can fix the core issue with nativesdk-intercepts.

---
 scripts/postinst-intercepts/update_mandb | 2 ++
 1 file changed, 2 insertions(+)
scripts/postinst-intercepts/update_mandb +2 -0
index a061bb426a6..f91bafdb117 100644
@@ -9,6 +9,8 @@ set -eu
 CONFIG=$(mktemp --tmpdir update-mandb.XXXXX)
 sed "s:\(\s\)/:\1$D/:g" $D${sysconfdir}/man_db.conf > $CONFIG
 
+mkdir -p $D${localstatedir}/cache/man/
+
 PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${bindir}/mandb --config-file $CONFIG --create
 
 rm -f $CONFIG
Signature · 1 line
2.34.1