From 37d83ae111a55e62ad4a6a0c4b7e42da2fda1584 Mon Sep 17 00:00:00 2001 From: Richard Elberger Date: Mon, 27 Apr 2026 10:58:01 -0400 Subject: [PATCH] aws-greengrass-component-sdk: remove stale v1.0.1 recipe and patches These files were superseded by the v1.0.2 upgrade on master-next but remain on master due to divergent history from a prior force-push. Remove them so the master-next to master release merge is clean. --- .../aws-greengrass-component-sdk_1.0.1.bb | 265 ------------------ ...cklist-and-portable-struct-for-cross.patch | 42 --- ...-timespec-types-for-32-bit-platforms.patch | 32 --- 3 files changed, 339 deletions(-) delete mode 100644 recipes-sdk/aws-greengrass-component-sdk/aws-greengrass-component-sdk_1.0.1.bb delete mode 100644 recipes-sdk/aws-greengrass-component-sdk/files/0001-Add-timespec-blocklist-and-portable-struct-for-cross.patch delete mode 100644 recipes-sdk/aws-greengrass-component-sdk/files/0002-Fix-timespec-types-for-32-bit-platforms.patch diff --git a/recipes-sdk/aws-greengrass-component-sdk/aws-greengrass-component-sdk_1.0.1.bb b/recipes-sdk/aws-greengrass-component-sdk/aws-greengrass-component-sdk_1.0.1.bb deleted file mode 100644 index dee3648afe..0000000000 --- a/recipes-sdk/aws-greengrass-component-sdk/aws-greengrass-component-sdk_1.0.1.bb +++ /dev/null @@ -1,265 +0,0 @@ -SUMMARY = "AWS Greengrass Component SDK - Lightweight AWS IoT Greengrass SDK" -DESCRIPTION = "The aws-greengrass-component-sdk provides an API for making AWS IoT Greengrass IPC \ -calls with a small footprint. It enables Greengrass components to interact with \ -the Greengrass Nucleus with less binary overhead and supports components written in C." -HOMEPAGE = "https://github.com/aws-greengrass/aws-greengrass-component-sdk" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=34400b68072d710fecd0a2940a0d1658" - -SRCREV = "1e2495b4e7a616d35b374bba4635a95dbb678b95" -SRC_URI = "git://github.com/aws-greengrass/aws-greengrass-component-sdk.git;protocol=https;branch=main \ - file://0001-Add-timespec-blocklist-and-portable-struct-for-cross.patch \ - file://0004-Disable-strip-in-Cargo-profile.patch \ -" - -# nooelint: oelint.vars.specific -SRC_URI:append:arm = " file://0002-Fix-timespec-types-for-32-bit-platforms.patch" - -inherit cmake ptest cargo cargo-update-recipe-crates - -DEPENDS += "clang-native" - -CARGO_SRC_DIR = "rust" - -# Bindgen will regenerate c.rs at build time -do_configure:prepend() { - rm -f ${S}/rust/src/c.rs -} - -# Manual bindgen task for debugging (not called automatically) -# Usage: bitbake aws-greengrass-component-sdk -c create_bindings -do_create_bindings[depends] += "bindgen-cli-native:do_populate_sysroot clang-native:do_populate_sysroot" -do_create_bindings() { - ${STAGING_BINDIR_NATIVE}/bindgen ${S}/rust/wrapper.h -o ${S}/rust/src/c.rs \ - --allowlist-type "Gg.*" \ - --allowlist-function "gg_.*" \ - --allowlist-var "GG_.*" \ - -- -I${S}/include --target=${RUST_HOST_SYS} - bbnote "Generated bindings at ${S}/rust/src/c.rs" -} - -# Set LIBCLANG_PATH for bindgen -export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}" - -# Set bindgen to use target sysroot -export BINDGEN_EXTRA_CLANG_ARGS = "--sysroot=${STAGING_DIR_TARGET} ${TARGET_CC_ARCH}" - -EXTRA_OECMAKE = " \ - -DCMAKE_BUILD_TYPE=MinSizeRel \ - -DBUILD_SHARED_LIBS=OFF \ - -DENABLE_WERROR=OFF \ -" - -PACKAGECONFIG ??= "rust samples" -PACKAGECONFIG[rust] = ",,," -PACKAGECONFIG[samples] = ",,," - -# default is stripped, we wanna do this by yocto -EXTRA_OECMAKE:append = " -DCMAKE_BUILD_TYPE=RelWithDebInfo" -EXTRA_OECMAKE:append = " ${@"-DBUILD_SAMPLES=ON" if bb.utils.contains("PACKAGECONFIG", "samples", True, False, d) else "-DBUILD_SAMPLES=OFF"}" - -DEBUG_PREFIX_MAP += "-ffile-prefix-map=${UNPACKDIR}=${TARGET_DBGSRC_DIR}" -DEBUG_PREFIX_MAP += "-ffile-prefix-map=${TMPDIR}=${TARGET_DBGSRC_DIR}" - -# Apply DEBUG_PREFIX_MAP to Rust builds via remap-path-prefix -RUSTFLAGS:append = " --remap-path-prefix=${UNPACKDIR}=${TARGET_DBGSRC_DIR} --remap-path-prefix=${TMPDIR}=${TARGET_DBGSRC_DIR}" - -# Ensure C code built by build.rs also gets the prefix map -export CFLAGS:append = " ${DEBUG_PREFIX_MAP}" -export CXXFLAGS:append = " ${DEBUG_PREFIX_MAP}" - -python () { - if bb.utils.contains('PACKAGECONFIG', 'rust', True, False, d): - require_file = d.expand('${BPN}-crates.inc') - bb.parse.mark_dependency(d, require_file) - include_file = os.path.join(os.path.dirname(d.getVar('FILE')), require_file) - if os.path.exists(include_file): - bb.parse.BBHandler.handle(include_file, d, True) -} - -do_configure:prepend() { - cmake_do_configure -} - -do_compile() { - cmake_do_compile - - if ${@bb.utils.contains('PACKAGECONFIG', 'rust', 'true', 'false', d)}; then - bbnote "Building Rust library" - cargo_do_compile - - if ${@bb.utils.contains('PACKAGECONFIG', 'samples', 'true', 'false', d)}; then - bbnote "Building Rust examples" - CARGO_BUILD_FLAGS="${CARGO_BUILD_FLAGS} --examples" cargo_do_compile - fi - fi -} - -SRC_URI:append = " file://run-ptest" - -do_install() { - cmake --install ${B} --prefix ${D}${prefix} - - # Install C/C++ sample binaries and component recipes - if ${@bb.utils.contains('PACKAGECONFIG', 'samples', 'true', 'false', d)}; then - install -d ${D}${bindir} - if [ -d "${B}/bin" ]; then - for sample in ${B}/bin/*; do - if [ -f "$sample" ]; then - install -m 0755 "$sample" ${D}${bindir}/ - fi - done - fi - - # Install component recipe JSONs for deployment reference - install -d ${D}${datadir}/greengrass/component-recipes - for recipe_json in ${S}/samples/*.json ${S}/cpp/samples/*.json; do - if [ -f "$recipe_json" ]; then - install -m 0644 "$recipe_json" ${D}${datadir}/greengrass/component-recipes/ - fi - done - fi - - if ${@bb.utils.contains('PACKAGECONFIG', 'rust', 'true', 'false', d)}; then - if ${@bb.utils.contains('PACKAGECONFIG', 'samples', 'true', 'false', d)}; then - if [ -d "${B}/target/${CARGO_TARGET_SUBDIR}/examples" ]; then - for example in ${B}/target/${CARGO_TARGET_SUBDIR}/examples/*; do - if [ -f "$example" ] && [ -x "$example" ] && [ ! "${example##*.}" = "d" ]; then - case "$(basename $example)" in - *-[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]) - continue - ;; - esac - install -m 0755 "$example" ${D}${bindir}/rust_$(basename $example) - fi - done - fi - - # Install Rust example component recipe JSONs - for recipe_json in ${S}/rust/examples/*.json; do - if [ -f "$recipe_json" ]; then - install -m 0644 "$recipe_json" ${D}${datadir}/greengrass/component-recipes/ - fi - done - fi - - # Install Rust shared library for runtime - install -d ${D}${libdir} - - # Install Rust rlib for compile-time - install -d ${D}${libdir}/rustlib/${RUST_HOST_SYS}/lib - install -m 0644 ${B}/target/${CARGO_TARGET_SUBDIR}/libgg_sdk.rlib ${D}${libdir}/rustlib/${RUST_HOST_SYS}/lib/ - if [ -f ${B}/target/${CARGO_TARGET_SUBDIR}/deps/libgg_sdk-*.rmeta ]; then - install -m 0644 ${B}/target/${CARGO_TARGET_SUBDIR}/deps/libgg_sdk-*.rmeta ${D}${libdir}/rustlib/${RUST_HOST_SYS}/lib/ - fi - - # Install C static library - install -m 0644 ${B}/target/${CARGO_TARGET_SUBDIR}/build/aws-greengrass-component-sdk-*/out/libgg-sdk.a ${D}${libdir}/ - - # Install headers - install -d ${D}${includedir}/gg - cp -r ${S}/include/gg/* ${D}${includedir}/gg/ - fi - - if [ ! -d "${D}${includedir}/gg" ]; then - install -d ${D}${includedir}/gg - cp -r ${S}/include/gg/* ${D}${includedir}/gg/ - fi - - # Install C++ headers and library - if [ -d "${S}/cpp/include" ]; then - cp -r ${S}/cpp/include/gg/* ${D}${includedir}/gg/ - if [ -f "${B}/cpp/libgg-sdk++.a" ]; then - install -m 0644 ${B}/cpp/libgg-sdk++.a ${D}${libdir}/ - fi - fi - - install -d ${D}${docdir}/${PN} - install -m 0644 ${S}/README.md ${D}${docdir}/${PN}/ - install -m 0644 ${S}/docs/BUILD.md ${D}${docdir}/${PN}/ - - # Strip debug info from static libraries to remove TMPDIR references - if [ -f "${D}${libdir}/libgg-sdk.a" ]; then - ${STRIP} --strip-debug ${D}${libdir}/libgg-sdk.a - fi - if [ -f "${D}${libdir}/libgg-sdk++.a" ]; then - ${STRIP} --strip-debug ${D}${libdir}/libgg-sdk++.a - fi - if [ -f "${D}${libdir}/rustlib/${RUST_HOST_SYS}/lib/libgg_sdk.rlib" ]; then - ${STRIP} --strip-debug ${D}${libdir}/rustlib/${RUST_HOST_SYS}/lib/libgg_sdk.rlib - fi -} - -do_install_ptest() { - install -m 0755 ${WORKDIR}/sources/run-ptest ${D}${PTEST_PATH}/ - - if ${@bb.utils.contains('PACKAGECONFIG', 'samples', 'true', 'false', d)}; then - if [ -d "${B}/bin" ]; then - for sample in ${B}/bin/*; do - if [ -f "$sample" ]; then - install -m 0755 "$sample" ${D}${PTEST_PATH}/ - fi - done - fi - - if ${@bb.utils.contains('PACKAGECONFIG', 'rust', 'true', 'false', d)}; then - if [ -d "${B}/target/${CARGO_TARGET_SUBDIR}/examples" ]; then - for example in ${B}/target/${CARGO_TARGET_SUBDIR}/examples/*; do - if [ -f "$example" ] && [ -x "$example" ] && [ ! "${example##*.}" = "d" ]; then - case "$(basename $example)" in - *-[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]) - continue - ;; - esac - install -m 0755 "$example" ${D}${PTEST_PATH}/rust_$(basename $example) - fi - done - fi - fi - fi - - rm -rf ${D}${PTEST_PATH}/.debug -} - -PACKAGES = "${PN} ${PN}-samples ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}-ptest ${PN}-dbg" - -FILES:${PN} = "" -ALLOW_EMPTY:${PN} = "1" - -FILES:${PN}-samples = " \ - ${bindir}/sample_* \ - ${bindir}/rust_* \ - ${datadir}/greengrass/component-recipes/* \ -" - -FILES:${PN}-dev = " \ - ${includedir}/gg/* \ - ${libdir}/rustlib/* \ -" - -FILES:${PN}-staticdev = " \ - ${libdir}/libgg-sdk.a \ - ${libdir}/libgg-sdk++.a \ -" - -FILES:${PN}-doc = " \ - ${docdir}/${PN}/* \ -" - -FILES:${PN}-ptest = " \ - ${PTEST_PATH}/* \ -" - -FILES:${PN}-dbg = " \ - ${libdir}/.debug/* \ - ${bindir}/.debug/* \ - ${libdir}/aws-greengrass-component-sdk/ptest/.debug/* \ -" - -# Skip buildpaths QA check for static libraries which contain embedded build paths -# nooelint: oelint.vars.insaneskip:INSANE_SKIP -INSANE_SKIP:${PN}-staticdev = "buildpaths" -# nooelint: oelint.vars.insaneskip:INSANE_SKIP -INSANE_SKIP:${PN}-dev = "buildpaths" - -BBCLASSEXTEND = "native nativesdk" diff --git a/recipes-sdk/aws-greengrass-component-sdk/files/0001-Add-timespec-blocklist-and-portable-struct-for-cross.patch b/recipes-sdk/aws-greengrass-component-sdk/files/0001-Add-timespec-blocklist-and-portable-struct-for-cross.patch deleted file mode 100644 index 129c134343..0000000000 --- a/recipes-sdk/aws-greengrass-component-sdk/files/0001-Add-timespec-blocklist-and-portable-struct-for-cross.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 50faa52900cb9e49767178eaae84248409a7a80c Mon Sep 17 00:00:00 2001 -From: Richard Elberger -Date: Thu, 9 Apr 2026 14:40:46 -0400 -Subject: [PATCH 1/4] Add timespec blocklist and portable struct for - cross-compilation - -Blocklist the system timespec type from bindgen and provide a -portable definition using c_long, which is correct on both 32-bit -and 64-bit platforms. Also add GG_OBJ_NULL constant and disable -layout tests which fail during cross-compilation. - -Upstream-Status: Pending ---- - rust/build.rs | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/rust/build.rs b/rust/build.rs -index 5297a1d..0dbc5a7 100644 ---- a/rust/build.rs -+++ b/rust/build.rs -@@ -55,11 +55,18 @@ fn main() { - .allowlist_type("Gg.*") - .allowlist_type("GgIpc.*") - .allowlist_var("GG_.*") -+ .blocklist_type("timespec") - .raw_line("#![allow(non_upper_case_globals)]") - .raw_line("#![allow(non_camel_case_types)]") - .raw_line("#![allow(non_snake_case)]") - .raw_line("#![allow(dead_code)]") - .raw_line("#![allow(clippy::pedantic)]") -+ .raw_line("use core::ffi::c_long;") -+ .raw_line("#[repr(C)]") -+ .raw_line("#[derive(Debug, Copy, Clone, Default)]") -+ .raw_line("pub struct timespec { pub tv_sec: c_long, pub tv_nsec: c_long }") -+ .raw_line("pub const GG_OBJ_NULL: GgObject = unsafe { core::mem::zeroed() };") -+ .layout_tests(false) - .generate() - .unwrap() - .write_to_file(manifest_dir.join("src/c.rs")) --- -2.43.0 - diff --git a/recipes-sdk/aws-greengrass-component-sdk/files/0002-Fix-timespec-types-for-32-bit-platforms.patch b/recipes-sdk/aws-greengrass-component-sdk/files/0002-Fix-timespec-types-for-32-bit-platforms.patch deleted file mode 100644 index dd9d9be788..0000000000 --- a/recipes-sdk/aws-greengrass-component-sdk/files/0002-Fix-timespec-types-for-32-bit-platforms.patch +++ /dev/null @@ -1,32 +0,0 @@ -From ccd16ebc966033f538b1174047ca21b7f943d65c Mon Sep 17 00:00:00 2001 -From: Richard Elberger -Date: Thu, 9 Apr 2026 14:41:43 -0400 -Subject: [PATCH 2/4] Fix timespec types for 32-bit platforms - -Use c_long instead of i64 for timespec fields. On 32-bit ARM, -c_long is 32 bits while i64 is 64 bits, causing struct layout -mismatch with the C timespec. - -Upstream-Status: Pending ---- - rust/src/ipc.rs | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/rust/src/ipc.rs b/rust/src/ipc.rs -index 4056fbb..42366ea 100644 ---- a/rust/src/ipc.rs -+++ b/rust/src/ipc.rs -@@ -486,8 +486,8 @@ impl Sdk { - - #[expect(clippy::cast_possible_wrap)] - let timespec = timestamp.map(|d| c::timespec { -- tv_sec: d.as_secs() as i64, -- tv_nsec: i64::from(d.subsec_nanos()), -+ tv_sec: d.as_secs() as ffi::c_long, -+ tv_nsec: d.subsec_nanos() as ffi::c_long, - }); - - Result::from(unsafe { --- -2.43.0 -