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 A356515800A for ; Fri, 16 Jun 2023 03:34:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A865FE0978; Fri, 16 Jun 2023 03:34:57 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9220EE0978 for ; Fri, 16 Jun 2023 03:34:57 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BE0CC340E31 for ; Fri, 16 Jun 2023 03:34:56 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F2FE5A95 for ; Fri, 16 Jun 2023 03:34:54 +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: <1686886486.ff457f742b513a65e6609054e5310f8beee488ec.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/tests/resolver/test_perl_rebuild_bug.py X-VCS-Directories: lib/portage/tests/resolver/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: ff457f742b513a65e6609054e5310f8beee488ec X-VCS-Branch: master Date: Fri, 16 Jun 2023 03:34:54 +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: 027d88ea-6d6c-4a7e-ad4e-44f313ef0810 X-Archives-Hash: 96a732427df49d0adc23ec58d2ec7542 commit: ff457f742b513a65e6609054e5310f8beee488ec Author: YiFei Zhu gmail com> AuthorDate: Tue Jun 13 08:08:51 2023 +0000 Commit: Sam James gentoo org> CommitDate: Fri Jun 16 03:34:46 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ff457f74 tests: resolver: Test the broken behavior of Perl rebuild bug Bug: https://bugs.gentoo.org/463976 Bug: https://bugs.gentoo.org/592880 Bug: https://bugs.gentoo.org/596664 Bug: https://bugs.gentoo.org/631490 Bug: https://bugs.gentoo.org/764365 Bug: https://bugs.gentoo.org/793992 Signed-off-by: YiFei Zhu gmail.com> Signed-off-by: Sam James gentoo.org> .../tests/resolver/test_perl_rebuild_bug.py | 121 +++++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/lib/portage/tests/resolver/test_perl_rebuild_bug.py b/lib/portage/tests/resolver/test_perl_rebuild_bug.py new file mode 100644 index 000000000..928fd47d7 --- /dev/null +++ b/lib/portage/tests/resolver/test_perl_rebuild_bug.py @@ -0,0 +1,121 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import ( + ResolverPlayground, + ResolverPlaygroundTestCase, +) + + +class PerlRebuildBugTestCase(TestCase): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + def testPerlRebuildBug(self): + """ + The infamous Perl rebuild bug. + + A non-slotted build-time dependency cycle is created by: + dev-lang/perl -> sys-libs/zlib -> sys-devel/automake -> dev-lang/perl + Everything else depends on this cycle. + + Bug in solving for smallest cycle causes slot in RDEPEND of + dev-perl/Locale-gettext to be ignored, so all dependencies other than + perl's >=sys-libs/zlib-1.2.12 are satisfied by already-installed + packages. dev-perl/Locale-gettext and sys-devel/automake become leaves + of the depgraph after satisfied packages are ignored. They become + emerged first. This causes an issue because dev-perl/Locale-gettext is + now built before the slot upgrade of dev-lang/perl. + """ + ebuilds = { + "dev-lang/perl-5.36.0-r2": { + "EAPI": "5", + "DEPEND": ">=sys-libs/zlib-1.2.12", + "RDEPEND": ">=sys-libs/zlib-1.2.12", + "SLOT": "0/5.36", + }, + "dev-perl/Locale-gettext-1.70.0-r1": { + "EAPI": "5", + "DEPEND": "dev-lang/perl", + "RDEPEND": "dev-lang/perl:=", + }, + "sys-apps/help2man-1.49.3": { + "EAPI": "5", + "DEPEND": "dev-lang/perl dev-perl/Locale-gettext", + "RDEPEND": "dev-lang/perl dev-perl/Locale-gettext", + }, + "sys-devel/automake-1.16.5": { + "EAPI": "5", + "DEPEND": "dev-lang/perl", + "RDEPEND": "dev-lang/perl", + }, + "sys-libs/zlib-1.2.13-r1": { + "EAPI": "5", + "DEPEND": "sys-devel/automake", + }, + } + + installed = { + "dev-lang/perl-5.34.0-r3": { + "EAPI": "5", + "DEPEND": "sys-libs/zlib", + "RDEPEND": "sys-libs/zlib", + "SLOT": "0/5.34", + }, + "dev-perl/Locale-gettext-1.70.0-r1": { + "EAPI": "5", + "DEPEND": "dev-lang/perl", + "RDEPEND": "dev-lang/perl:0/5.34=", + }, + "sys-apps/help2man-1.48.5": { + "EAPI": "5", + "DEPEND": "dev-lang/perl dev-perl/Locale-gettext", + "RDEPEND": "dev-lang/perl dev-perl/Locale-gettext", + }, + "sys-devel/automake-1.16.4": { + "EAPI": "5", + "DEPEND": "dev-lang/perl", + "RDEPEND": "dev-lang/perl", + }, + "sys-libs/zlib-1.2.11-r4": { + "EAPI": "5", + "DEPEND": "sys-devel/automake", + }, + } + + world = ["sys-apps/help2man"] + + test_cases = ( + ResolverPlaygroundTestCase( + ["@world"], + options={"--deep": True, "--update": True, "--verbose": True}, + success=True, + ambiguous_merge_order=True, + merge_order_assertions=( + ( + "dev-perl/Locale-gettext-1.70.0-r1", + "dev-lang/perl-5.36.0-r2", + ), + ), + mergelist=[ + "dev-perl/Locale-gettext-1.70.0-r1", + "sys-devel/automake-1.16.5", + "sys-libs/zlib-1.2.13-r1", + "dev-lang/perl-5.36.0-r2", + "sys-apps/help2man-1.49.3", + ], + ), + ) + + playground = ResolverPlayground( + ebuilds=ebuilds, + installed=installed, + world=world, + ) + try: + for test_case in test_cases: + playground.run_TestCase(test_case) + self.assertEqual(test_case.test_success, True, test_case.fail_msg) + finally: + playground.cleanup()