From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0CAiC1cpxV9dNAAA0tVLHw (envelope-from ) for ; Mon, 30 Nov 2020 17:18:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UCAGB1cpxV/EcgAAB5/wlQ (envelope-from ) for ; Mon, 30 Nov 2020 17:18:15 +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 7168C940509 for ; Mon, 30 Nov 2020 17:18:14 +0000 (UTC) Received: from localhost ([::1]:55746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjmoW-0002aM-AF for larch@yhetil.org; Mon, 30 Nov 2020 12:18:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjmoJ-0002aA-7Q for help-guix@gnu.org; Mon, 30 Nov 2020 12:17:59 -0500 Received: from lepiller.eu ([89.234.186.109]:46626) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjmoF-00014g-TW for help-guix@gnu.org; Mon, 30 Nov 2020 12:17:58 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 2a514868; Mon, 30 Nov 2020 17:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date :in-reply-to:references:mime-version:content-type :content-transfer-encoding:subject:to:cc:from:message-id; s= dkim; bh=E56ojczqTnsB9zCFUw+wCQLarzSJ4J5TC9NQ9TSfIVg=; b=jeVWCog xnUGVx05ygjyQ8QhlcICguTiT0R6cgzfRxu3N0rLTwyT7uzQfGGJlp39BFN5vCTc xp2YnmLVl6RvkgY/PFxJLuO91FkrJDxjMvGdw8f8WY103jYC3lKd4fsEI6UHskbC +NC/POtsDxGj97Q5PvQgBbX26l/lZFqCBzJDgyi9WoWMWbr8T8zKIvz14VjtzPzH guMIWE3VwjCzylgKRQB7L2uAtgSRdvaYTXj3f3+U4E8QVvCLpuOnX1fDDD8oQ52C ExNw2aQC33RFh4vGe46PS2giZkGDH9R4j9mEo00N16MEUmuIb7Hk4NwiQKVUsbnn gRp63Fv5GsqvaCg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 964c6162 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Mon, 30 Nov 2020 17:17:45 +0000 (UTC) Date: Mon, 30 Nov 2020 12:17:30 -0500 User-Agent: K-9 Mail for Android In-Reply-To: <86mtyyzuag.fsf@gmail.com> References: <86mtyyzuag.fsf@gmail.com> MIME-Version: 1.0 Subject: Re: How do you write a package's deps to a file? To: help-guix@gnu.org,"Bonface M. K." From: Julien Lepiller Message-ID: Received-SPF: pass client-ip=89.234.186.109; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Cc: Pjotr Prins Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.18 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=lepiller.eu header.s=dkim header.b=jeVWCog ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=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: 7168C940509 X-Spam-Score: -0.18 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: AujhsVD+DyAt The reason you always get the same data is because you're assigning "name" = inside the sexp (build-side), but you're using it inside tge unquote (host-= side), so it refers to the name of the package you're building=2E I think you're doing it wrong, because some input names have no correspond= ing package (see source for instance)=2E Why not use the package data direc= tly, like guix graph does for instance? Le 30 novembre 2020 11:25:11 GMT-05:00, "Bonface M=2E K=2E" a =C3=A9crit : > >Hi guix! I want to output the deps of a package to >a writable file=2E Like say the "hello" world >package, I'd like to insert a file after, say the >install phase, so that later I could parse it and >serve it from a website=2E Here's a snip of what I >have: > >#+begin_src scheme >(add-after 'install 'create-dependency-file > (lambda* (#:key inputs outputs #:allow-other-keys) > (call-with-output-file > (string-append > (assoc-ref outputs "out") > "/lib/python3=2E8/site-packages" > "/wqflask/DEPENDENCIES=2Etxt") > (lambda (port) > (format > port " >#### System Inputs (generated from Guix) >|Name | Version | Home Page | Description | >|-----|---------|-----------|-------------| >|~a| >" > (apply > string-append > (map (lambda (input) > (let ((name (car input))) > (string-append > "| **" name "** | " > ,(package-version > (specification->package name)) " | " > ,(package-home-page > (specification->package name)) > " |" > ,(package-description > (specification->package name)) > " |\n"))) > inputs))) > )) > )) >#+end_src > >That ^^ doesn't seem to work as I'd like it to=2E The output(truncated) >looks something like: > =20 >#+begin_src markdown >=E2=9E=9C guix git:(master) =E2=9C=97 cat >~/opt/python3-genenetwork2/lib/python3=2E8/site-packages/wqflask/DEPENDEN= CIES=2Etxt > > > #### System Inputs (generated from Guix) >|Name | Version | Home Page | Description | >|-----|---------|-----------|-------------| >|| **python** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **source** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwo= rk >installation sumo=2E | >| **javascript-colorbox** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eor= g/ >|Genenetwork installation sumo=2E | >| **coreutils** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **git** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwork >installation sumo=2E | >| **which** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwor= k >installation sumo=2E | >| **grep** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwork >installation sumo=2E | >| **r** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwork >installation sumo=2E | >| **r-ctl** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwor= k >installation sumo=2E | >| **r-qtl** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwor= k >installation sumo=2E | >| **r-wgcna** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **redis** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwor= k >installation sumo=2E | >| **mariadb** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **gemma** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwor= k >installation sumo=2E | >| **gemma-wrapper** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **plink-ng-gn** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **racket-minimal** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **rust-qtlreaper** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **nginx** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwor= k >installation sumo=2E | >| **python-twint** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **python-unittest2** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **javascript-twitter-post-fetcher** | 3=2E11-guix-84cbf35 | >http://genenetwork=2Eorg/ |Genenetwork installation sumo=2E | >| **javascript-cytoscape** | 3=2E11-guix-84cbf35 | >http://genenetwork=2Eorg/ |Genenetwork installation sumo=2E | >| **javascript-panzoom** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg= / >|Genenetwork installation sumo=2E | >| **javascript-qtip** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **javascript-chroma** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **javascript-d3-tip** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **javascript-jscolor** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg= / >|Genenetwork installation sumo=2E | >| **javascript-colorbox** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eor= g/ >|Genenetwork installation sumo=2E | >| **javascript-jszip** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **js-jstat** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **js-md5** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ |Genenetwo= rk >installation sumo=2E | >| **js-parsley** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **javascript-plotly** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **javascript-typeahead** | 3=2E11-guix-84cbf35 | >http://genenetwork=2Eorg/ |Genenetwork installation sumo=2E | >| **js-underscore** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **js-smart-time-ago** | 3=2E11-guix-84cbf35 | http://genenetwork=2Eorg/ >|Genenetwork installation sumo=2E | >| **javascript-nouislider** | 3=2E11-guix-84cbf35 | >http://genenetwork=2Eorg/ |Genenetwork installation sumo=2E | >#+end_src > >Notice that the version, home page and description >are repeated across rows=2E Herein lies my question: >How would you fetch the details of the inputs(like >version, home-page, description) etc etc from a >modifed phase=2E Do I need to create a closure from >which I can import the modules like say _(use (gnu >packages))_=2E How do I do that if that's the case? > >Is it also possible to get the same information in >a fine grained manner, like say get the >propagated-inputs instead of getting /all/ inputs? > >--=20 >Bonface M=2E K=2E >Chief Emacs Bazu / Rieng ya software sare >Mchochezi of: / Twitter: @BonfaceKilz >GPG Key: D4F09EB110177E03C28E2FE1F5BBAE1E0392253F