From 84b0ddf67d8ce86b286f0e890649c97af7683c19 Mon Sep 17 00:00:00 2001 From: jenkins Date: Wed, 13 Jul 2022 08:57:18 +0000 Subject: [PATCH] setup_board: fix building binpkgs for toolchain dependencies install_cross_libs installs TOOLCHAIN_PKGS deps into /usr/$BOARD_CHOST, so that TOOLCHAIN_PKGS binpkgs can be built. We also need binpkgs for the TOOLCHAIN_PKGS deps so that we can install them into /build/$BOARD later together with TOOLCHAIN_PKGS. This is where the flow is currently broken. Due to a change in semantics, --emptyroot tries to rebuild host packages as well, and dropping it leaves --onlydeps which results in no binpkgs being built because they are already installed. We can solve resolve this by reusing the dependency list generated by install_cross_libs, and explicitly building those binpkgs. It is worth remarking that this flow of building the toolchain binpkgs through setup_board is not in use in Flatcar, because we normally build toolchains with catalyst. We are interested in reviving it because we want to build everything with SLSA provenance information. --- setup_board | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup_board b/setup_board index bddb4dfcc6..0854c44902 100755 --- a/setup_board +++ b/setup_board @@ -319,9 +319,9 @@ if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then install_cross_libs "${BOARD_CHOST}" ${EMERGE_FLAGS} --buildpkg=n info "Building toolchain dependencies" - "${EMERGE_WRAPPER}" --buildpkg --buildpkgonly --onlydeps -e \ + "${EMERGE_WRAPPER}" --buildpkg --buildpkgonly \ --root="/usr/${BOARD_CHOST}" --sysroot="/usr/${BOARD_CHOST}" \ - ${EMERGE_TOOLCHAIN_FLAGS} "${TOOLCHAIN_PKGS[@]}" + ${EMERGE_TOOLCHAIN_FLAGS} $(< "/usr/${BOARD_CHOST}/etc/portage/cross-${BOARD_CHOST}-depends") info "Building toolchain" "${EMERGE_WRAPPER}" --buildpkg --buildpkgonly \ --root="/usr/${BOARD_CHOST}" --sysroot="/usr/${BOARD_CHOST}" \