From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 16 22:48:57 2024 Received: (at submit) by debbugs.gnu.org; 17 Mar 2024 02:48:57 +0000 Received: from localhost ([127.0.0.1]:57448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlga0-0008E1-Qv for submit@debbugs.gnu.org; Sat, 16 Mar 2024 22:48:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:56788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlgZy-0008Dn-Vf for submit@debbugs.gnu.org; Sat, 16 Mar 2024 22:48:55 -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 1rlgZN-0004eD-5Z for bug-guix@gnu.org; Sat, 16 Mar 2024 22:48:17 -0400 Received: from mail-108-mta137.mxroute.com ([136.175.108.137]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rlgZL-0002wE-9s for bug-guix@gnu.org; Sat, 16 Mar 2024 22:48:16 -0400 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta137.mxroute.com (ZoneMTA) with ESMTPSA id 18e4a4f3c2b0003bea.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 17 Mar 2024 02:48:10 +0000 X-Zone-Loop: 045bbf928bcec5c47a564990f19124065e8b5a67ae1c X-Originating-IP: [136.175.111.2] 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: 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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Niqj72JQ2G6CN6SqWohWM0X+2Wm4h7S5h2KGP2qHJwE=; b=n/eGJXU8xrjACporfGoJt27x7B MaAsEQuwTTFRMs8t6cyKufO7ZiyFwlr9Qq8oxRhchOJgZPGVNYaHEIj6Z65x1I7706cQlXYdgBPge l76zwu3rBxw8nz9gOaynsA/apvYTBiVt5MuiozMMyv8yX0r6peXQXZXBrQJJ4sgR+NN/ZkkdfW6ek UTJpSoUe6wk0RCqolWpmPPG9dRNIFm4B4Q1OJCQkggpARUKJvnnBDts/OPlPe+oxGKSFtPc0FpTeo 0eZCeizrKC/zmbMEC9AEfutkVbwR9nKnjw91zvyM77Zp8dphmksAxlmrPpG3OFPrg08U9gGdbxfrU vHo3A+aA==; From: Richard Sent To: bug-guix@gnu.org Subject: Guix build builds but errors when given file-like object Date: Sat, 16 Mar 2024 22:48:02 -0400 Message-ID: <87cyrt376l.fsf@freakingpenguin.com> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.137; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta137.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) When running ~$ guix build -f test.scm~, where test.scm returns a file like object, the output is built but an error is printed. According to (info (guix) Additional Build Options), file-like objects are supported by guix build -f. For example, with the following file: --8<---------------cut here---------------start------------->8--- (use-modules (guix gexp)) (plain-file "hello-world" "HELLO WORLD") --8<---------------cut here---------------end--------------->8--- /gnu/store/.....-hello-world is built and contains "HELLO WORLD", but there is an match error in guix/ui.scm:show-derivation-outputs. --8<---------------cut here---------------start------------->8--- ... In guix/scripts/build.scm: 804:26 4 (_) In srfi/srfi-1.scm: 634:9 3 (for-each # ?) In guix/ui.scm: 956:2 2 (show-derivation-outputs _) In ice-9/boot-9.scm: 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Throw to key `match-error' with args `("match" "no matching pattern" "/gnu/store/wvr6byljawdlxgxabl6798i0afqgpyiq-hello-world")'. --8<---------------cut here---------------end--------------->8--- This error could be fixed with the following patch: --8<---------------cut here---------------start------------->8--- diff --git a/guix/ui.scm b/guix/ui.scm index 962d291d2e..4dc926cbfe 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -958,7 +958,9 @@ (define (show-derivation-outputs derivation) (show-outputs derivation (derivation-output-names derivation))) ((? derivation-input? input) (show-outputs (derivation-input-derivation input) - (derivation-input-sub-derivations input))))) + (derivation-input-sub-derivations input))) + ((? string?) ;file-like object was built + (format #t "~a~%" derivation)))) (define* (check-available-space need #:optional (directory (%store-prefix))) --8<---------------cut here---------------end--------------->8--- However, this brings up another error. --8<---------------cut here---------------start------------->8--- ... In guix/scripts/build.scm: 808:49 3 (_ "/gnu/store/wvr6byljawdlxgxabl6798i0afqgpyiq-hello-w?") In guix/derivations.scm: 709:7 2 (derivation->output-paths "/gnu/store/wvr6byljawdlxgxab?") In ice-9/boot-9.scm: 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): "/gnu/store/wvr6byljawdlxgxabl6798i0afqgpyiq-hello-world" --8<---------------cut here---------------end--------------->8--- In my opinion, being able to directly build file-like objects from the command line is a useful feature and should be better supported. I don't know if the ideal fix involves changing the guix-build command in guix/scripts/build.scm to stop assuming everything is a derivation or changing the logic in guix/derivations.scm to handle strings in addition to derivation structs. Possible related: https://lists.gnu.org/archive/html/bug-guix/2022-07/msg00037.html. -- Take it easy, Richard Sent Making my computer weirder one commit at a time.