From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qAxRIvhP6WF9OgEAgWs5BA (envelope-from ) for ; Thu, 20 Jan 2022 13:05:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cIHbHvhP6WGsGgEAauVa8A (envelope-from ) for ; Thu, 20 Jan 2022 13:05:12 +0100 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 CE70D39D71 for ; Thu, 20 Jan 2022 13:05:11 +0100 (CET) Received: from localhost ([::1]:36652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAWBi-0007t3-NQ for larch@yhetil.org; Thu, 20 Jan 2022 07:05:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAUKZ-0008Ik-Ri for guix-patches@gnu.org; Thu, 20 Jan 2022 05:06:11 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAUKQ-0007Ok-Oe for guix-patches@gnu.org; Thu, 20 Jan 2022 05:06:10 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nAUKQ-0005Rb-Kn for guix-patches@gnu.org; Thu, 20 Jan 2022 05:06:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53384] [PATCH] services: guix-publish: Add negative-ttl parameter. Resent-From: Guillaume Le Vaillant Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 20 Jan 2022 10:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53384 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53384@debbugs.gnu.org Cc: Guillaume Le Vaillant X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164267315620909 (code B ref -1); Thu, 20 Jan 2022 10:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jan 2022 10:05:56 +0000 Received: from localhost ([127.0.0.1]:56431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAUKJ-0005RB-Jq for submit@debbugs.gnu.org; Thu, 20 Jan 2022 05:05:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:49166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAUKI-0005R3-1S for submit@debbugs.gnu.org; Thu, 20 Jan 2022 05:05:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAUKF-000871-R8 for guix-patches@gnu.org; Thu, 20 Jan 2022 05:05:53 -0500 Received: from mout01.posteo.de ([185.67.36.65]:40149) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAUJx-0007J3-5w for guix-patches@gnu.org; Thu, 20 Jan 2022 05:05:34 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 3D55024002A for ; Thu, 20 Jan 2022 11:05:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1642673129; bh=wt2cafVNTPnVGceylTU2AF0QRyUxvv0iUU5i5XFPAgs=; h=From:To:Cc:Subject:Date:From; b=VEiJd0OQXwAoUIFFU+wNbUFSalkJPrStyCVsr+2SVw3vVQBYQ+8+pqZa4JvGnX2cq gFPJpJHE8YCCte141Uj5ww93ZHKj4BRixEdSyoBU2TmHlCoNNHhoS0p57jK5YNvsqy //CA54TVdnu6mQl99GCCRoK6f4Fc2GehK7IqTRzDJpz8BfLHrD9+IBtQcjlvK9zlzs 3o/vRjHAPbfna0kHbej2XWdW0ayMWrd1ak36KZIeGVX7OoAfbB7kaUADvZI8bI+h+n s/RtNlLNRGM0Kkdxmg7cX/Sy0fa3FDW0LO4yJGYGkQPyU2NBtjAypbw9ZxlXX3sH+6 CFSwS/8Klktlw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4JfdRq3hLDz9rxM; Thu, 20 Jan 2022 11:05:27 +0100 (CET) From: Guillaume Le Vaillant Date: Thu, 20 Jan 2022 10:04:18 +0000 Message-Id: <20220120100418.8490-1-glv@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.67.36.65; envelope-from=glv@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642680312; h=from:from:sender:sender: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=phQvYJeJvAIZDYGwXF7I9+O1Hy4AeFor3wl83Z7YMe8=; b=AFnVVQ/MUhIqA1nBH3CULCLuh0tcLspkRHavsFxKoytFDwM28JKzHKJhWPCEXtbhR9nPNn HmaKaXpFdd1IPyidNG8FAwumERRPg9OKgVSAt3clftwYmP6UhfKHB2gbUT8vy3hR/V+qd6 k25daJMlGxF2D0ILhZ1uF/J4BUK6eTR7ko8YVdnafGr6oYL4SKV6So6wQP0Kcj1f0tQfdr MYmcRtDFpvzugCJmmq4Z8H1j8NSwUJ39U9AOlkwJjkwLSkT8I1+SyUO+dmqZ0UKmPb7+Lx tEIzoAIYwi/8REerYp2FKDDQSE6z8fnnfDgVji+LRJIlPtov9IJ9xk9SxIEdaw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642680312; a=rsa-sha256; cv=none; b=ed3f+pdLLYz3K/bamihfjj40ajnUdf7fRHFDDgZjP0ieDzKKnhb6nZAUo6rQ4xPikGNMnp qcc/Oo6fsTlLjFs0RF3HuwvENDLubrRrQ3ThqC+Pz5E9LfhWJhdGh36x+0HOPs1YRVdLrK UnDuezpG0Pp1EEoCGLNyNIvUI29BXtgcrw2lz3dTohyHZ32GRqdONBfeAJHl2KT9uxnRk4 5XOmhdKjG0Lp0TQletUahz9+AKW5p2590/yXI9p2XwFaP92nMi6fYxNQ0Bhr8DzsQN5ExC cMJ22FOcedesr4rs+l2IUgwQK7u+CcomwlF0M0OmVpXKuMPTpgApzdhd6AzUZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=VEiJd0OQ; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); 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" X-Migadu-Spam-Score: -2.52 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=VEiJd0OQ; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); 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" X-Migadu-Queue-Id: CE70D39D71 X-Spam-Score: -2.52 X-Migadu-Scanner: scn0.migadu.com X-TUID: X0HJ8JuVX3Yy * gnu/services/base.scm (guix-publish-configuration): Add 'negative-ttl' field. (guix-publish-sheperd-service): Process it. * doc/guix.texi (Base Services)[guix-publish-service-type]: Add item for negative-ttl. --- doc/guix.texi | 7 ++++++- gnu/services/base.scm | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 28eaf8338c..912a8e3c5a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -69,7 +69,7 @@ Copyright @copyright{} 2019 Ivan Petkov@* Copyright @copyright{} 2019 Jakob L. Kreuze@* Copyright @copyright{} 2019 Kyle Andrews@* Copyright @copyright{} 2019 Alex Griffin@* -Copyright @copyright{} 2019, 2020, 2021 Guillaume Le Vaillant@* +Copyright @copyright{} 2019, 2020, 2021, 2022 Guillaume Le Vaillant@* Copyright @copyright{} 2020 Liliana Marie Prikler@* Copyright @copyright{} 2019, 2020, 2021, 2022 Simon Tournier@* Copyright @copyright{} 2020 Wiktor Żelazny@* @@ -16888,6 +16888,11 @@ cache miss. @xref{Invoking guix publish, When it is an integer, this denotes the @dfn{time-to-live} in seconds of the published archives. @xref{Invoking guix publish, @option{--ttl}}, for more information. + +@item @code{negative-ttl} (default: @code{#f}) +When it is an integer, this denotes the @dfn{time-to-live} in +seconds for the negative lookups. @xref{Invoking guix publish, +@option{--negative-ttl}}, for more information. @end table @end deftp diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 345e0ca0f7..fbd01e84d6 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2021 qblade ;;; Copyright © 2021 Hui Lu ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2022 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -196,6 +197,7 @@ (define-module (gnu services base) guix-publish-configuration-nar-path guix-publish-configuration-cache guix-publish-configuration-ttl + guix-publish-configuration-negative-ttl guix-publish-service-type gpm-configuration @@ -1828,7 +1830,9 @@ (define-record-type* (workers guix-publish-configuration-workers ;#f | integer (default #f)) (ttl guix-publish-configuration-ttl ;#f | integer - (default #f))) + (default #f)) + (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." @@ -1863,8 +1867,8 @@ (define (config->compression-options config) lst)))) (match-record config - (guix port host nar-path cache workers ttl cache-bypass-threshold - advertise?) + (guix port host nar-path cache workers ttl negative-ttl + cache-bypass-threshold advertise?) (list (shepherd-service (provision '(guix-publish)) (requirement `(user-processes @@ -1890,6 +1894,11 @@ (define (config->compression-options config) #$(number->string ttl) "s")) #~()) + #$@(if negative-ttl + #~((string-append "--negative-ttl=" + #$(number->string negative-ttl) + "s")) + #~()) #$@(if cache #~((string-append "--cache=" #$cache) #$(string-append -- 2.34.0