From 1e7ce955083bffdc84e1729e0d8bfa3db876bf5d Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Fri, 6 Dec 2013 14:41:46 -0800 Subject: [PATCH 1/2] fix(setup_board): Depend on --usepkg and --getbinpkg as a pair. Instead of gating only on --usepkg depend on both flags as a pair. This keeps setup_board's behavior a little closer to build_packages. The buildbot is using --nogetbinpkg to avoid pulling in existing packages built by the SDK but setup_board is causing some to be pulled in anyway. --- setup_board | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup_board b/setup_board index 5c6e5dad38..b68517bafd 100755 --- a/setup_board +++ b/setup_board @@ -258,7 +258,9 @@ if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then EMERGE_FLAGS+=" --jobs=${FLAGS_jobs}" fi - if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]]; then + if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" && \ + "${FLAGS_getbinpkg}" -eq "${FLAGS_TRUE}" ]] + then EMERGE_FLAGS+=" --usepkgonly --getbinpkg" else # When binary packages are disabled we need to make sure the cross From 8330920290710d54fe7eb816998c25681c4df08a Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Fri, 6 Dec 2013 15:19:41 -0800 Subject: [PATCH 2/2] fix(toolchain_util.sh): Never force binary packages with crossdev. When calling update_chroot with --usepkg --nogetbinpkg the default emerge command line will force binary packages for the toolchain but if the packages are not available locally building via crossdev is required. Since the crossdev bootstrap process rebuilds the toolchain a couple times with different use flags if binary packages are forced the second stages gets skipped resulting in a broken gcc and glibc install. --- build_library/toolchain_util.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build_library/toolchain_util.sh b/build_library/toolchain_util.sh index 6340386ead..cb9d8245b8 100644 --- a/build_library/toolchain_util.sh +++ b/build_library/toolchain_util.sh @@ -174,6 +174,11 @@ install_cross_toolchain() { local cross_cfg="/usr/${cross_chost}/etc/portage/${cross_chost}-crossdev" local cross_cfg_data=$(_crossdev_info "${cross_chost}" stable) + # Forcing binary packages for toolchain packages breaks crossdev since it + # prevents it from rebuilding with different use flags during bootstrap. + local safe_flags=( "${@/#--useoldpkg-atoms=*/}" ) + safe_flags=( "${safe_flags[@]/#--rebuild-exclude=*/}" ) + # may be called from either catalyst (root) or upgrade_chroot (user) local sudo= if [[ $(id -u) -ne 0 ]]; then @@ -183,7 +188,7 @@ install_cross_toolchain() { # Only call crossdev to regenerate configs if something has changed if ! cmp --quiet - "${cross_cfg}" <<<"${cross_cfg_data}" then - $sudo crossdev --stable --portage "$*" \ + $sudo crossdev --stable --portage "${safe_flags[*]}" \ --init-target --target "${cross_chost}" $sudo tee "${cross_cfg}" <<<"${cross_cfg_data}" >/dev/null fi @@ -193,7 +198,7 @@ install_cross_toolchain() { if emerge "$@" --binpkg-respect-use=y --update --newuse \ --pretend "${cross_pkgs[@]}" | grep -q '^\[ebuild' then - $sudo crossdev --stable --portage "$*" \ + $sudo crossdev --stable --portage "${safe_flags[*]}" \ --stage4 --target "${cross_chost}" else $sudo emerge "$@" --binpkg-respect-use=y --update --newuse \