From 6237a609886573dd19692a3c32fbaa3bf06159a5 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 17 Apr 2025 11:24:05 +0100 Subject: [PATCH] build_dev_binpkgs: Only build packages available to the board profile Updating only the SDK to systemd-257 caused this script to break, as it saw this version being pulled in as a BDEPEND and then tried to build it using the board profile. See the comment for details. Signed-off-by: James Le Cuirot --- build_dev_binpkgs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build_dev_binpkgs b/build_dev_binpkgs index f7a12dfa82..33e9337075 100755 --- a/build_dev_binpkgs +++ b/build_dev_binpkgs @@ -55,6 +55,12 @@ pkg_skipped_list=() info "Collecting list of binpkgs to build" +# Normally, BDEPENDs are only installed to the SDK, but the point of this script +# is to install them to the board root because the dev container uses a board +# profile. This is easily achieved using --root-deps. Since it is still the SDK +# doing the building, which might have different package versions available to +# the board profile, we have to be careful not to include SDK BDEPENDs in the +# list of binary packages to publish, hence the sed call. while read -r pkg; do [[ -f /build/${FLAGS_board}/var/lib/portage/pkgs/${pkg}.tbz2 ]] && continue IFS=, @@ -67,8 +73,8 @@ while read -r pkg; do unset IFS pkg_build_list+=("=${pkg}") echo " =${pkg}" -done < <(my_board_emerge --pretend --emptytree "${@}" | - grep '\[ebuild' | sed 's/^\[[^]]\+\] \([^ :]\+\)*:.*/\1/') +done < <(my_board_emerge --pretend --emptytree --root-deps "${@}" | + sed -n "/\[ebuild .* to \/build\/${FLAGS_board}\/ /s/^\[[^]]\+\] \([^ :]\+\)*:.*/\1/p") # -- if [[ ${#pkg_skipped_list[@]} -gt 0 ]]; then