new file mode 100644
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+%:
+ dh \$@
+
+# Detect cross-compilation and fail if so
+override_dh_auto_configure:
+ @if [ "$(DEB_BUILD_ARCH)" != "$(DEB_HOST_ARCH)" ]; then \
+ echo "Cross-compilation detected! This is an \"all\" package."; \
+ exit 1; \
+ fi
+ dh_auto_configure
new file mode 100644
@@ -0,0 +1,11 @@
+# Test package using dpkg-raw
+
+SRC_URI = "file://rules"
+
+inherit dpkg-raw
+
+DEPENDS = "test-any-nocross"
+
+do_install() {
+ bbnote "Test \"all\" package which depends on an any package."
+}
new file mode 100644
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+%:
+ dh \$@
+
+# Detect cross-compilation and fail if so
+override_dh_auto_configure:
+ @if [ "$(DEB_BUILD_ARCH)" != "$(DEB_HOST_ARCH)" ]; then \
+ echo "Cross-compilation detected! This is an \"all\" package."; \
+ exit 1; \
+ fi
+ dh_auto_configure
new file mode 100644
@@ -0,0 +1,11 @@
+# Test all package using dpkg-raw
+
+SRC_URI = "file://rules"
+
+inherit dpkg-raw
+
+DEPENDS = "test-any-onlycross"
+
+do_install() {
+ bbnote "Test \"all\" package which depends on an any package."
+}
new file mode 100644
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+%:
+ dh \$@
+
+# Detect cross-compilation and fail if so
+override_dh_auto_configure:
+ @if [ "$(DEB_BUILD_ARCH)" != "$(DEB_HOST_ARCH)" ]; then \
+ echo "Cross-compilation detected!"; \
+ exit 1; \
+ fi
+ dh_auto_configure
new file mode 100644
@@ -0,0 +1,11 @@
+# Test package using dpkg-raw, which breaks when trying to cross
+# compile
+
+SRC_URI = "file://rules"
+
+inherit dpkg-raw
+DPKG_ARCH = "any"
+
+do_install() {
+ bbnote "Test \"any\" package which fails crosscompile."
+}
new file mode 100644
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+%:
+ dh \$@
+
+# Detect native compilation and fail if so
+override_dh_auto_configure:
+ if [ "$(DEB_BUILD_ARCH)" = "$(DEB_HOST_ARCH)" ]; then \
+ echo "Native compilation detected!"; \
+ exit 1; \
+ fi
+ dh_auto_configure
new file mode 100644
@@ -0,0 +1,13 @@
+# Test package using dpkg-raw, which breaks when trying to cross
+# compile
+
+#MAINTAINER = "Your name here <you@domain.com>"
+
+SRC_URI = "file://rules"
+
+inherit dpkg-raw
+DPKG_ARCH = "any"
+
+do_install() {
+ bbnote "Test \"any\" package which fails native compile."
+}
@@ -255,6 +255,17 @@ class CrossTest(CIBaseTest):
self.init()
self.perform_build_test(targets)
+ def test_cross_dependencies(self):
+ targets = [
+ 'mc:qemuarm64-bookworm:isar-image-ci',
+ ]
+
+ lines = [f"IMAGER_BUILD_DEPS:append = ' test-all-depnocross-native'",
+ f"IMAGE_INSTALL:append = ' test-all-deponlycross'",
+ ]
+
+ self.init()
+ self.perform_build_test(targets, lines=lines)
class KernelTests(CIBaseTest):
"""
Create two transitive dependency chains with simple dpkg-raw packages as follows: image -> all package -> any package imager -> all package as -native -> any package as -native Assert that - the all package is always build for the host architecture - the dependent any package in the cross chain is built for target arch only - the dependent any package in the native chain is built for host arch only by detecting any undesired host/target architecture combination in the override_dh_auto_configure function and exiting with an error. Signed-off-by: Andreas Naumann <anaumann@emlix.com> --- .../recipes-app/test-all-depnocross/files/rules | 11 +++++++++++ .../test-all-depnocross/test-all-depnocross.bb | 11 +++++++++++ .../recipes-app/test-all-deponlycross/files/rules | 11 +++++++++++ .../test-all-deponlycross/test-all-deponlycross.bb | 11 +++++++++++ meta-test/recipes-app/test-any-nocross/files/rules | 11 +++++++++++ .../test-any-nocross/test-any-nocross.bb | 11 +++++++++++ .../recipes-app/test-any-onlycross/files/rules | 11 +++++++++++ .../test-any-onlycross/test-any-onlycross.bb | 13 +++++++++++++ testsuite/citest.py | 11 +++++++++++ 9 files changed, 101 insertions(+) create mode 100644 meta-test/recipes-app/test-all-depnocross/files/rules create mode 100644 meta-test/recipes-app/test-all-depnocross/test-all-depnocross.bb create mode 100644 meta-test/recipes-app/test-all-deponlycross/files/rules create mode 100644 meta-test/recipes-app/test-all-deponlycross/test-all-deponlycross.bb create mode 100644 meta-test/recipes-app/test-any-nocross/files/rules create mode 100644 meta-test/recipes-app/test-any-nocross/test-any-nocross.bb create mode 100644 meta-test/recipes-app/test-any-onlycross/files/rules create mode 100644 meta-test/recipes-app/test-any-onlycross/test-any-onlycross.bb