From patchwork Mon Feb 27 00:11:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47412 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 5FBAA16A98; Mon, 27 Feb 2023 00:13:14 +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.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS 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 4EF9016937 for ; Mon, 27 Feb 2023 00:13:12 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWR8h-0001IW-Ah; Sun, 26 Feb 2023 19:13: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 1pWR8d-0001Go-HW for guix-patches@gnu.org; Sun, 26 Feb 2023 19:13:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWR8a-0007ce-Su for guix-patches@gnu.org; Sun, 26 Feb 2023 19:13:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWR8a-0005XE-Nf for guix-patches@gnu.org; Sun, 26 Feb 2023 19:13:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61829] [PATCH 07/11] services: guix-publish: Remove 'compression-level' field. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 27 Feb 2023 00:13:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61829 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61829@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61829-submit@debbugs.gnu.org id=B61829.167745673121172 (code B ref 61829); Mon, 27 Feb 2023 00:13:04 +0000 Received: (at 61829) by debbugs.gnu.org; 27 Feb 2023 00:12:11 +0000 Received: from localhost ([127.0.0.1]:45320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWR7j-0005VL-5h for submit@debbugs.gnu.org; Sun, 26 Feb 2023 19:12:11 -0500 Received: from smtpm4.myservices.hosting ([185.26.105.235]:56126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWR7a-0005TP-G0 for 61829@debbugs.gnu.org; Sun, 26 Feb 2023 19:12:02 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id 3165C20D51 for <61829@debbugs.gnu.org>; Mon, 27 Feb 2023 01:11:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id DCEC98009A; Mon, 27 Feb 2023 01:11:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id QA1hrEoCZHdQ; Mon, 27 Feb 2023 01:11:53 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7D16C80097; Mon, 27 Feb 2023 01:11:51 +0100 (CET) From: Bruno Victal Date: Mon, 27 Feb 2023 00:11:40 +0000 Message-Id: <014d8b0f1dc3cc1e9b05987bc71b4835e72e4a57.1677456515.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 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: , 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/services/base.scm ()[compression-level]: Remove field. (guix-publish-configuration-compression-level): Remove procedure. (default-compression): Remove compression-level helper code. --- gnu/services/base.scm | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 483a4ccd05..8d72ff900b 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -222,7 +222,6 @@ (define-module (gnu services base) guix-publish-configuration-port guix-publish-configuration-host guix-publish-configuration-compression - guix-publish-configuration-compression-level ;deprecated guix-publish-configuration-nar-path guix-publish-configuration-cache guix-publish-configuration-ttl @@ -1953,10 +1952,7 @@ (define-record-type* (default #f)) (compression guix-publish-configuration-compression (thunked) - (default (default-compression this-record - (current-source-location)))) - (compression-level %guix-publish-configuration-compression-level ;deprecated - (default #f)) + (default (default-compression this-record))) (nar-path guix-publish-configuration-nar-path ;string (default "nar")) (cache guix-publish-configuration-cache ;#f | string @@ -1970,25 +1966,14 @@ (define-record-type* (negative-ttl guix-publish-configuration-negative-ttl ;#f | integer (default #f))) -(define-deprecated (guix-publish-configuration-compression-level config) - "Return a compression level, the old way." - (match (guix-publish-configuration-compression config) - (((_ level) _ ...) level))) - -(define (default-compression config properties) +(define (default-compression config) "Return the default 'guix publish' compression according to CONFIG, and raise a deprecation warning if the 'compression-level' field was used." - (match (%guix-publish-configuration-compression-level config) - (#f - ;; Default to low compression levels when there's no cache so that users - ;; get good bandwidth by default. - (if (guix-publish-configuration-cache config) - '(("gzip" 5) ("zstd" 19)) - '(("gzip" 3) ("zstd" 3)))) ;zstd compresses faster - (level - (warn-about-deprecation 'compression-level properties - #:replacement 'compression) - `(("gzip" ,level))))) + ;; Default to low compression levels when there's no cache so that users + ;; get good bandwidth by default. + (if (guix-publish-configuration-cache config) + '(("gzip" 5) ("zstd" 19)) + '(("gzip" 3) ("zstd" 3)))) ;zstd compresses faster (define (guix-publish-shepherd-service config) (define (config->compression-options config)