From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 669CC158089 for ; Sun, 10 Sep 2023 10:57:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 982C22BC015; Sun, 10 Sep 2023 10:57:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7E44D2BC015 for ; Sun, 10 Sep 2023 10:57:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 93515335CB9 for ; Sun, 10 Sep 2023 10:57:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3EAB210AD for ; Sun, 10 Sep 2023 10:57:21 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1694343242.580a9d39d536e6740450bed591a326980e24ffdb.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: scripts/bootstrap-prefix.sh X-VCS-Directories: scripts/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 580a9d39d536e6740450bed591a326980e24ffdb X-VCS-Branch: master Date: Sun, 10 Sep 2023 10:57:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bf2a5748-8eb5-4278-9ae8-a982da735a62 X-Archives-Hash: 207091f9ddfc4dc40fef835767768252 commit: 580a9d39d536e6740450bed591a326980e24ffdb Author: Fabian Groffen gentoo org> AuthorDate: Sun Sep 10 10:54:02 2023 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Sep 10 10:54:02 2023 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=580a9d39 scripts/bootstrap-prefix: do not use stacked-prefix on non-RAP bootstraps The stacked-prefix approach keeps packages in ROOT/tmp instead of the final destination Prefix. This causes problems for tools (most notably binutils-config) do not get configured for the destination Prefix, which stage3 relies on. Closes: https://bugs.gentoo.org/910396 Signed-off-by: Fabian Groffen gentoo.org> scripts/bootstrap-prefix.sh | 68 ++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 47 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 735e896dd0..4f5b1e5a99 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -155,31 +155,13 @@ configure_toolchain() { compiler="${gcc_deps} sys-devel/gcc-config sys-devel/gcc" compiler_stage1="${gcc_deps} sys-devel/gcc-config" compiler_type="gcc" - case ${CHOST} in - *-darwin*) - # handled below - ;; - *-freebsd* | *-openbsd*) - # comes with clang, handled below - ;; - *) - # The host may not have a functioning c++ toolchain, so use a - # stage1 compiler that can build with C only. - # But gcc-4.7 fails to build with gcc-5.4, so we check for - # >gcc-4.7, as anything newer provides c++ anyway (#619542). - # gcc-4.7 is the last version not to require a c++ compiler to - # build - eval $( (gcc -E - | grep compiler_stage1) <<-EOP - #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)) - compiler_stage1+=" sys-devel/gcc" - #elif defined(__GNUC__) && __GNUC__ >= 4 - compiler_stage1+=" > "${ROOT}"/tmp/etc/portage/package.unmask - - # libffi-3.0_rc0 has broken Solaris ld support, which we still - # use at this stage (host compiler) - [[ ${CHOST} == *-solaris* ]] && echo "=dev-libs/libffi-3.3_rc0" \ - >> "${ROOT}"/tmp/etc/portage/package.mask - # provide active SDK link on Darwin if [[ ${CHOST} == *-darwin* ]] ; then rm -f "${ROOT}"/tmp/MacOSX.sdk @@ -1952,6 +1926,10 @@ bootstrap_stage3() { echo ${l} } + # Remember: binutils-config and gcc were built in ROOT/tmp, so they + # are looking for includes and libraries under ROOT/tmp, *NOT* ROOT, + # therefore we need to export search paths for ROOT (the final + # destination Prefix) here until we've installed the toolchain export CONFIG_SHELL="${ROOT}"/tmp/bin/bash [[ ${compiler_type} == gcc ]] && \ export CPPFLAGS="-isystem ${ROOT}/usr/include" @@ -1977,6 +1955,10 @@ bootstrap_stage3() { do_emerge_pkgs "$@" } + # retained in case we *do* need this, but using this will cause + # packages installed end up in ROOT/tmp, which means we keep using + # stage2 area and config which breaks things like binutils-config' + # path search, so don't use this with_stack_emerge_pkgs() { # keep FEATURES=stacked-prefix until we bump portage in stage1 FEATURES="${FEATURES} stacked-prefix" \ @@ -1985,20 +1967,13 @@ bootstrap_stage3() { emerge_pkgs "$@" } - without_stack_emerge_pkgs() { + # pre_emerge_pkgs relies on stage 2 portage, but installs into the + # final destination Prefix + pre_emerge_pkgs() { PORTAGE_OVERRIDE_EPREFIX="${ROOT}" \ emerge_pkgs "$@" } - # pre_emerge_pkgs relies on stage 2 portage. - pre_emerge_pkgs() { - if is-rap; then - without_stack_emerge_pkgs "$@" - else - with_stack_emerge_pkgs "$@" - fi - } - # Some packages fail to properly depend on sys-apps/texinfo. # We don't really need that package, so we fake it instead, # explicitly emerging it later on will overwrite the fakes. @@ -2148,7 +2123,7 @@ bootstrap_stage3() { ln -s bash "${ROOT}"/bin/sh fi - # Start using apps from new target + # Start using apps from the final destination Prefix export PREROOTPATH="${ROOT}/usr/bin:${ROOT}/bin" # Get a sane bash, overwriting tmp symlinks @@ -2214,7 +2189,6 @@ bootstrap_stage3() { # Portage should figure out itself what it needs to do, if anything. einfo "running emerge -uDNv system" estatus "stage3: emerge -uDNv system" - unset CFLAGS CXXFLAGS CPPFLAGS emerge --color n -uDNv system || return 1 # Remove anything that we don't need (compilers most likely)