From patchwork Mon Oct 7 00:00:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 68739 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 26E6C27BBEB; Mon, 7 Oct 2024 01:06:05 +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=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 A038327BBEA for ; Mon, 7 Oct 2024 01:06:03 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxbEf-0007k8-9V; Sun, 06 Oct 2024 20:04:25 -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 1sxbEK-00078F-6k for guix-patches@gnu.org; Sun, 06 Oct 2024 20:04:07 -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 1sxbEJ-0001Y6-Tv for guix-patches@gnu.org; Sun, 06 Oct 2024 20:04:03 -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=Y+3nHhJkK0ubMQn201eNkZHcaJCsq3LuCgm7wqN8O/j9RDP5X8Ao9FW32wNCaDJp9BZr1HaWuHupCAeSWq7Vz3C+tJu87CoQ1H0J1DNU67aLJggZPiTdj1Nb+DT+oN4K4FQBCCrIEWRF5b37zdoIPJ2xb2LS1HPMJv2Oytey9KtabzQJ3i+CuZUiuoxRpeq3UHT/nDpHo3Z3dvJAray7ySaEeIfIreV9VLxqlGXnTNQsorHgpLNp+gNpgzOKmgW3S0hCmYhqo7wMOizaOwsYRReJJTDw3rE9fyBZVfXi2bt3nrQF421KUiiD6DpLw2qoqH2uBaxC5PfTtwOEmJSrXQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sxbEQ-0002ai-Bo for guix-patches@gnu.org; Sun, 06 Oct 2024 20:04:10 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#67902] [PATCH v3 73/96] 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 00:04:10 +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.17282594329695 (code B ref 67902); Mon, 07 Oct 2024 00:04:10 +0000 Received: (at 67902) by debbugs.gnu.org; 7 Oct 2024 00:03:52 +0000 Received: from localhost ([127.0.0.1]:43289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxbE8-0002WB-1v for submit@debbugs.gnu.org; Sun, 06 Oct 2024 20:03:52 -0400 Received: from 20.mo583.mail-out.ovh.net ([91.121.55.239]:40071) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxbE4-0002VP-3I for 67902@debbugs.gnu.org; Sun, 06 Oct 2024 20:03:49 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.109.139.72]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 4XMKB40w9Pz1Qtm for <67902@debbugs.gnu.org>; Mon, 7 Oct 2024 00:03:40 +0000 (UTC) Received: from ghost-submission-55b549bf7b-g44z6 (unknown [10.111.174.174]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id E858E1FD77; Mon, 7 Oct 2024 00:03:39 +0000 (UTC) Received: from ngraves.fr ([37.59.142.95]) by ghost-submission-55b549bf7b-g44z6 with ESMTPSA id Md4hK1slA2f8BwAAJMv2Hw (envelope-from ); Mon, 07 Oct 2024 00:03:39 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G00159ec7b72-34e0-426d-a8ac-259d76000dd1, A12302D5D8CF0E033BA678025A323BF4FAD59D46) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 86.246.19.221 Date: Mon, 7 Oct 2024 02:00:08 +0200 Message-ID: <20241007000046.25625-73-ngraves@ngraves.fr> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241007000046.25625-1-ngraves@ngraves.fr> References: <20241007000046.25625-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 2692026677322310370 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvkedgfedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepheekudejgfdtudeihffgiedvjeekffethfeiieevudegffejjefggfekffeiteeinecuffhomhgrihhnpehshihmfhhonhihrdgtohhmpdhgihhthhhusgdrtghomhenucfkphepuddvjedrtddrtddruddpkeeirddvgeeirdduledrvddvuddpfeejrdehledrudegvddrleehnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeeijeeltddvseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeefpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=uvdBSUyedtFO8RZC4Id+BudkiNeOa6WiXIeUYQ1ns04=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1728259420; v=1; b=UIYzSV/+MKFneVN1UjevQfjnZqfJVyTjpQDGWtp3kT6Vjb76O4vUQYw6IqT7F6Dcw7zsmt7g jeXSRlRgr+rUxUxg6dKVvheagdODVgqKRE+3cflPmTBibbLpv6n857mjS0NusxzMT7md2++KI/j w0fO65n9tuiiWU2LvEIBcF014e5mG1obbhKg4bCzjZQTtf+FXWAiiGu5B7fciz7rbEZTfWbofL2 djmDemxbyw59ZR+HzMvio7vsmjCofn0fmkJQcOSZ6kSiWDNWLmKEoPDKl8/uNRGv+dCzlzrRn7k 45C/s7miya3bWAtvyjxkHz3wpgSdFVvxUpWsrNA5zYdfg== 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))) +