From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id MLVIDmrsbGTYPwAASxT56A (envelope-from ) for ; Tue, 23 May 2023 18:40:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MGxpDmrsbGRUrgAAauVa8A (envelope-from ) for ; Tue, 23 May 2023 18:40:10 +0200 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 03A7824FFE for ; Tue, 23 May 2023 18:40:10 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1V2z-0003ZN-EU; Tue, 23 May 2023 12:39:41 -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 1q1V2x-0003Z0-9s for guix-devel@gnu.org; Tue, 23 May 2023 12:39:39 -0400 Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1V2b-0002Mj-Kr for guix-devel@gnu.org; Tue, 23 May 2023 12:39:20 -0400 Date: Tue, 23 May 2023 16:39:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1684859954; x=1685119154; bh=gsWTQ/JNU7yPPkITF258AUPRMPxhJ1xSsQinJTr4kOg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=pRU9amo8M7xTEl4Ou/2rW+6Z5mFMHJu+P73OPBhWQQ8zp+dX3tXdXLZacPRTEOtgP sfWC74mn1jSV+uQAhlC9pFZvisjX0RqkXy3OeBiS5yt7ICapt+wATZX0bW9213lDiK e35+UULQrSvDJ/Rp7GKe5A0NeZ8N2kzOowgPnO/hiKw11F92J0TuA71It08pQth5QN H1LpbT5Sz1JpfJYYCt73+5eKccBxUTUcIi0tPJcSa1I0RB+n5EpyIpr8uSuijhyAxv oQ/ZLZx/J1mdLUHxM4nndIblIKr8bmO3td5Y1Jco2Q2olCRCN4TQ8trTTCDQeqZp8i h5ZGY7U6/310g== To: Timothy Washington From: Kaelyn Cc: Simon Tournier , Guix Devel Subject: Re: Howto reference a custom package from a manifest Message-ID: In-Reply-To: References: <875y8oz4ab.fsf@gmail.com> Feedback-ID: 34709329:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.22; envelope-from=kaelyn.alexi@protonmail.com; helo=mail-4322.protonmail.ch 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, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, WEIRD_QUOTING=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684860010; a=rsa-sha256; cv=none; b=NgCkHa0XDzdfMyVhnJ+0vz6MKzoPlkqdn8ivRgukwndO1MvXG6A3yi00MjnRYvp6IDTyNe UX7MxW9ZuUhPFJJtB73vTx1QhYE0FV6ljRSrmnTZV9ydJvK5ruOrbIFEgSp0xNMxJbnxMZ sA6s0nYGwnc2eakcp4nTjUzBc2pMmW/rO+C8uiozLiglk1F+gxVsGqcbqAV5W5LEs+DjWP ozt783N8VuoTqBiS//JvzVzecIXK+8PA7cMhxXttfSS7hEhJ1cJ24/vqTJWoSMtKr3lfVC u8anoJy4S1v+16utDvuUr+fF1iAvZINAZs6rzkqgCYantkR/rFL5WGscWG1eJQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=pRU9amo8; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684860010; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=gsWTQ/JNU7yPPkITF258AUPRMPxhJ1xSsQinJTr4kOg=; b=DKweLBqLnXxWwao451RBoSyNFMZSRn3DpqOdD3O7mlDbvDJd7gAEBbUZaR0aF2XA9AmJ1v ghIaJcGt4ciidR3GdvnAHj+u3c5b+s7T+FUNSLpeLWzWyd5sgZx5ieai12n9yuoYenRmG2 Lw1ShFNiwriEPso+3mQN5gZkjKUrMCezE815QPXzuONvDN/qzE0xrO7ncE/Me3B2rZqijk bQEQFNsmG8pusf6qYfk2jjv5HaEgLMdGgp1alth9r+m9W05B/vXTS7tziChx5bmusYwiz9 QKfseKHA4OIz+0wIUyYKLw4Wq0Aa2LyXIhbVhEM4P2jUFGCOzNNSYww4ejsrOA== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=pRU9amo8; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.82 X-Spam-Score: -4.82 X-Migadu-Queue-Id: 03A7824FFE X-TUID: a+NVqusGP+BO Hi Tim, ------- Original Message ------- On Monday, May 22nd, 2023 at 8:20 PM, Timothy Washington wrote: > Yes that was it! I added "(native-inputs (list perl python))" to my packa= ge definition. > $ guix build -L ~/dotfiles/ rust-rustscan # A. Now builds again! > /gnu/store/4bldy27x1f2mzjqg5jd176nrawl98y1y-rust-rustscan-2.1.1 >=20 > $ guix package -L ~/dotfiles/ -m ~/dotfiles/guix/packages/manifest.scm # = B. Now also builds! > ... > The following derivation will be built: > /gnu/store/xll763hpl7mvdkxd3kf8f98pygarzh41-profile.drv >=20 > ... >=20 > guix package --list-profiles # C. does NOT show the custom profile just b= uilt > /home/twashing/.config/guix/current > /home/twashing/.guix-profile This is expected. When you ran the "guix package -L ~/dotfiles/ -m ~/dotfil= es/guix/packages/manifest.scm" command above, that not only built the manif= est but also used the manifest to create a new generation of /home/twashing= /.guix-profile. If you run "guix package --list-generations" you should see= a list of all of the existing (numbered) generations with the currently ac= tive generation marked (it's typically the last / latest generation, and sh= ould be in this case). Running "guix package -I" will list the packages in = the current generation of your default guix profile, which should contain t= he packages in your manifest. To go into more details about how profiles work: unless you specify the "-p= " argument to "guix package", it will operate on your default profile when = installing or removing packages (including through using manifests with "-m= "), and create a new generation when the set of installed packages changes.= /home/twashing/.guix-profile is a symlink to /var/guix/profiles/per-user/t= washing/guix-profile, which in turn is a symlink to one of the numbered sym= links in that same /var/guix directory (i.e. if your current generation num= ber is 14, then /var/guix/profiles/per-user/twashing/guix-profile will poin= t to /var/guix/profiles/per-user/twashing/guix-profile-14-link). Each of th= ose numbered symlinks points to the actual profile in /gnu/store, so using = that hypothetical generation 14 as the one created by your "guix package -m= " command above, /var/guix/profiles/per-user/twashing/guix-profile-14-link = would be a symlink to /gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile. >=20 >=20 > cat /gnu/store/xll763hpl7mvdkxd3kf8f98pygarzh41-profile.drv # D. DOES sho= w the new profile in /gnu/store > Derive([("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile","","= ")], ... ("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile"),("pr= eferLocalBuild","1")]) >=20 >=20 > i. Using a direct "guix build" gives you a directory in "/gnu/store". And= you can add that bin to your PATH. This is fragile and will work only as long as the package exists under /gnu= /store. Which is to say, this method will break as soon as "guix gc" is run= unless the package happens to be "live" as a member or dependency of any e= xisting generation of the system profile or other profiles (the profile gen= eration symlinks like the guix-profile-14-link mentioned above are the garb= age collector roots for guix, as can be seen with "guix gc --list-roots"). > ii. But for "/gnu/store/*-profile/", would you just loop over those profi= le directories, and run each "/gnu/store/*-profile/etc/profile"? This is a very bad idea, as many or most of those "/gnu/store/*-profile" di= rectories are different generations of the same profile, and sourcing them = all would result in many conflicts and other troubles, including having unp= redictable and likely outdated versions of commands being picked up before = newer counterparts. Cheers, Kaelyn >=20 >=20 > I'm attaching the full package definition to this email. >=20 > Thanks a lot!Tim >=20 > On Mon, 22 May 2023 at 14:18, Kaelyn wrote: >=20 > > Hi Tim, > >=20 > >=20 > > ------- Original Message ------- > > On Sunday, May 21st, 2023 at 8:35 PM, Timothy Washington wrote: > >=20 > >=20 > > > Hey Simon, sure thing. > > > I've attached "shaka.scm" here. I was able to build it separately (se= e "Howto supply cargo-build-system dependency to guix package definition").= That was using these commands. > > >=20 > > > guix import crate -r rustscan > > >=20 > > > guix build -L ~/dotfiles/ rust-rustscan-2 > > >=20 > > >=20 > > > A. I re-ran "guix build". Note that I definitely installed (and sourc= ed) perl and python3. > >=20 > >=20 > > You will need to add perl and python to the native-inputs field of your= rust-rustscan-2 package for it to see those two programs. When packages ar= e built, the building happens in an isolated environment distinct from your= shell environment, so packages you install through "guix package -i" or "g= uix install" won't be seen in the package's build environment. https://guix= .gnu.org/en/manual/devel/en/html_node/package-Reference.html#package-Refere= nce describes the various fields including three different types of inputs,= but my rule of thumb is that if the package depends on and is linking to a= library then the library package is an input, and if the dependency is a p= rogram that needs to be run as part of the build (such as the rustscan pack= age trying to run perl and python3) it should be a native-input. HTH! > >=20 > > Cheers, > > Kaelyn > >=20 > > P.S. I've not packaged any rust code, but from what I recall rust packa= ges that use cargo-build-system are a bit anomalous in that they have to de= clare the rust packages they depend on in a #:cargo-inputs argument instead= of the normal inputs package field. > >=20 > >=20 > > > And updated my system with "guix pull && guix package -u". But now it= 's failing with the below. > > >=20 > > >=20 > > > guix build -L ~/dotfiles/ rust-rustscan > > >=20 > > > substitute: updating substitutes from 'https://ci.guix.gnu.org'... 0.= 0%guix substitute: warning: ci.guix.gnu.org: connection failed: Connection = timed out > > > substitute: > > > substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'= ... 100.0% > > > The following derivation will be built: > > > /gnu/store/x695f07186dwqpw2jk48b62p2s18f5ry-rust-rustscan-2.1.1.drv > > > ... > > > phase `patch-usr-bin-file' succeeded after 0.0 seconds > > > starting phase `patch-source-shebangs' > > > patch-shebang: ./fixtures/.rustscan_scripts/test_script.pl: warning: = no binary for interpreter `perl' found in $PATH > > > patch-shebang: ./fixtures/.rustscan_scripts/test_script.py: warning: = no binary for interpreter `python3' found in $PATH > > > patch-shebang: ./fixtures/.rustscan_scripts/test_script.sh: changing = `/bin/bash' to `/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.= 1.16/bin/bash' > > > phase `patch-source-shebangs' succeeded after 0.0 seconds > > > starting phase `configure' > > > Unpacking rust-ansi-term... > > > error: failed to run custom build command for `ring v0.16.20` > > >=20 > > >=20 > > > Caused by: > > > process didn't exit successfully: `/tmp/guix-build-rust-rustscan-2.1.= 1.drv-0/rustscan-2.1.1/target/release/build/ring-9bf05aa562ef9c86/build-scr= ipt-build` (exit status: 101) > > > --- stderr > > > running "perl" "crypto/fipsmodule/aes/asm/aesni-x86_64.pl" "elf" "/tm= p/guix-build-rust-rustscan-2.1.1.drv-0/rustscan-2.1.1/target/release/build/= ring-297f46c71994a65c/out/aesni-x86_64-elf.S" > > > thread 'main' panicked at 'failed to execute ["perl" "crypto/fipsmodu= le/aes/asm/aesni-x86_64.pl" "elf" "/tmp/guix-build-rust-rustscan-2.1.1.drv-= 0/rustscan-2.1.1/target/release/build/ring-297f46c71994a65c/out/aesni-x86_6= 4-elf.S"]: No such file or directory (os error 2)', /tmp/guix-build-rust-ru= stscan-2.1.1.drv-0/rustscan-2.1.1/guix-vendor/rust-ring-0.16.20.tar.xz/buil= d.rs:653:9 > > > note: run with `RUST_BACKTRACE=3D1` environment variable to display a= backtrace > > > warning: build failed, waiting for other jobs to finish... > > > error: in phase 'build': uncaught exception: > > > %exception #<&invoke-error program: "cargo" arguments: ("build" "--re= lease") exit-status: 101 term-signal: #f stop-signal: #f> > > > phase `build' failed after 12.2 seconds > > > command "cargo" "build" "--release" failed with status 101 > > > builder for `/gnu/store/x695f07186dwqpw2jk48b62p2s18f5ry-rust-rustsca= n-2.1.1.drv' failed with exit code 1 > > > build of /gnu/store/x695f07186dwqpw2jk48b62p2s18f5ry-rust-rustscan-2.= 1.1.drv failed > > > View build log at '/var/log/guix/drvs/x6/95f07186dwqpw2jk48b62p2s18f5= ry-rust-rustscan-2.1.1.drv.gz'. > > > guix build: error: build of `/gnu/store/x695f07186dwqpw2jk48b62p2s18f= 5ry-rust-rustscan-2.1.1.drv' failed > > >=20 > > > B. The idea is to include that package as part of a larger profile th= at I can add to my base user profile. That's using the below. rust-rustscan= is defined in "guix/packages/shaka.scm". > > > And I get an error gain, when calling guix package > > >=20 > > > guix package -L ~/dotfiles/ -m ~/dotfiles/guix/packages/manifest.scm > > > The following packages will be installed: > > > emacs 28.2 > > > gcc-toolchain 12.3.0 > > > git 2.40.1 > > > make 4.3 > > > rust-rustscan 2.1.1 > > > tree 2.1.0 > > > ungoogled-chromium 112.0.5615.165-1 > > > vim 9.0.1384 > > >=20 > > > substitute: updating substitutes from 'https://ci.guix.gnu.org'... 0.= 0%guix substitute: warning: ci.guix.gnu.org: connection failed: Connection = timed out > > > substitute: > > > The following derivations will be built: > > > /gnu/store/v5f24ky0nw76yy24jx1ihggs6yffnvvb-profile.drv > > > /gnu/store/x695f07186dwqpw2jk48b62p2s18f5ry-rust-rustscan-2.1.1.drv > > >=20 > > > ... > > > cannot build derivation `/gnu/store/v5f24ky0nw76yy24jx1ihggs6yffnvvb-= profile.drv': 1 dependencies couldn't be built > > > guix package: error: build of `/gnu/store/v5f24ky0nw76yy24jx1ihggs6yf= fnvvb-profile.drv' failed > > >=20 > > >=20 > > > Thanks > > > Tim > > >=20 > > > On Sun, 21 May 2023 at 12:46, Simon Tournier wrote: > > >=20 > > > > Hi, > > > >=20 > > > > Please keep CC guix-devel. > > > >=20 > > > > On Sun, 21 May 2023 at 04:44, Timothy Washington wrote: > > > >=20 > > > > > $ cat guix/packages/manifest.scm > > > > > (define-module (guix packages manifest)) > > > > > (use-modules (gnu packages)) > > > >=20 > > > > Well, I am not sure these two lines are required. > > > >=20 > > > > > building /gnu/store/x695f07186dwqpw2jk48b62p2s18f5ry-rust-rustsca= n-2.1.1.drv... > > > > > \ 'build' phasebuilder for `/gnu/store/x695f07186dwqpw2jk48b62p2s= 18f5ry-rust-rustscan-2.1.1.drv' failed with exit code 1 > > > >=20 > > > > It means your custom package rust-rustscan does not build. > > > >=20 > > > > Could you share your local file: ./guix/packages/shaka.scm containi= ng > > > > the definition of this custom package? > > > >=20 > > > >=20 > > > > Cheers, > > > > simon