From patchwork Tue Dec 19 13:57:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 57777 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 2CAFB27BBEC; Tue, 19 Dec 2023 14:13:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 1639627BBE9 for ; Tue, 19 Dec 2023 14:13:06 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFapv-00082G-8V; Tue, 19 Dec 2023 09:12:43 -0500 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 1rFapU-0006kT-0M for guix-patches@gnu.org; Tue, 19 Dec 2023 09:12:17 -0500 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 1rFapS-0005ym-Io for guix-patches@gnu.org; Tue, 19 Dec 2023 09:12:15 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rFapV-0004ed-4Z for guix-patches@gnu.org; Tue, 19 Dec 2023 09:12:17 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67902] [PATCH 72/95] gnu: Add php-symfony-phpunit-bridge. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Dec 2023 14:12:17 +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: ngraves@ngraves.fr Received: via spool by 67902-submit@debbugs.gnu.org id=B67902.170299510017531 (code B ref 67902); Tue, 19 Dec 2023 14:12:17 +0000 Received: (at 67902) by debbugs.gnu.org; 19 Dec 2023 14:11:40 +0000 Received: from localhost ([127.0.0.1]:34989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFaot-0004Yb-IN for submit@debbugs.gnu.org; Tue, 19 Dec 2023 09:11:40 -0500 Received: from 7.mo560.mail-out.ovh.net ([188.165.48.182]:53027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFaoK-0004Ob-TL for 67902@debbugs.gnu.org; Tue, 19 Dec 2023 09:11:06 -0500 Received: from director11.ghost.mail-out.ovh.net (unknown [10.109.148.29]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id B03E72C42B for <67902@debbugs.gnu.org>; Tue, 19 Dec 2023 14:11:00 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-tg7p4 (unknown [10.110.96.188]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 8112F1FE71; Tue, 19 Dec 2023 14:11:00 +0000 (UTC) Received: from ngraves.fr ([37.59.142.103]) by ghost-submission-6684bf9d7b-tg7p4 with ESMTPSA id hm7/G3SkgWU81wAAViGw6g (envelope-from ); Tue, 19 Dec 2023 14:11:00 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-103G0059043ac60-99df-4779-96cb-8649106f8ec8, 0A183DEDD9F7D7733B4F13041BD52F66DC821FED) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 Date: Tue, 19 Dec 2023 14:57:53 +0100 Message-ID: <20231219140934.22783-72-ngraves@ngraves.fr> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231219140934.22783-1-ngraves@ngraves.fr> References: <20231219140934.22783-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 11850096520488542946 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvddutddgieduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepheekudejgfdtudeihffgiedvjeekffethfeiieevudegffejjefggfekffeiteeinecuffhomhgrihhnpehshihmfhhonhihrdgtohhmpdhgihhthhhusgdrtghomhenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddtfeenucevlhhushhtvghrufhiiigvpeegnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepieejledtvdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheeitddpmhhouggvpehsmhhtphhouhht 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 6cd3295b85..d6a49d1f75 100644 --- a/gnu/packages/php-xyz.scm +++ b/gnu/packages/php-xyz.scm @@ -1954,3 +1954,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))) +