From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 4CkIJfd1g2ZAIAAA62LTzQ:P1 (envelope-from ) for ; Tue, 02 Jul 2024 03:37:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 4CkIJfd1g2ZAIAAA62LTzQ (envelope-from ) for ; Tue, 02 Jul 2024 05:37:27 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=oM5kclxc; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1719891447; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=/RBbm3LE5YObA6CvcVcLu9peUH7R2XS5tmgMe5mwVr0=; b=erYnwoTNx4QrtyBEMz6M0fgQlkE04QT2pbUldhZihTAA54TZpU2KeSqsLPRK26DCst5UzG gKKLZXuQmFB3BMO4FAKl/Q+gRpH18s00b5weatApo2/7sF1T4uA9rxORCS3NZqOpXkTAmM 1nmGPyBPKH+OiQCNXoAqpCVEFlw5ngwkP1uz6WzKq167HFMRRFpLabja9C7hYy4SqCqeLI cO9RNJiVleVW1WvAMksVWyo2QKA5y6fXWOtlUWDu1diA9KWYTK/2nXeMfQIiIJ+3QXfXQR +KcAcG3A4ucWFYLe80N9MvdeyWVOaeMmVHygwOtW4q0SEanjWjxqJkavQWy36g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719891447; a=rsa-sha256; cv=none; b=k4Eu1Jej6IsHG6GS7A8iGcAOo+SVHtQUGyHTXcipJI7n6FaHcDAn6v9I6L6/WrkhGUuy70 4FQYBGeN0pnjgAsdLQdSwJSZlKJG8W55YpDrH0YXForIwe27pk+FR1Z0nSldicn8tae1Yb VJt1CYZqWW9jEp2Sdgx/NaJrVF8JD9fBV5/DslgNcxBDbbhLt3k//SfNwPYLdn7Myy2Xk9 jn2z8M3hQBYRzaHEAhzhKLTliuHrQeTrcxyVWUYF1u/RUOHJDtEhPfAJN/39cq5pCH8Tm7 bGolBWtxIn0csOqZpV6IIDhXKMzQTOlzZDa5diCRAB8TIEbVq4g9wmFHJzSmww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=oM5kclxc; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" 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 5C761FCF7 for ; Tue, 02 Jul 2024 05:37:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOUKF-0005Lr-EF; Mon, 01 Jul 2024 23:37:03 -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 1sOUKD-0005Li-Jw for bug-guix@gnu.org; Mon, 01 Jul 2024 23:37:01 -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 1sOUKD-0005i4-54 for bug-guix@gnu.org; Mon, 01 Jul 2024 23:37:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sOUKD-0001ZY-WF for bug-guix@gnu.org; Mon, 01 Jul 2024 23:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#71887: Raise an error when extending a service type that doesn't support extensions Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 02 Jul 2024 03:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71887 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 71887@debbugs.gnu.org Received: via spool by 71887-submit@debbugs.gnu.org id=B71887.17198914026015 (code B ref 71887); Tue, 02 Jul 2024 03:37:01 +0000 Received: (at 71887) by debbugs.gnu.org; 2 Jul 2024 03:36:42 +0000 Received: from localhost ([127.0.0.1]:35367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sOUJu-0001Yw-BC for submit@debbugs.gnu.org; Mon, 01 Jul 2024 23:36:42 -0400 Received: from mail-108-mta4.mxroute.com ([136.175.108.4]:33657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sOUJr-0001Yn-Jc for 71887@debbugs.gnu.org; Mon, 01 Jul 2024 23:36:40 -0400 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta4.mxroute.com (ZoneMTA) with ESMTPSA id 190718407c100017a3.001 for <71887@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 02 Jul 2024 03:36:36 +0000 X-Zone-Loop: fac88e882360878eca6a35a97fb473303f2c4d5d380b X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:To:From:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/RBbm3LE5YObA6CvcVcLu9peUH7R2XS5tmgMe5mwVr0=; b=oM5kclxccvukdR7GzSaSto2WZ6 JP1tgHY3fV92azr9Qidk9cZ6EhaX1AcTVRJDum5d344PFr1Uoo4a401P8+hYvKUXjQ7Ygs3RNXt3K TJ7UlKe+lQxh6U/PuCI3+plT0CCywxOegRNjLmek3WyvENZGhkyHzN9V9G7Ls7Yyoet9VOzTLiKY9 Q8aqTfyAhXUV9Ga215ipIfo1OHVIa1kBCQboN24OiG0M5MOzxzk8bSecxf7pInTm/fZ9ajn+zx+eM GUtXNWstyhqow7NwMFd6+UaqjNo1qjY2BFEjd7+EFuDfycpofEELFeV/g1vRHmF87CRjqlOB93j1u zvN/4eSQ==; From: Richard Sent In-Reply-To: <877ce4dar0.fsf@freakingpenguin.com> (Richard Sent's message of "Mon, 01 Jul 2024 18:10:27 -0400") References: <877ce4dar0.fsf@freakingpenguin.com> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Mon, 01 Jul 2024 23:36:29 -0400 Message-ID: <87cynwbh36.fsf@freakingpenguin.com> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@freakingpenguin.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.38 X-Spam-Score: -3.38 X-Migadu-Queue-Id: 5C761FCF7 X-Migadu-Scanner: mx11.migadu.com X-TUID: o9vevzn9i80d I've started looking into this issue and came up with the following diff: --8<---------------cut here---------------start------------->8--- diff --git a/gnu/services.scm b/gnu/services.scm index 88593e8091..e7e2da6ad5 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -1225,10 +1225,17 @@ (define* (fold-services services -> ;; Distinguish COMPOSE and EXTEND because PARAMS typically ;; has a different type than the elements of EXTENSIONS. - (if extend + (begin + (unless (or (null? extensions) + (and extend compose)) + (error (format #f "Extensions are not supported in ~a \ +yet the following extensions were found: ~a~%" + (service-kind sink) + dependents))) + (if extend (service (service-kind sink) (extend params (compose extensions))) - sink))) + sink)))) (mbegin %state-monad (set-current-state (vhash-consq sink service visited)) (return service)))) --8<---------------cut here---------------end--------------->8--- Unfortunately this approach isn't sufficient. In certain cases services intentionally extend other services to ensure they're instantiated even when the service is unused. For example, --8<---------------cut here---------------start------------->8--- (define cgit-service-type (service-type (name 'cgit) (extensions (list ... ;; Make sure fcgiwrap is instantiated. (service-extension fcgiwrap-service-type (const #t)))) ... (default-value (cgit-configuration)))) --8<---------------cut here---------------end--------------->8--- If we all agree that "make sure X is instantiated" service-extensions must use (const #t), then the above diff can work with minimal modifications (if every extension value is #t, valid). I'll see if I can find where to document this when I create the full patch. If not, I do not believe this bug is solvable. Any service can be extended with any value regardless of whether that value is used or coherent. Ergo there's no way to check if any particular extension is valid. $ make check-system TESTS=cgit is a good way to verify behavior in this context. -- Take it easy, Richard Sent Making my computer weirder one commit at a time.