From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id IKWyFKT/dmf9VgEAqHPOHw:P1 (envelope-from ) for ; Thu, 02 Jan 2025 21:05:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id IKWyFKT/dmf9VgEAqHPOHw (envelope-from ) for ; Thu, 02 Jan 2025 22:05:40 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=JD6Jslqp; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=ontfzeMo; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735851940; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=jpQS70OFVIGuC8+bJ72hAEd/0CPrwbhQ9XeZ1ISfVrA=; b=cRILCHv2VZNB9C7VAWvypy7r7GhWIaXbbvhuRSYMHaPdtqGHIjBKG7vYv5iPCWw+gE7B5E W+Mp69eYijGI1x3BkAE1lOrB94UofZWTz9YIVt/OEaQRAQIQOvHv6NASXfHiS+NEWHYRCi Zr2hQdOR/Y4Yx/a5Ek/xHs5iTuG7FCDGgonYF7bMXXgHXZmP/JNPYQtQsij1d2R3A/kuQW PEstJFhH0DpvF2MWHwFS9uGqrxp0/HgM89cSJUIRuU/s/6O5xlb/IcrNsUBMPVs7nm/9gq sZzLTuklJ7Wq1SFnBd9TBayM6PewEwtnEZBSnxYUbfgfRW1VGC8D+g3YJ6wkDg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=JD6Jslqp; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=ontfzeMo; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735851940; a=rsa-sha256; cv=none; b=CTRMfoCQQ2ZQQmZFpOYG9y/IKVi+AXuuOXDgvgsNCLZugGjATITyMJ78A8KvlYvNkCjOPo 7nFCeh9ez1YYNAwfCwxqivDUx9gT7riI/gy1HlFDQJ4xHhtAtAc3e7ciaZjpu3jQu9ymBW FNrUvC/A+h4LA3j9NpjSXSkZHMsHL+ODl95DbpKBhJzFE9gD2Zb84unzdBNsPlCdLePJj3 9QsWgO/MBpmu0iNfrqWEtaoO170MEzClOBZpf8+ZPRedLvQhrgzD90xIQlgOJhRwf7TGdP zRFYs7XkRJqFgBghj7dOftCzDcN2PfbsUrzVh1doSjLJp2vbsNZHHXo5UBUClg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AE3DA6026 for ; Thu, 02 Jan 2025 22:05:39 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTSNT-0000Lb-Rt; Thu, 02 Jan 2025 16:05:11 -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 1tTSNR-0000L1-0y for guix-patches@gnu.org; Thu, 02 Jan 2025 16:05:09 -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 1tTSNP-0000AF-W8; Thu, 02 Jan 2025 16:05:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=jpQS70OFVIGuC8+bJ72hAEd/0CPrwbhQ9XeZ1ISfVrA=; b=JD6JslqpYQq7wmTqyPmYdQVSTtBoQIHmQUXimLkkfXjpXyL81V3+xdB4MrRgSPlXj9mt/u0Wl3GaIBr3eb1749UBXP6qI1BBC+1nQJdAuDrBzWwXauDVyWOH3yTiNrKjtcSJzcGClhqZhlhACOQ6aNXxTFqe3ekaX5n6zaoBCXM7MBvoA0pl/0SEfQ3AcCdOIS2CpzXCx5KqIB9HqZLZcpiITx/94IHSCnB4EQbwtkTkJkwZhHtGK8dD8Cx17K9IRq1mg7QM43sgyATW9pYKNqEjS9WPh73WbaMUdS9CVNpJZheo2L2QAZWsEEnSXC8roDJgup9T9odf35ORztpfsQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTSNK-0000M1-NJ; Thu, 02 Jan 2025 16:05:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75302] [PATCH] packages: Match renamed origin fields. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 02 Jan 2025 21:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75302 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75302@debbugs.gnu.org Cc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by submit@debbugs.gnu.org id=B.17358518751284 (code B ref -1); Thu, 02 Jan 2025 21:05:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Jan 2025 21:04:35 +0000 Received: from localhost ([127.0.0.1]:46936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTSMs-0000Kd-CT for submit@debbugs.gnu.org; Thu, 02 Jan 2025 16:04:34 -0500 Received: from lists.gnu.org ([2001:470:142::17]:39800) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tTSMq-0000KG-HR for submit@debbugs.gnu.org; Thu, 02 Jan 2025 16:04:33 -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 1tTSMj-0000G3-W9 for guix-patches@gnu.org; Thu, 02 Jan 2025 16:04:26 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117] helo=email.rimm.ee) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1tTSMi-0008O0-1m for guix-patches@gnu.org; Thu, 02 Jan 2025 16:04:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1735851854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jpQS70OFVIGuC8+bJ72hAEd/0CPrwbhQ9XeZ1ISfVrA=; b=ontfzeMo3pX/Rn2FbgMxTBLRVZ5HOn1NDTdhP5FqkvcgCw1bR3zGGyJeUCPYPuhDYLt5wN uQGNqqdAG8ciK972GOUSjOlUNUDApBT7YI1O2pG/QeXKZ6HNKlJfOh81ehI0mAWvOId2mi FVbNklULbR8pcfBapsgnMN4GMkj83zx6oCE/HPAzGMydezmqjZPGJ0AG5f3ZkFA5yKe7Lt WS2hqrNhNYBFnOYwb/TRW9R/07eckZJEJX2+vM3P/jUxbNtJqRZatycu6PeoIsgbVV9Hcn 2J8U6c7UTmPoXQxFZa4Qa0z62TANvnU1+TPP8g3ThzUT1wSgBM0gQSN+4/Pl3w== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 2074d839 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for ; Thu, 2 Jan 2025 21:04:14 +0000 (UTC) Date: Thu, 2 Jan 2025 22:03:30 +0100 Message-ID: <18c0be606434165893e9566caa34aff0f3776a0e.1735851535.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=81.205.150.117; envelope-from=herman@rimm.ee; helo=email.rimm.ee X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -2.00 X-Spam-Score: -2.00 X-Migadu-Queue-Id: AE3DA6026 X-TUID: S1GhtsNpLDjB * guix/packages.scm (print-origin, origin->derivation): Use match-record. Change-Id: Ia554dd3264f51e549df51f767c754040b3dc7611 --- Hello, Three tests in (tests packages) fail as before: "package-source-derivation, local-file" "package-source-derivation, origin, sha512" "package-source-derivation, origin, sha3-512" Cheers, Herman guix/packages.scm | 59 ++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index ff9fbd84709..6088457b20b 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2022 jgart ;;; Copyright © 2023 Simon Tournier ;;; Copyright © 2024 Janneke Nieuwenhuizen +;;; Copyright © 2025 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -359,12 +360,10 @@ (define-syntax-rule (origin fields ...) (define (print-origin origin port) "Write a concise representation of ORIGIN to PORT." - (match origin - (($ uri method hash file-name patches) - (simple-format port "#" - uri hash - (force patches) - (number->string (object-address origin) 16))))) + (match-record origin (uri method hash file-name patches) + (simple-format port "#" + uri hash patches + (number->string (object-address origin) 16)))) (set-record-type-printer! print-origin) @@ -2151,31 +2150,29 @@ (define-gexp-compiler (package-compiler (package ) system target) (define* (origin->derivation origin #:optional (system (%current-system))) "Return the derivation corresponding to ORIGIN." - (match origin - (($ uri method hash name (= force ()) #f) - ;; No patches, no snippet: this is a fixed-output derivation. - (method uri - (content-hash-algorithm hash) - (content-hash-value hash) - name #:system system)) - (($ uri method hash name (= force (patches ...)) snippet - flags inputs (modules ...) guile-for-build) - ;; Patches and/or a snippet. - (mlet %store-monad ((source (method uri - (content-hash-algorithm hash) - (content-hash-value hash) - name #:system system)) - (guile (package->derivation (or guile-for-build - (default-guile)) - system - #:graft? #f))) - (patch-and-repack source patches - #:inputs inputs - #:snippet snippet - #:flags flags - #:system system - #:modules modules - #:guile-for-build guile))))) + (match-record origin + (uri method hash file-name patches patch-flags patch-inputs + patch-guile snippet modules) + (let* ((hash-algo (content-hash-algorithm hash)) + (hash (content-hash-value hash)) + (source (method uri hash-algo hash file-name + #:system system))) + (if (or snippet (pair? patches)) + (mlet %store-monad + ((guile (package->derivation (or patch-guile + (default-guile)) + system + #:graft? #f)) + (source source)) + (patch-and-repack source patches + #:inputs patch-inputs + #:snippet snippet + #:flags patch-flags + #:system system + #:modules modules + #:guile-for-build guile)) + ;; This is a fixed-output derivation. + source)))) (define-gexp-compiler (origin-compiler (origin ) system target) ;; Compile ORIGIN to a derivation for SYSTEM. This is used when referring base-commit: 5d7455bb580eed41a4fa7c20b71eaccad9f49e73 -- 2.45.2