[PATCH 1/1] run clean task of BPN as well when cleaning PN

7 views
Skip to first unread message

Felix Moessbauer

unread,
Aug 20, 2025, 6:59:27 AMAug 20
to isar-...@googlegroups.com, Felix Moessbauer, Schmidt, Adriaan, ami...@ilbers.de, cedric.h...@siemens.com, Bezdeka, Florian, Koch, Stefan
The do_fetch_common_source task has a hidden dependency to having
the source package in isar apt. While this is modeled in bitbake (via
depends to ${BPN}:do_deploy_source), the source package is not there
anymore when running repo_del_package on the -native package.

This happens because the clean task on the -native package calls out to
repo_del_package, which also removes the source package. This deletion
remains hidden to bitbake, hence the ${PN}:do_dpkg_source is not
executed again and the do_fetch_common_source fails, as the source
package is not there anymore.

As it looks like there is no way in reprepro to not delete the source
package, we simply fix it by adding a dependency to BPN:do_clean in case
BPN != PN.

Fixes: 2ca3a7e5 ("dpkg-source: Build source package only once")
Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
meta/classes/dpkg-source.bbclass | 1 +
1 file changed, 1 insertion(+)

diff --git a/meta/classes/dpkg-source.bbclass b/meta/classes/dpkg-source.bbclass
index a2eb37a4..20c082f6 100644
--- a/meta/classes/dpkg-source.bbclass
+++ b/meta/classes/dpkg-source.bbclass
@@ -79,3 +79,4 @@ do_fetch_common_source() {
addtask fetch_common_source

do_dpkg_build[depends] += "${@'${PN}:do_dpkg_source' if '${PN}' == '${BPN}' else '${PN}:do_fetch_common_source'}"
+do_clean[depends] += "${@'${BPN}:do_clean' if d.getVar('PN') != d.getVar('BPN') else ''}"
--
2.50.1

Jan Kiszka

unread,
Aug 20, 2025, 12:19:49 PMAug 20
to Felix Moessbauer, isar-...@googlegroups.com, Schmidt, Adriaan, ami...@ilbers.de, cedric.h...@siemens.com, Bezdeka, Florian, Koch, Stefan
For the sake of have both neighboring lines in the same visual and
logical style, please use the same test as above.

Makes sense otherwise.

Jan

--
Siemens AG, Foundational Technologies
Linux Expert Center

Felix Moessbauer

unread,
Aug 21, 2025, 4:50:40 AMAug 21
to isar-...@googlegroups.com, adriaan...@siemens.com, ami...@ilbers.de, cedric.h...@siemens.com, florian...@siemens.com, stefa...@siemens.com, jan.k...@siemens.com, Felix Moessbauer
The do_fetch_common_source task has a hidden dependency to having
the source package in isar apt. While this is modeled in bitbake (via
depends to ${BPN}:do_deploy_source), the source package is not there
anymore when running repo_del_package on the -native package.

This happens because the clean task on the -native package calls out to
repo_del_package, which also removes the source package. This deletion
remains hidden to bitbake, hence the ${PN}:do_dpkg_source is not
executed again and the do_fetch_common_source fails, as the source
package is not there anymore.

As it looks like there is no way in reprepro to not delete the source
package, we simply fix it by adding a dependency to BPN:do_clean in case
BPN != PN.

Fixes: 2ca3a7e5 ("dpkg-source: Build source package only once")
Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
Changes since v1:

- align code style with line above

meta/classes/dpkg-source.bbclass | 1 +
1 file changed, 1 insertion(+)

diff --git a/meta/classes/dpkg-source.bbclass b/meta/classes/dpkg-source.bbclass
index a2eb37a4..489b33e2 100644
--- a/meta/classes/dpkg-source.bbclass
+++ b/meta/classes/dpkg-source.bbclass
@@ -79,3 +79,4 @@ do_fetch_common_source() {
addtask fetch_common_source

do_dpkg_build[depends] += "${@'${PN}:do_dpkg_source' if '${PN}' == '${BPN}' else '${PN}:do_fetch_common_source'}"
+do_clean[depends] += "${@'${BPN}:do_clean' if '${PN}' != '${BPN}' else ''}"
--
2.50.1

Jan Kiszka

unread,
Aug 21, 2025, 5:12:48 AMAug 21
to Felix Moessbauer, isar-...@googlegroups.com, adriaan...@siemens.com, ami...@ilbers.de, cedric.h...@siemens.com, florian...@siemens.com, stefa...@siemens.com
I rather meant using "if '${PN}' == '${BPN}'" here as well, reordering
the issued string then, of course.

Felix Moessbauer

unread,
Aug 21, 2025, 5:23:45 AMAug 21
to isar-...@googlegroups.com, adriaan...@siemens.com, ami...@ilbers.de, cedric.h...@siemens.com, florian...@siemens.com, stefa...@siemens.com, jan.k...@siemens.com, Felix Moessbauer
The do_fetch_common_source task has a hidden dependency to having
the source package in isar apt. While this is modeled in bitbake (via
depends to ${BPN}:do_deploy_source), the source package is not there
anymore when running repo_del_package on the -native package.

This happens because the clean task on the -native package calls out to
repo_del_package, which also removes the source package. This deletion
remains hidden to bitbake, hence the ${PN}:do_dpkg_source is not
executed again and the do_fetch_common_source fails, as the source
package is not there anymore.

As it looks like there is no way in reprepro to not delete the source
package, we simply fix it by adding a dependency to BPN:do_clean in case
BPN != PN.

Fixes: 2ca3a7e5 ("dpkg-source: Build source package only once")
Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
Changes since v2:

- use '==' in comparison to make it similar to the line above

Changes since v1:

- align code style with line above

meta/classes/dpkg-source.bbclass | 1 +
1 file changed, 1 insertion(+)

diff --git a/meta/classes/dpkg-source.bbclass b/meta/classes/dpkg-source.bbclass
index a2eb37a4..4877abd6 100644
--- a/meta/classes/dpkg-source.bbclass
+++ b/meta/classes/dpkg-source.bbclass
@@ -79,3 +79,4 @@ do_fetch_common_source() {
addtask fetch_common_source

do_dpkg_build[depends] += "${@'${PN}:do_dpkg_source' if '${PN}' == '${BPN}' else '${PN}:do_fetch_common_source'}"
+do_clean[depends] += "${@'' if '${PN}' == '${BPN}' else '${BPN}:do_clean'}"
--
2.50.1

Jan Kiszka

unread,
Aug 21, 2025, 5:24:51 AMAug 21
to Felix Moessbauer, isar-...@googlegroups.com, adriaan...@siemens.com, ami...@ilbers.de, cedric.h...@siemens.com, florian...@siemens.com, stefa...@siemens.com
Reviewed-by: Jan Kiszka <jan.k...@siemens.com>

Thanks,
Reply all
Reply to author
Forward
0 new messages