From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id U/yIIDVDa2HqHQEAgWs5BA (envelope-from ) for ; Sat, 16 Oct 2021 23:25:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yEJ/GzVDa2H8UAAAbx9fmQ (envelope-from ) for ; Sat, 16 Oct 2021 21:25:09 +0000 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 214A18B74 for ; Sat, 16 Oct 2021 23:25:09 +0200 (CEST) Received: from localhost ([::1]:44148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbrAw-0004bA-V1 for larch@yhetil.org; Sat, 16 Oct 2021 17:25:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbrAk-0004af-Kx for help-guix@gnu.org; Sat, 16 Oct 2021 17:24:54 -0400 Received: from mail-il1-x142.google.com ([2607:f8b0:4864:20::142]:37629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mbrAi-0002sH-E9 for help-guix@gnu.org; Sat, 16 Oct 2021 17:24:54 -0400 Received: by mail-il1-x142.google.com with SMTP id x1so10920380ilv.4 for ; Sat, 16 Oct 2021 14:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beadling-co-uk.20210112.gappssmtp.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=wwD6qs2e9EpfXgTMhk1T2FNCpkKh5kRkBDIqORHChww=; b=BzYDMrD8ePNeeDIRMaGK2S8liHq7LKdZz4bEhTv0eXRPAsiiURvOjUKs9C8lmIfCD9 q9Po/Vj2jmZ4BHbcDvsN4oZOSJgHVK0p9qv6umIuIsW2I+Vn8xmJpKuuAYwGfxDVIlJ5 xjyOlSaUlCQe5jUqqw/HZ1m5ZpiRsm98VFghDC5fBOBxHZFF+Y8z1pRhJTIA44PkcLvp 3ip09m+jV8s5suns7y8+GhnWTOmVU2/cFQDAchHy6M7iTzW6J2SySY7Zkw34NMmCIIJt sijn5a2Tsfb+J8dzzm9+EythLRy+c2n7o5ncTm2uIPN1Ure3odL04I/r/V2pDIB4zFn4 RQZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=wwD6qs2e9EpfXgTMhk1T2FNCpkKh5kRkBDIqORHChww=; b=y4AM8Dz/KuxcPz/RhycOYv6Z6VlIulDhwwhiLUaKI709ko4Kn1Sixi1LQEaxin1L3y Y+91dc6AgvcPJGUEqwLRQ7BX6ZtAVhtjPAPTTVP2FZKhkvALwf7JsYpdAUBYqmP+4oBi WoUB9cce8mfcbrt3leSbY6C96Pwd13mWgsZ2vG/ruPRvarx60Wm5go3yp5dA3D7H7FIh sn0bw9YfsRFi90xqoSJU4DaOu04Ljpy7sOyb9YZOOfikR4D1SlLa3Qm05VrSC4o5fXyK 6u2Hdl+WlhkHmlFKi+oUACNfqSSrP3vZ0FtCi7Ioq0vFDatlLkO1tmpW7RtYDbAmcxRK Sksw== X-Gm-Message-State: AOAM533oBqb8NnvF40l8RGSbxKowpkpZtPc9juqugy1OgpyFmxI/mCJh 5pB3sOKRobiWm1CPMAtfyS7YYPAIWGzQAGopZRTiPLlWRSXCAVCnaFrq4Q== X-Google-Smtp-Source: ABdhPJzKDKoRuYRrKCEtO8T0Vr4lDHHEJj7c5iwW/zKZ+SAIAZE5mmZXGDpIlX3kpQR/+E2yrcPTHM/PdAxv3Zo6ilU= X-Received: by 2002:a05:6e02:13d0:: with SMTP id v16mr485664ilj.79.1634419490708; Sat, 16 Oct 2021 14:24:50 -0700 (PDT) MIME-Version: 1.0 From: Phil Beadling Date: Sat, 16 Oct 2021 22:24:40 +0100 Message-ID: Subject: Loading Channels from a file To: help-guix Received-SPF: none client-ip=2607:f8b0:4864:20::142; envelope-from=phil@beadling.co.uk; helo=mail-il1-x142.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634419509; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=gHS/XdVjsHct+QMfTl38Zw1cHMHNL41ya8/V+eIFAdo=; b=jsiOu2+53UlY+HnbIWxNrWyWVKwwG2wBLXqBitFcvYbOj0EXomdyaZ3+6z8GlD9WObFjyD oJhlXeLiYfWE+m94CJBZq0ipStDnGRXpEMejqq0v/E7wa3trogsueZ1w6dyaf8IIFqLP1A BkSQQCFnONcxEVWKpS5m1E76xXr3ncVyy7B56sgUi0h44NripVgfeEOcUHHGJAPUQRgy5f 7pgBBh6WcecOZBav3E2CJ3wc0Dk7mqpsiGyIHrmU8I/foZho+l07+NXRcLBsZPGJ9UtLLD kxopZVPs59v1gZnZxFVWgR4lz84Ss0G8KiejrH+V7J1tc96zZT8wxHn9JECtqg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634419509; a=rsa-sha256; cv=none; b=SeK0XXBpMsDDlA0Vc7Us/pLfDZ5ra5bFFANcOb7AkxEIy7blYqvrYN9S8BVGoKEHm9OaNa 3UDuhvaLvtucwxvRoojAV8BzsTkXnNcdotlYn16NkJXHvtLgKjKu1uWE/BQ876LRCEivtt Hvf74U6mZq5bveKzvVRgiOKwSyRs2gKwp8Nbliew37UW8UsBz67Qz7o05/IKwZakku+c2b Dohoj3uqxNkdjsXpGD02f4hwUcgIFlKWxs4trJx4akWwj5lnQj6MYJpbEWydyp+5iqG99M YNnKwWH/tHI9nP1zaFK+Bc8FVyjM0gAJFAyfZahYdSSly9ktWvMIPIlNV4vEuQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=beadling-co-uk.20210112.gappssmtp.com header.s=20210112 header.b=BzYDMrD8; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.82 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=beadling-co-uk.20210112.gappssmtp.com header.s=20210112 header.b=BzYDMrD8; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 214A18B74 X-Spam-Score: -1.82 X-Migadu-Scanner: scn1.migadu.com X-TUID: M5aRbzVIm9vq Hi, I have what I fear may be more of Guile question than a Guix question - but the context is Guix, so here goes! If I want to do the following - let's say I'm interested in playing around with Guix programatically, as it existed on the 3rd October. The following works perfectly well and can be passed into "guix repl -- my-script.scm". (define my-inferior (inferior-for-channels my-channels)) Obviously I need to provide a channel definition - to do this I cut and paste my copy of the channels.scm from the 3rd October directly into a variable my-channels in the same script and use as per above. (define my-channels (list (channel ;; channel describing the snapshot of Guix itself (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "20bc9ecc204a610a0d5fa8b88c74421f57dbaf3b") ;; 03/10 (introduction (make-channel-introduction "9edb3f66fd807b096b48283debdcddccfea34bad" (openpgp-fingerprint "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))) (channel (name 'guix-science) (url "https://github.com/guix-science/guix-science.git") (commit "b574aa67743cd4f138fd32efb7c116342f360625") ;; 03/10 (introduction (make-channel-introduction "b1fe5aaff3ab48e798a4cce02f0212bc91f423dc" (openpgp-fingerprint "CA4F 8CF4 37D7 478F DA05 5FD4 4213 7701 1A37 8446")))))) So far no surprises. I'd like to make this script a bit more generic so I want to be able to pass in the channel.scm file as a command line parameter. So I've come up with this: (define my-channels2 (call-with-input-file (option-ref options 'channel #f) read)) The "(option-ref options 'channel #f)" is just returning a command line option --channel which is a string of the form "/path/to/my/channels.scm" - this bit of the code I've tested to death (even replacing the a hardcoded string to be sure) - it's not the problem. If I (display my-channels2) it looks correct, but I notice that unlike (display my-channels) it hasn't evaluated each channel into a channel structure. my-channels2 looks like this: (list (channel (name (quote guix)) (url https://git.savannah.gnu.org/git/guix.git).... But my-channels looks like this: (#< name: guix url: "https://git.savannah.gnu.org/git/guix.git "..... It will probably come as no surprise that when I try to feed my-channels2 into inferior-for-channels, I'm getting a type mismatch: In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): list I'm clearly missing something trivial to get the channel definition loaded from a file into a form the same as when it's hardcoded directly into my Scheme script. Can anyone point me in the right direction? Cheers, Phil.