From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iGU9Of517GXgaAEA62LTzQ:P1 (envelope-from ) for ; Sat, 09 Mar 2024 15:45:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id iGU9Of517GXgaAEA62LTzQ (envelope-from ) for ; Sat, 09 Mar 2024 15:45:19 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=fastmail.com header.s=fm1 header.b=kRZcf4Bu; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b=TfjpC02Y; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fastmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709995518; a=rsa-sha256; cv=none; b=T8sTAUPH8Mhz+vhYCX0xK6chMWubIR3IiZfkbtiXR2PaIFhojaPKLefdJB2xBiwvWv+nRY wkMxCyhyViE9YeBWC4di0zk9fn/Tu3Vzyz2zqI5MHPwxPBLr0WsRdiypvA5m3zC0XXol+K 4w6bUw5yFX19QATKg16zCQrMaJ5ng/n2eZI7RDQNYFk+UOxLR6bM7Rcm126R7RXVydgTD4 pWZUIO4s0Hz3v75QyxhPj7T6u2EJ0CCOKxNRzChK050nQUczD3t3Qvjhko4YD2o9AfWeYl dooqJSLb9di2mvg6SKDQS0VGj84LLyB/MUX4lR5tXruFjkNN0bksusWrMevV7Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=fastmail.com header.s=fm1 header.b=kRZcf4Bu; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b=TfjpC02Y; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fastmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709995518; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=wuo42DzUytsZ5akgreCLqfIOQfny0Nqsg2/FsLZJkhA=; b=jBlBMAdGo5oZpkFop6XIVL7DCdbyZkR3NVLlZpHbaQnKgXbHk+NVuSC89/B3DwWc0h08af psG6fg+EM0SWr6FwybL7ZKdY8xdBtHg+f4FvE258s1fms7tEq11tkr0/nES/uZARIgVqa+ Im6VbQox1SSC20qblo4yIistigjLMyUPqy4BmML+iCrw6ELDIM569v/D5J0VbQvOj0cYjt GOaQCnr+oICET5OL6ofMIQuq84Dtfe7OT0BYTJ2SpDyVlwjiGv49/sIvysmsrZ6/FydJug KRHlKB06NXSFff8x1vluYyHbZxtSGrqNgGs0V6kLyyeC3BVmy+zoiZ6k3MFsoQ== 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 506DB6E0A9 for ; Sat, 9 Mar 2024 15:45:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rixwQ-0006Md-1y; Sat, 09 Mar 2024 09:44:50 -0500 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 1rixwN-0006MU-5B for help-guix@gnu.org; Sat, 09 Mar 2024 09:44:48 -0500 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rixwK-0007i5-4s for help-guix@gnu.org; Sat, 09 Mar 2024 09:44:46 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id 7C87413800A3 for ; Sat, 9 Mar 2024 09:44:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 09 Mar 2024 09:44:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1709995481; x=1710081881; bh=swMcIwQOh7 qo4VmcmYwEpVtIpNYvAI3CDZvqx2VLdfg=; b=kRZcf4BuIVda2SkwotIZZiNEtE 4QQGFi5asv32Q4eYyCOInVuFswN4skRBF2e0wTF4rDz1TWZmdS1tx/qGwL5B68cJ Xf7KMB1ox6EbCm4HmsCpHFSlEs8lcTDwTS56cLOyiiIsln/bxhAW/EcF07sUJ0Rx Cel+oH41j49hfCSBDGtn9aagnt2++iYeQRwPWuk7FwRfRiRyy0EtqOXk8TAyxyUw W2St3Y1LZH01R+RvBuDZ3alr0tbMXHU34lB6O89ylWhi3M/drRpg8B7mmn+ailVV 3Sdx4lf+0ex6mJent2RGaVh2N+Tbzbw0R0YTok3dfugb1iYdJajC4dcvW6OQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709995481; x=1710081881; bh=swMcIwQOh7qo4VmcmYwEpVtIpNYv AI3CDZvqx2VLdfg=; b=TfjpC02YYWeUoTbvKtDGF0zB7SBMMsltLUyKWgU2U4Lb zgo1aUgr33uMdZFNWnAJavXrvHsXXqsfTtbj+fF3zlApobCVrV77oMwCHZkdqbOx vmVpXNhs+mFTZiY99GXVmBxmP8snvWKzHVltpsqzbAYpAqq+6XfPmXb+c/EV24ZP tNKnl4CEt76ynZAeYPH61HdCGj/gaW8ruifdbaEI9jE7wCfzagzhfEtlPR4hHQ6b K1W34WZ45o926cB0ROTEIQEOUB2bfE89JF1rqO6vZqVN+akPVTIPFIXIbaZpzR1f ZTPSOUikLf/Mh39ofMEmjWbUW09CpVI5mATZ/O0ifA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrieejgdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderre dtvdejnecuhfhrohhmpeflvghsshgvucfoihhllhifohhougcuoehjvghsshgvpghmsehf rghsthhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepgfeiveekudelvdelvdektd efvdelheegvedvudduvdeggeevheehieevteefudelnecuffhomhgrihhnpegtohguvggs vghrghdrohhrghdpghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehjvghsshgvpghmsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i57f947b1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 9 Mar 2024 09:44:40 -0500 (EST) Message-ID: <32c52408-e111-44b7-a03b-cfa10ab09c15@fastmail.com> Date: Sat, 9 Mar 2024 09:44:39 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Help with channel build system and package Content-Language: en-US To: help-guix@gnu.org References: <68237c05-3c30-4d36-b733-6251f168ad9e@millwood.earth> <71333165-cb1a-40b2-aee0-70eb68ded67a@millwood.earth> <3564583.iIbC2pHGDl@akashi> From: Jesse Millwood In-Reply-To: <3564583.iIbC2pHGDl@akashi> Received-SPF: pass client-ip=103.168.172.151; envelope-from=jesse_m@fastmail.com; helo=fout8-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: 2.63 X-Spam-Score: 2.63 X-Migadu-Queue-Id: 506DB6E0A9 X-TUID: VeGddxyTnvj1 Marek, Thanks for the detailed response! I really appreciate it. I responded inline. Is your main source of knowledge the official Guix documentation? On 3/8/24 05:43, Marek Paśnikowski wrote: > 08.03.2024 03:35:11 CET Jesse Millwood: >> I'm still trying to get this to work. I tracked some things I forgot and >> now have my channel hosted at: >> https://codeberg.org/moonling/guix-embedded-dev >> >> When I try to build my toolchain package I get this: >> >> ➜ guix build -v 4 -L guix-embedded-dev ct-ng-riscv64-unknown-elf >> substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0% >> substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... >> 100.0% >> The following derivation will be built: >> /gnu/store/wm1jba8npfb9jiqsbzd50gz4c89n3gjm-ct-ng-riscv64-unknown-elf-1.26.0 >> .drv building >> /gnu/store/wm1jba8npfb9jiqsbzd50gz4c89n3gjm-ct-ng-riscv64-unknown-elf-1.26.0 >> .drv... Backtrace: >> 3 (primitive-load "/gnu/store/kghq1xz3wyb509944y9jd8vhy0l?") >> In ice-9/eval.scm: >> 191:27 2 (_ #f) >> 223:20 1 (proc #) >> In unknown file: >> 0 (%resolve-variable (7 . gexp) #) >> >> ERROR: In procedure %resolve-variable: >> Unbound variable: gexp >> builder for >> `/gnu/store/wm1jba8npfb9jiqsbzd50gz4c89n3gjm-ct-ng-riscv64-unknown-elf-1.26. >> 0.drv' failed with exit code 1 >> build of >> /gnu/store/wm1jba8npfb9jiqsbzd50gz4c89n3gjm-ct-ng-riscv64-unknown-elf-1.26.0 >> .drv failed >> View build log at >> '/var/log/guix/drvs/wm/1jba8npfb9jiqsbzd50gz4c89n3gjm-ct-ng-riscv64-unknown- >> elf-1.26.0.drv.gz'. guix build: error: build of >> `/gnu/store/wm1jba8npfb9jiqsbzd50gz4c89n3gjm-ct-ng-riscv64-unknown-elf-1.26. >> 0.drv' failed >> >> >> It seems the issue here is an unbound variable "gexp". I'm a little >> confused about this because I have #:use-module (guix gexp) included in >> my package and build-system/crosstool-ng.scm files. The backtrace is a >> little hard to follow. > I am self-learning Scheme and yet confident in my skills, so take what I am > about to write with a dose of healthy scepticism. I am very much self learning as well. I've been comparing build system files and package files in my channel with upstream ones and pouring over the documentation. Any tips are very welcome! > 1. From the error message alone, I do not know whether the unresolved variable > is actually in the crosstool-ng package file, or anywhere else. > > 2. "gexp" or its alias "#~" do not occur in the body of the package module. > However, the module does depend, among others that I trust to be correct, on > the crosstool-ng build system. There is a potential for the unresolved > variable to live there. Oh interesting, I didn't know "#~" was an alias for "gexp"! I see that now in the G-Expressions section of the manual. > 3. Upon opening the build-system file, I was quickly drawn to the nested gexp > in the definition of build procedure. It took me some reading of the > documentation to somewhat understand what the #$@(sexp-gexp modules) form is. > My current understanding is that it brings an externally defined list of > modules. Interesting, this is a line that I didn't quite understand and mainly took from similar build systems in the guix source. > 4. The (crosstool-ng-build name inputs _) definition does contain what appears > to be a "modules" binding to a list of modules. That list does NOT contain > (guix gexp), and this in turn makes #~(crosstool-ng-build _) form unreadable > to the interpreter. Do mind that at this point the interpreter is not running > inside the build-system file — it is working on a staged code of #~(begin _). Oh this is very good information, thanks! > 5. My proposed solution is to include (guix gexp) in the (define* (crosstool- > ng-build name inputs _ (modules)) form. I have tested the change at the last > minute — guix no longer complains about unresolved variables, but there is a > new error about "no code for module (guix gexp)". More work needs to be put > into the code overall. Very interesting, thanks for trying that out! I'll incorporate it and keep digging!I do wonder why this is not included in other build systems in Guix? For example in guix/build-system/ruby.scm: (define %ruby-build-system-modules ;; Build-side modules imported by default. `((guix build ruby-build-system) ,@%gnu-build-system-modules)) ... (define* (ruby-build name inputs #:key source (gem-flags ''()) (test-target "test") (tests? #t) (phases '%standard-phases) (outputs '("out")) (search-paths '()) (system (%current-system)) (guile #f) (imported-modules %ruby-build-system-modules) (modules '((guix build ruby-build-system) (guix build utils)))) This is one that I have been basing my crosstool-ng build system on. I appreciate your analysis! > PS: I would appreciate it if someone who feels confident in their Scheme > knowledge could grade my line of reasoning. This is my first ever attempt to > debug completely foreign code.