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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2252C1382C5 for ; Mon, 21 Jun 2021 21:23:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 52210E0877; Mon, 21 Jun 2021 21:23:26 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 37FDBE0877 for ; Mon, 21 Jun 2021 21:23:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6AE8333FD3F for ; Mon, 21 Jun 2021 21:23:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F34CE7B6 for ; Mon, 21 Jun 2021 21:23:23 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1624308969.c121a1faf88221af7246c45687578f5258c416af.slyfox@gentoo> Subject: [gentoo-commits] proj/crossdev:master commit in: wrappers/ X-VCS-Repository: proj/crossdev X-VCS-Files: wrappers/emerge-wrapper X-VCS-Directories: wrappers/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: c121a1faf88221af7246c45687578f5258c416af X-VCS-Branch: master Date: Mon, 21 Jun 2021 21:23:23 +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: e007f9ae-f6cb-43ea-8ed3-84bfad6f4799 X-Archives-Hash: a07e53727be6cc55ea11372b01a4e42d commit: c121a1faf88221af7246c45687578f5258c416af Author: Sergei Trofimovich gentoo org> AuthorDate: Mon Jun 21 20:56:09 2021 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Mon Jun 21 20:56:09 2021 +0000 URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=c121a1fa wrappers/emerge-wrapper: fail crossdev setup when toolchain-funcs.eclass sourcing fails Before the change toolchain-funcs.eclass import failure did not fail hard and generated suboptimal default ARCH. It's not as bad as crossdev's equivalent 'multilib.eclass' source failure, but still not perfect. The change exposes die() calls to be visible in crossdev run: ``` $ rm -rf '@GENTOO_PORTAGE_EPREFIX /usr/foo/etc'; ./emerge-wrapper --target foo --init emerge-wrapper: ERROR: toolchain-funcs.eclass: EAPI 0 not supported emerge-wrapper: ERROR: Failed calling 'tc-arch' from toolchain-funcs.eclass. ``` Reported-by: Marco Scardovi (scardracs) Bug: https://bugs.gentoo.org/797367 Signed-off-by: Sergei Trofimovich gentoo.org> wrappers/emerge-wrapper | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wrappers/emerge-wrapper b/wrappers/emerge-wrapper index 381214e..d9ba08b 100755 --- a/wrappers/emerge-wrapper +++ b/wrappers/emerge-wrapper @@ -17,7 +17,7 @@ PREFIX="@PREFIX@" # Enable this script to be manually installed while debugging [[ ${PREFIX} == "@"PREFIX"@" ]] && PREFIX="/usr" -err() { echo "emerge-wrapper: $*" 1>&2; exit 1; } +err() { echo "emerge-wrapper: ERROR: $*" 1>&2; exit 1; } emit_setup_warning() { @@ -47,9 +47,11 @@ cross_wrap_etc() # Re-use existing CHOST->portage ARCH mapping code ARCH=$( inherit() { :; } + die() { err "toolchain-funcs.eclass$*"; } . "${MAIN_REPO_PATH}"/eclass/toolchain-funcs.eclass tc-arch ) + [[ $? -ne 0 ]] && err "Failed calling 'tc-arch' from toolchain-funcs.eclass." [[ ${ARCH} == "unknown" ]] && emit_setup_warning "No ARCH is known for this target." LIBC="__LIBC__"