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 969E7158010 for ; Sat, 31 Dec 2022 13:33:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D670DE0882; Sat, 31 Dec 2022 13:33:11 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 pigeon.gentoo.org (Postfix) with ESMTPS id 7B1E9E0878 for ; Sat, 31 Dec 2022 13:33:11 +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 9E112335CCD for ; Sat, 31 Dec 2022 13:33:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3F5987FC for ; Sat, 31 Dec 2022 13:33:09 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1672493584.118df436abd49eecfeaf95df8a052861d463a896.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/util/whirlpool.py X-VCS-Directories: lib/portage/util/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 118df436abd49eecfeaf95df8a052861d463a896 X-VCS-Branch: master Date: Sat, 31 Dec 2022 13:33:09 +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: d1b2a21f-602f-46d1-a8cf-37093e3f6eb1 X-Archives-Hash: fe691cf82ce2bd0d279b9cd0cdff7c8f commit: 118df436abd49eecfeaf95df8a052861d463a896 Author: Michał Górny gentoo org> AuthorDate: Fri Dec 30 10:57:12 2022 +0000 Commit: Sam James gentoo org> CommitDate: Sat Dec 31 13:33:04 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=118df436 Report a warning when unaccelerated Whirlpool is being used The warning serves two purposes: it informs the user that they should expect very slow hashing (i.e. Portage did not hang) and that they should inform the repository owner about the problem. Far from ideal but probably good enough given how rare Whirlpool-only ebuilds are. Signed-off-by: Michał Górny gentoo.org> Closes: https://github.com/gentoo/portage/pull/967 Signed-off-by: Sam James gentoo.org> lib/portage/util/whirlpool.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/portage/util/whirlpool.py b/lib/portage/util/whirlpool.py index 8454a874a..d26780604 100644 --- a/lib/portage/util/whirlpool.py +++ b/lib/portage/util/whirlpool.py @@ -30,6 +30,10 @@ # pylint: disable=mixed-indentation +import warnings + +from portage.localization import _ + try: from ._whirlpool import Whirlpool as WhirlpoolExt except ImportError: @@ -47,6 +51,13 @@ class PyWhirlpool: hashed.""" def __init__(self, arg=b""): + warnings.warn( + _( + "The last-resort unaccelerated Whirlpool implementation is " + "being used. It is known to be absurdly slow. Please report " + "that the Whirlpool hash is deprecated to the repository owner." + ) + ) self.ctx = WhirlpoolStruct() self.update(arg)