poky/meta/classes-recipe
Martin Jansa 52ba7ab020 cross.bbclass: Propagate dependencies to outhash
Similar to what native and staging is doing since:
https://git.openembedded.org/openembedded-core/commit/meta/classes/native.bbclass?id=d6c7b9f4f0e61fa6546d3644e27abe3e96f597e2
https://git.openembedded.org/openembedded-core/commit/meta/classes/staging.bbclass?id=1cf62882bbac543960e4815d117ffce0e53bda07

Cross task outputs can call native dependencies and even when cross
recipe output doesn't change it might produce different results when
the called native dependency is changed, e.g. clang-cross-${TARGET_ARCH}
contains symlink to clang binary from clang-native, but when clang-native
outhash is changed, clang-cross-${TARGET_ARCH} will still be considered
equivalent and target recipes aren't rebuilt with new clang binary, see
work around in https://github.com/kraj/meta-clang/pull/1140 to make target
recipes to depend directly not only on clang-cross-${TARGET_ARCH} but
clang-native as well.

I have added a small testcase in meta-selftest which demostrates this issue.
Not included in this change, but will send it if useful.

openembedded-core $ ls -1 meta-selftest/recipes-devtools/hashequiv-test/
print-datetime-link-cross.bb
print-datetime-link-native.bb
print-datetime-native.bb
print-datetime-usecross.bb
print-datetime-usenative.bb

print-datetime-native provides script which prints defined PRINT_DATETIME variable.

print-datetime-link-native and print-datetime-link-cross both provide a symlink to
the script from print-datetime-native.

print-datetime-usenative and print-datetime-usecross are target recipes using the
native and cross versions of print-datetime-link-* recipe.

  # clean build all is rebuilt:
  $ bitbake -k print-datetime-usenative print-datetime-usecross
  WARNING: print-datetime-native-1.0-r0 do_install: print-datetime-native current DATETIME in script is 2025-11-13_20_05
  WARNING: print-datetime-link-native-1.0-r0 do_install: print-datetime-link-native current DATETIME in symlink is 2025-11-13_20_05
  WARNING: print-datetime-link-cross-x86_64-1.0-r0 do_install: print-datetime-link-cross-x86_64 current DATETIME in symlink is 2025-11-13_20_05
  WARNING: print-datetime-usenative-1.0-r0 do_install: print-datetime-usenative current DATETIME from print-datetime-link is 2025-11-13_20_05
  WARNING: print-datetime-usecross-1.0-r0 do_install: print-datetime-usecross current DATETIME from print-datetime-link is 2025-11-13_20_05

  # keep sstate-cache and hashserv.db:
  # print-datetime-usenative is correctly rebuilt, because print-datetime-link-native has different hash (because print-datetime-native hash changed)
  # print-datetime-usecross wasn't rebuilt, because print-datetime-link-cross-x86_64 doesn't include the changed hash of print-datetime-native
  $ bitbake -k print-datetime-usenative print-datetime-usecross
  WARNING: print-datetime-native-1.0-r0 do_install: print-datetime-native current DATETIME in script is 2025-11-13_20_07
  WARNING: print-datetime-link-native-1.0-r0 do_install: print-datetime-link-native current DATETIME in symlink is 2025-11-13_20_07
  WARNING: print-datetime-link-cross-x86_64-1.0-r0 do_install: print-datetime-link-cross-x86_64 current DATETIME in symlink is 2025-11-13_20_07
  WARNING: print-datetime-usenative-1.0-r0 do_install: print-datetime-usenative current DATETIME from print-datetime-link is 2025-11-13_20_07

It's because print-datetime-link-cross-x86_64 depsig doesn't include print-datetime-native signature:

$ cat tmp/work/x86_64-linux/print-datetime-link-cross-x86_64/1.0/temp/depsig.do_populate_sysroot
OEOuthashBasic
18
SSTATE_PKGSPEC=sstate:print-datetime-link-cross-x86_64:x86_64-oe-linux:1.0:r0:x86_64:14:
task=populate_sysroot
drwx                                                                                       .
drwx                                                                                       ./recipe-sysroot-native
drwx                                                                                       ./recipe-sysroot-native/sysroot-providers
-rw-                   32 19fbeb373f781c2504453c1ca04dab018a7bc8388c87f4bbc59589df31523d07 ./recipe-sysroot-native/sysroot-providers/print-datetime-link-cross-x86_64
drwx                                                                                       ./recipe-sysroot-native/usr
drwx                                                                                       ./recipe-sysroot-native/usr/bin
drwx                                                                                       ./recipe-sysroot-native/usr/bin/x86_64-oe-linux
lrwx                                                                                       ./recipe-sysroot-native/usr/bin/x86_64-oe-linux/print-datetime-link -> ../print-datetime

