From patchwork Mon Oct 7 21:44:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 68842 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6271E27BBEA; Mon, 7 Oct 2024 22:49:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 63FB627BBE2 for ; Mon, 7 Oct 2024 22:49:21 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxvbQ-00061Y-Di; Mon, 07 Oct 2024 17:49:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxvb6-0005oL-Nu for guix-patches@gnu.org; Mon, 07 Oct 2024 17:48:58 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxvb6-00055L-Fc for guix-patches@gnu.org; Mon, 07 Oct 2024 17:48:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=uvdBSUyedtFO8RZC4Id+BudkiNeOa6WiXIeUYQ1ns04=; b=t+gMl5T5coBa6HqnGFg5liS+z7IpiveXklsXfBi7nWtGSlWPUQZV+LYvK6R7eYbocZ6A6qM/fmXj374aP6JxzBgeNlOQ7jkVPnUyAIS6NTNHkj7j9huXsGGsXNSjBs4h1alAGcFYaqDW3ivBTaiIMCcPydYUCGj2blajJnN8Hcs41dy+xZMGDYUV7vL4guVN9FMFB+miQTWr6BPSGZIf6rmRCls9LYepd/PLMTU6jCr4wfIM+Kdu4EdoEkKvZKVgEskCdoG21GgjSa2o4WNuETNQlPgzXwfCOzVO8ZntGds4RAc/H+5hStKp9AhIeg090NGdnkQSx2sn+V/POSY0Cw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sxvbE-0006xw-6K for guix-patches@gnu.org; Mon, 07 Oct 2024 17:49:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#67902] [PATCH v4 73/98] gnu: Add php-symfony-phpunit-bridge. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Oct 2024 21:49:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67902 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67902@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 67902-submit@debbugs.gnu.org id=B67902.172833770526455 (code B ref 67902); Mon, 07 Oct 2024 21:49:04 +0000 Received: (at 67902) by debbugs.gnu.org; 7 Oct 2024 21:48:25 +0000 Received: from localhost ([127.0.0.1]:49003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxvaa-0006sW-7W for submit@debbugs.gnu.org; Mon, 07 Oct 2024 17:48:24 -0400 Received: from 4.mo575.mail-out.ovh.net ([46.105.59.63]:41755) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxvaV-0006re-BM for 67902@debbugs.gnu.org; Mon, 07 Oct 2024 17:48:20 -0400 Received: from director1.ghost.mail-out.ovh.net (unknown [10.109.140.100]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4XMt7G1rMbz1nGd for <67902@debbugs.gnu.org>; Mon, 7 Oct 2024 21:48:10 +0000 (UTC) Received: from ghost-submission-55b549bf7b-v26zp (unknown [10.108.54.44]) by director1.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 11BE31FE0B; Mon, 7 Oct 2024 21:48:10 +0000 (UTC) Received: from ngraves.fr ([37.59.142.98]) by ghost-submission-55b549bf7b-v26zp with ESMTPSA id FXRyMRlXBGeLwS4ANiozfA (envelope-from ); Mon, 07 Oct 2024 21:48:10 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-98R002f1540a4c-8d50-4168-91ff-388d628e94e6, A12302D5D8CF0E033BA678025A323BF4FAD59D46) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 86.246.19.221 Date: Mon, 7 Oct 2024 23:44:41 +0200 Message-ID: <20241007214530.4420-73-ngraves@ngraves.fr> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241007214530.4420-1-ngraves@ngraves.fr> References: <20241007214530.4420-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 6276329033125126882 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeftddgtddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepheekudejgfdtudeihffgiedvjeekffethfeiieevudegffejjefggfekffeiteeinecuffhomhgrihhnpehshihmfhhonhihrdgtohhmpdhgihhthhhusgdrtghomhenucfkphepuddvjedrtddrtddruddpkeeirddvgeeirdduledrvddvuddpfeejrdehledrudegvddrleeknecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeeijeeltddvseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehjeehpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=uvdBSUyedtFO8RZC4Id+BudkiNeOa6WiXIeUYQ1ns04=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1728337690; v=1; b=z7xrAkOek/KFH9PNNqxGUQXadxF3PQCnMW4TxINXEj2h96R3DWI2jDhDBl1o9SPOZqH18Vf/ nKA9MEljh7naFgBkzJSQTmk4x5xtEWZwXigKiJl5XiQWuQwogcFT7APlkv9mlhdJNjotIHnD2p5 4JINJrw1csOH7I3oBnkJWY5cYUmXAioxBGHazDqpNjlx66s58CtkRCTk/nF3mlBJq6tMF+a9XcW su1Jv+QnlMZsUc9tvcdwMSwDDEzM8/+fBgKT2BlTMwFhS+xvNuxiFPoVynI2+cFw1Cdt57zVeyN eKlr3bT3Tn5M+ORFr85drRkQ3fELLzpM9lmpoPhNR/A3Q== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/php-xyz.scm (php-symfony-phpunit-bridge): New variable. * gnu/packages/patches/php-symfony-phpunit-bridge-getVendors-fix.patch: New file. Change-Id: Ie72bd332a6fb7aaf96a59ce24e6008e6aa599f59 --- ...ymfony-phpunit-bridge-getVendors-fix.patch | 46 +++++++++++ gnu/packages/php-xyz.scm | 77 +++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 gnu/packages/patches/php-symfony-phpunit-bridge-getVendors-fix.patch diff --git a/gnu/packages/patches/php-symfony-phpunit-bridge-getVendors-fix.patch b/gnu/packages/patches/php-symfony-phpunit-bridge-getVendors-fix.patch new file mode 100644 index 0000000000..fd48e2ce6c --- /dev/null +++ b/gnu/packages/patches/php-symfony-phpunit-bridge-getVendors-fix.patch @@ -0,0 +1,46 @@ +From 4b7c29c3e98aa55ea7567a3d496595e539f30cdb Mon Sep 17 00:00:00 2001 +From: Nicolas Graves +Date: Sun, 22 Oct 2023 16:31:40 +0200 +Subject: [PATCH] Deprecation.php: Do not check for composer in getVendors. + +--- + DeprecationErrorHandler/Deprecation.php | 23 ++--------------------- + 1 file changed, 2 insertions(+), 21 deletions(-) + +diff --git a/DeprecationErrorHandler/Deprecation.php b/DeprecationErrorHandler/Deprecation.php +index 79cfa0c..b7074f7 100644 +--- a/DeprecationErrorHandler/Deprecation.php ++++ b/DeprecationErrorHandler/Deprecation.php +@@ -365,27 +365,8 @@ class Deprecation + if (class_exists(DebugClassLoader::class, false)) { + self::$vendors[] = \dirname((new \ReflectionClass(DebugClassLoader::class))->getFileName()); + } +- foreach (get_declared_classes() as $class) { +- if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) { +- $r = new \ReflectionClass($class); +- $v = \dirname($r->getFileName(), 2); +- if (file_exists($v.'/composer/installed.json')) { +- self::$vendors[] = $v; +- $loader = require $v.'/autoload.php'; +- $paths = self::addSourcePathsFromPrefixes( +- array_merge($loader->getPrefixes(), $loader->getPrefixesPsr4()), +- $paths +- ); +- } +- } +- } +- foreach ($paths as $path) { +- foreach (self::$vendors as $vendor) { +- if (0 !== strpos($path, $vendor)) { +- self::$internalPaths[] = $path; +- } +- } +- } ++ self::$vendors[] = $v; ++ self::$internalPaths[] = $paths; + } + + return self::$vendors; +-- +2.41.0 + diff --git a/gnu/packages/php-xyz.scm b/gnu/packages/php-xyz.scm index e9a6a0e0d3..9bdd943f63 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -1946,3 +1946,80 @@ (define-public php-symfony-mime (home-page "https://symfony.com") (license license:expat))) +(define-public php-symfony-phpunit-bridge + (package + (name "php-symfony-phpunit-bridge") + (version "6.3.6") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/symfony/phpunit-bridge") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1v5zdjb0d7282wq0ghwzn9x005wqlzjmx2msi9vhp1c4l513fxgf")) + (patches + (search-patches "php-symfony-phpunit-bridge-getVendors-fix.patch")))) + (build-system composer-build-system) + (arguments + (list + #:test-flags ; Some tests are useless but get reported as risky. + ''("--bootstrap" "vendor/autoload.php" "--dont-report-useless-tests") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'deactivate-bootstrap.php + (lambda _ + (substitute* "composer.json" + ((".*\"files\".*") + "")))) + (add-before 'check 'pre-check + (lambda* (#:key inputs #:allow-other-keys) + ;; Adapt some PHP test code to Guix context. + (mkdir-p + (string-append (getcwd) "/vendor/myfakevendor/myfakepackage1")) + (substitute* "Tests/DeprecationErrorHandler/DeprecationTest.php" + (("(.*)self::\\$vendorDir = \\$vendorDir;" all blank) + (string-append + blank "$vendorDir = '" (getcwd) "/vendor/';\n" + all))) + (substitute* "DeprecationErrorHandler/Deprecation.php" + (("(self::\\$vendors\\[\\] = )\\$v;" all eq) + (string-append eq "'" (getcwd) "/vendor';")) + (("(self::\\$internalPaths)\\[\\] = \\$paths;" all def) + (string-append + def " = [" + "'" (getcwd) "/Tests/DeprecationErrorHandler/Deprecation.php'," + "'" (getcwd) "/Tests/DeprecationErrorHandler/DeprecationTest.php'," + "'" (getcwd) "/Tests/DeprecationErrorHandler.php'," + "];"))) + ;; Remove failing tests. All but two are probably failing + ;; because of some version mismatch of php-symfony-error-handler. + (for-each + (lambda (f) + (delete-file + (string-append "Tests/DeprecationErrorHandler/" f))) + '("partially_quiet.phpt" + "partially_quiet2.phpt" + "trigger_deprecation_types.phpt" + "trigger_error_types.phpt" + "weak_vendors_on_vendor.phpt")) + (delete-file "Tests/CoverageListenerTest.php") + ;; For most simple cases, handle php-symfony-error-handler + ;; discrepancies. + (substitute* (find-files "Tests" "\\.phpt") + (("Remaining indirect deprecation notices") + "Other deprecation notices") + (("Remaining direct deprecation notices") + "Other deprecation notices"))))))) + (native-inputs + (list php-phpunit-phpunit + php-symfony-deprecation-contracts + php-symfony-error-handler)) + (synopsis "Utilities for PHPUnit") + (description + "This package provides utilities for PHPUnit, especially user deprecation +notices management.") + (home-page "https://symfony.com") + (license license:expat))) +