While print-datetime-link-native doesn't have this issue, because print-datetime-native signature is there:

$ cat tmp/work/x86_64-linux/print-datetime-link-native/1.0/temp/depsig.do_populate_sysroot
OEOuthashBasic
18
print-datetime-native: 60f2734a63d708489570ca719413b4662f8368abc9f4760a279a0a5481e4a17b
quilt-native: 65d78a7a5b5cbbf0969798efe558ca28e7ef058f4232fcff266912d16f67a8b8
SSTATE_PKGSPEC=sstate:print-datetime-link-native:x86_64-linux:1.0:r0:x86_64:14:
task=populate_sysroot
drwx                                                                                       .
drwx                                                                                       ./recipe-sysroot-native
drwx                                                                                       ./recipe-sysroot-native/sysroot-providers
-rw-                   26 3d5458be834b2d0e4c65466b9b877d6028ae2210a56399284a23144818666f10 ./recipe-sysroot-native/sysroot-providers/print-datetime-link-native
drwx                                                                                       ./recipe-sysroot-native/usr
drwx                                                                                       ./recipe-sysroot-native/usr/bin
lrwx                                                                                       ./recipe-sysroot-native/usr/bin/print-datetime-link -> print-datetime

With the cross.bbclass fix the link-cross recipe has a checksum from native recipe as well:

$ cat tmp/work/x86_64-linux/print-datetime-link-cross-x86_64/1.0/temp/depsig.do_populate_sysroot
OEOuthashBasic
18
print-datetime-native: 9ceb6c27342eae6b8da86c84685af38fb8927ccc19979aae75b8b1e444b11c5c
quilt-native: 65d78a7a5b5cbbf0969798efe558ca28e7ef058f4232fcff266912d16f67a8b8
SSTATE_PKGSPEC=sstate:print-datetime-link-cross-x86_64:x86_64-oe-linux:1.0:r0:x86_64:14:
task=populate_sysroot
drwx                                                                                       .
drwx                                                                                       ./recipe-sysroot-native
drwx                                                                                       ./recipe-sysroot-native/sysroot-providers
-rw-                   32 19fbeb373f781c2504453c1ca04dab018a7bc8388c87f4bbc59589df31523d07 ./recipe-sysroot-native/sysroot-providers/print-datetime-link-cross-x86_64
drwx                                                                                       ./recipe-sysroot-native/usr
drwx                                                                                       ./recipe-sysroot-native/usr/bin
drwx                                                                                       ./recipe-sysroot-native/usr/bin/x86_64-oe-linux
lrwx                                                                                       ./recipe-sysroot-native/usr/bin/x86_64-oe-linux/print-datetime-link -> ../print-datetime

And print-datetime-usecross is correctly rebuilt whenever print-datetime-native output is different.

(From OE-Core rev: dccb7a185fe58a97f33e219b4db283ff4a2071d7)

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2025-12-31 07:49:31 -08:00
..
allarch.bbclass allarch: Fix allarch corner case 2024-01-18 10:15:58 +00:00
autotools-brokensep.bbclass
autotools.bbclass autotools: update link in comment for cross compiling 2024-04-04 14:05:03 +01:00
baremetal-image.bbclass classes-recipe/baremetal-image: Add image file manifest 2025-11-14 06:45:29 -08:00
bash-completion.bbclass
bin_package.bbclass Revert "bin_package.bbclass: Inhibit the default dependencies" 2023-10-30 08:50:46 +00:00
binconfig-disabled.bbclass
binconfig.bbclass
cargo_c.bbclass classes-recipe: add cargo_c.bbclass 2023-08-21 16:15:35 +01:00
cargo_common.bbclass cargo: remove True option to getVar calls 2024-07-12 05:47:20 -07:00
cargo-update-recipe-crates.bbclass cargo-update-recipe-crates.bbclass: Do not add name= to crate:// URIs 2023-04-06 14:28:59 +01:00
cargo.bbclass cargo: Move CARGO_MANIFEST_PATH/CARGO_SRC_DIR to cargo_common 2023-12-09 19:17:11 +00:00
cmake-qemu.bbclass cmake-qemu.bbclass: fix if criterion 2024-08-01 06:08:09 -07:00
cmake.bbclass cmake: apply parallel build settings to ptest tasks 2025-02-14 06:38:54 -08:00
cml1.bbclass cml1.bbclass: use consistent make flags for menuconfig 2025-12-31 07:49:31 -08:00
compress_doc.bbclass
core-image.bbclass Fix missing leading whitespace with ':append' 2023-01-26 21:06:57 +00:00
cpan_build.bbclass
cpan-base.bbclass
cpan.bbclass
create-spdx-image-3.0.bbclass backport: SPDX 3.0 fixes and tasks from upstream version Walnascar 2025-11-14 06:45:29 -08:00
create-spdx-sdk-3.0.bbclass backport: SPDX 3.0 fixes and tasks from upstream version Walnascar 2025-11-14 06:45:29 -08:00
cross-canadian.bbclass
cross.bbclass cross.bbclass: Propagate dependencies to outhash 2025-12-31 07:49:31 -08:00
crosssdk.bbclass
deploy.bbclass
devicetree.bbclass devicetree.bbclass: Allow selection of dts files to build 2023-05-04 12:37:00 +01:00
devupstream.bbclass recipes/classes/scripts: Drop SRCPV usage in OE-Core 2023-08-24 16:50:24 +01:00
distro_features_check.bbclass
dos2unix.bbclass
features_check.bbclass
fontcache.bbclass fontcache.bbclass: avoid native recipes depending on target fontconfig 2023-09-20 23:51:11 +01:00
fs-uuid.bbclass classes/fs-uuid: Fix command output decoding issue 2023-01-26 22:22:53 +00:00
gconf.bbclass
gettext.bbclass
gi-docgen.bbclass gi-docgen: depend on qemu-usermode MACHINE_FEATURES 2023-08-21 11:34:12 +01:00
gio-module-cache.bbclass
github-releases.bbclass github-releases: add a class that consolidates version checks 2022-09-28 08:01:10 +01:00
gnomebase.bbclass classes/recipes: Switch to use inherit_defer 2024-01-18 10:15:58 +00:00
go-mod.bbclass classes: go-mod: do not pack go mod cache 2023-11-20 15:30:52 +00:00
go-ptest.bbclass
go.bbclass go: Drop the linkmode completely 2024-05-23 08:55:01 -07:00
goarch.bbclass goarch.bbclass: do not leak TUNE_FEATURES into crosssdk task signatures 2025-11-26 07:50:35 -08:00
gobject-introspection-data.bbclass gobject-introspection-data.bbclass: move do_compile() tweak to g-i class 2024-01-19 12:21:22 +00:00
gobject-introspection.bbclass gobject-introspection-data.bbclass: move do_compile() tweak to g-i class 2024-01-19 12:21:22 +00:00
grub-efi-cfg.bbclass
grub-efi.bbclass
gsettings.bbclass
gtk-doc.bbclass gtk-doc: don't manually call gtkdocize 2024-01-12 11:54:05 +00:00
gtk-icon-cache.bbclass gtk-icon-cache: Fix GTKIC_CMD if-else condition 2022-09-29 08:05:24 +01:00
gtk-immodules-cache.bbclass
image_types_wic.bbclass bmaptool: now part of Yocto Project 2024-03-05 12:24:50 +00:00
image_types.bbclass image_types.bbclass: Use --force also with lz4,lzop 2024-08-19 06:09:14 -07:00
image-artifact-names.bbclass image-artifact-names: include ${IMAGE_NAME_SUFFIX} directly in both ${IMAGE_NAME} and ${IMAGE_LINK_NAME} 2023-06-29 11:28:32 +01:00
image-combined-dbg.bbclass classes: Drop ';' delimiter from ROOTFS/IMAGE*COMMAND variables 2023-09-09 22:14:41 +01:00
image-container.bbclass
image-live.bbclass image-live.bbclass: Adjust the default value for INITRD_LIVE 2024-04-04 14:05:03 +01:00
image-postinst-intercepts.bbclass
image.bbclass classes-recipe/image: Add image file manifest 2025-11-14 06:45:29 -08:00
kernel-arch.bbclass kernel-arch: add macro-prefix-map in KERNEL_CC 2025-04-01 09:08:43 -07:00
kernel-artifact-names.bbclass image-artifact-names: add IMAGE_MACHINE_SUFFIX variable 2023-03-22 13:53:29 +00:00
kernel-devicetree.bbclass kernel-devicetree: install dtb files without -${KERNEL_DTB_NAME} suffix 2023-06-29 11:28:32 +01:00
kernel-fitimage.bbclass u-boot: kernel-fitimage: Fix dependency loop if UBOOT_SIGN_ENABLE and UBOOT_ENV enabled 2025-02-03 06:13:13 -08:00
kernel-grub.bbclass
kernel-module-split.bbclass kernel-module-split.bbclass: enhance objcopy command call for kernel compilation with llvm 2024-03-26 17:10:51 +00:00
kernel-uboot.bbclass kernel: Add kernel specific OBJDUMP 2023-03-01 21:29:31 +00:00
kernel-uimage.bbclass
kernel-yocto.bbclass kernel-yocto: improve metadata patching 2023-11-09 16:57:26 +00:00
kernel.bbclass cml1.bbclass: use consistent make flags for menuconfig 2025-12-31 07:49:31 -08:00
kernelsrc.bbclass kernel: make LOCALVERSION consistent between recipes 2023-07-25 15:27:33 +01:00
lib_package.bbclass
libc-package.bbclass libc-locale: fix ASCII compatible warning cause build failure. 2024-02-29 10:26:13 +00:00
license_image.bbclass classes-global/license: Move functions to library code 2025-11-14 06:45:29 -08:00
linux-dummy.bbclass
linux-kernel-base.bbclass kernel: make LOCALVERSION consistent between recipes 2023-07-25 15:27:33 +01:00
linuxloader.bbclass linuxloader: add -armhf on arm only for TARGET_FPU 'hard' 2024-07-03 06:28:37 -07:00
live-vm-common.bbclass classes/recipes: Switch to use inherit_defer 2024-01-18 10:15:58 +00:00
manpages.bbclass manpages: use an intercept to run mandb 2023-03-08 10:21:05 +00:00
meson-routines.bbclass Revert "meson: use absolute cross-compiler paths" 2024-02-23 14:29:03 +00:00
meson.bbclass Revert "meson: use absolute cross-compiler paths" 2024-02-23 14:29:03 +00:00
mime-xdg.bbclass
mime.bbclass
module-base.bbclass kernel: make LOCALVERSION consistent between recipes 2023-07-25 15:27:33 +01:00
module.bbclass module.bbclass: add KBUILD_EXTRA_SYMBOLS to install 2025-05-19 08:32:49 -07:00
multilib_header.bbclass
multilib_script.bbclass multilib_script.bbclass: expand script name as well 2023-09-28 12:37:47 +01:00
native.bbclass native.bbclass: base_libdir unique from libdir 2024-01-26 16:41:25 +00:00
nativesdk.bbclass classes/nativesdk: also override TUNE_PKGARCH 2025-01-24 07:59:39 -08:00
nopackages.bbclass
nospdx.bbclass backport: SPDX 3.0 fixes and tasks from upstream version Walnascar 2025-11-14 06:45:29 -08:00
npm.bbclass classe-recipes: npm: Add support for dependencies and devDependencies 2023-06-29 11:10:39 +01:00
overlayfs-etc.bbclass overlayfs-etc: add option to skip creation of mount dirs 2024-02-19 15:21:14 +00:00
overlayfs.bbclass overlayfs: add missing vardeps 2024-02-21 22:20:10 +00:00
packagegroup.bbclass classes/recipes: Switch to use inherit_defer 2024-01-18 10:15:58 +00:00
perl-version.bbclass perl-version: remove PERL* assignments 2023-05-04 12:34:30 +01:00
perlnative.bbclass
pixbufcache.bbclass
pkgconfig.bbclass
populate_sdk_base.bbclass populate_sdk_base: inherit nopackages 2024-10-11 05:47:38 -07:00
populate_sdk_ext.bbclass populate_sdk_ext: write_local_conf add shutil import 2025-01-09 06:25:36 -08:00
populate_sdk.bbclass
ptest-cargo.bbclass cargo: remove True option to getVar calls 2024-07-12 05:47:20 -07:00
ptest-gnome.bbclass
ptest-perl.bbclass
ptest.bbclass ptest.bbclass: Handle the case when Makefile does not exist in do_install_ptest_base 2024-02-08 10:59:06 +00:00
pypi.bbclass pypi.bbclass: Update the upstream checks to automatically replace '_' with '-' 2023-09-22 07:45:17 +01:00
python_flit_core.bbclass
python_hatchling.bbclass python_hatchling: remove empty python sysroot dirs 2023-06-02 14:41:50 +01:00
python_maturin.bbclass classes-recipe: add python_maturin.bbclass 2023-12-17 19:07:21 +00:00
python_mesonpy.bbclass python_mesonpy.bbclass: move from meta-python 2024-02-20 11:39:45 +00:00
python_pep517.bbclass python3_pip517: just count wheels in the directory, not subdirectories 2024-03-22 16:27:48 +00:00
python_poetry_core.bbclass
python_pyo3.bbclass
python_setuptools_build_meta.bbclass
python_setuptools3_rust.bbclass python_setuptools3_rust: inherit ...build_meta 2023-07-25 15:27:33 +01:00
python3-dir.bbclass python: update 3.11.5 -> 3.12.1 2024-01-19 12:21:22 +00:00
python3native.bbclass
python3targetconfig.bbclass python3targetconfig.bbclass: Extend PYTHONPATH instead of overwriting 2023-05-05 11:07:25 +01:00
qemu.bbclass classes/qemu: use tune to select QEMU_EXTRAOPTIONS, not package architecture 2025-01-24 07:59:39 -08:00
qemuboot.bbclass qemuboot: Trigger write_qemuboot_conf task on changes of kernel image realpath 2024-08-26 05:18:44 -07:00
rootfs_deb.bbclass
rootfs_ipk.bbclass rootfs: Fix MULTILIB_RE_ALLOW to be inherit order independent 2024-01-18 10:15:58 +00:00
rootfs_rpm.bbclass rootfs_rpm: don't depend on opkg-native for update-alternatives 2023-07-10 11:36:34 +01:00
rootfs-postcommands.bbclass rootfs-postcommands.bbclass: make opkg status reproducible 2024-10-30 08:30:00 -07:00
rootfsdebugfiles.bbclass classes: Drop ';' delimiter from ROOTFS/IMAGE*COMMAND variables 2023-09-09 22:14:41 +01:00
rust-common.bbclass rust-common.bbclass: soft assignment for RUSTLIB path 2025-02-12 06:25:37 -08:00
rust-target-config.bbclass rust-target-config: fix nativesdk-libstd-rs build with baremetal 2025-11-26 07:50:35 -08:00
rust.bbclass
scons.bbclass scons.bbclass: Make MAXLINELENGTH overridable 2023-02-04 17:02:10 +00:00
setuptools3_legacy.bbclass python: Drop ${PYTHON_PN} 2024-02-20 11:39:45 +00:00
setuptools3-base.bbclass python: Drop ${PYTHON_PN} 2024-02-20 11:39:45 +00:00
setuptools3.bbclass python: Drop ${PYTHON_PN} 2024-02-20 11:39:45 +00:00
siteinfo.bbclass siteinfo.bbclass: add support for darwin19 and darwin21 2024-01-15 21:42:15 +00:00
syslinux.bbclass
systemd-boot-cfg.bbclass systemd-boot-cfg: add .conf suffix to default entry label 2023-09-26 10:35:28 +01:00
systemd-boot.bbclass
systemd.bbclass systemd.bbclass: Clarify error message 2024-07-26 07:43:46 -07:00
testexport.bbclass testexport: fallback for empty IMAGE_LINK_NAME 2024-10-02 06:15:15 -07:00
testimage.bbclass testimage: get real os-release file 2025-06-13 08:58:01 -07:00
testsdk.bbclass testsdk: allow user to specify which tests to run 2025-11-26 07:50:35 -08:00
texinfo.bbclass
toolchain-scripts-base.bbclass
toolchain-scripts.bbclass toolchain-scripts: Handle spaces within user $PATH 2023-03-11 00:08:41 +00:00
uboot-config.bbclass uboot: Allow for customizing installed/deployed file names 2025-07-07 07:42:58 -07:00
uboot-extlinux-config.bbclass uboot-extlinux-config.bbclass: fix missed override syntax migration 2023-10-05 21:09:10 +01:00
uboot-sign.bbclass u-boot: ensure keys are generated before assembling U-Boot FIT image 2025-06-02 07:12:34 -07:00
update-alternatives.bbclass update-alternatives.bbclass: fix old override syntax 2023-05-03 07:33:18 +01:00
update-rc.d.bbclass recipes, classes: Avoid adding extra whitespace to PACKAGESPLITFUNCS 2023-01-12 23:08:58 +00:00
upstream-version-is-even.bbclass
vala.bbclass
waf.bbclass waf: Improve version parsing to avoid failing on warnings 2024-03-01 09:31:10 +00:00
xmlcatalog.bbclass xmlcatalog: limit to native recipes only 2024-01-12 11:54:05 +00:00