all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaelyn <kaelyn.alexi@protonmail.com>
To: Timothy Washington <twashing@gmail.com>
Cc: Simon Tournier <zimon.toutoune@gmail.com>,
	Guix Devel <guix-devel@gnu.org>
Subject: Re: Howto reference a custom package from a manifest
Date: Mon, 22 May 2023 18:17:59 +0000	[thread overview]
Message-ID: <whtm_6zx3HPrX1n-dUC3mSL4unrKAymlw2qK8P4GWvnQfFZ8DXm3V30ThQF7q8-g9-UYogwmvTeGTGS9TMi5RySJ7WBw9jFY4NZCurXjY5o=@protonmail.com> (raw)
In-Reply-To: <CAADtM-Zvio3sWm+iE-4p_6mmZ_8aihHaRHEgtGv_x8jPSbe=BQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 6359 bytes --]

Hi Tim,

------- Original Message -------
On Sunday, May 21st, 2023 at 8:35 PM, Timothy Washington <twashing@gmail.com> wrote:

> Hey Simon, sure thing.
>
> I've attached "shaka.scm" here. I was able to build it separately (see "[Howto supply cargo-build-system dependency to guix package definition](https://lists.gnu.org/archive/html/help-guix/2023-05/msg00009.html)"). That was using these commands.
>
> guix import crate -r rustscan
> guix build -L ~/dotfiles/ rust-rustscan-2
>
> A. I re-ran "guix build". Note that I definitely installed (and sourced) perl and python3.

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 are built, the building happens in an isolated environment distinct from your shell environment, so packages you install through "guix package -i" or "guix 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-Reference 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 program that needs to be run as part of the build (such as the rustscan package trying to run perl and python3) it should be a native-input. HTH!

Cheers,
Kaelyn

P.S. I've not packaged any rust code, but from what I recall rust packages that use cargo-build-system are a bit anomalous in that they have to declare the rust packages they depend on in a #:cargo-inputs argument instead of the normal inputs package field.

> And updated my system with "guix pull && guix package -u". But now it's failing with the below.
>
> guix build -L ~/dotfiles/ rust-rustscan
>
> 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`
> 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-script-build` (exit status: 101)
> --- stderr
> running "perl" "crypto/fipsmodule/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_64-elf.S"
> thread 'main' panicked at 'failed to execute ["perl" "crypto/fipsmodule/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_64-elf.S"]: No such file or directory (os error 2)', /tmp/guix-build-rust-rustscan-2.1.1.drv-0/rustscan-2.1.1/guix-vendor/rust-ring-0.16.20.tar.xz/build.rs:653:9
> note: run with `RUST_BACKTRACE=1` 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" "--release") 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-rustscan-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/95f07186dwqpw2jk48b62p2s18f5ry-rust-rustscan-2.1.1.drv.gz'.
> guix build: error: build of `/gnu/store/x695f07186dwqpw2jk48b62p2s18f5ry-rust-rustscan-2.1.1.drv' failed
>
> B. The idea is to include that package as part of a larger profile that 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
>
> 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
>
> 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
>
> ...
> cannot build derivation `/gnu/store/v5f24ky0nw76yy24jx1ihggs6yffnvvb-profile.drv': 1 dependencies couldn't be built
> guix package: error: build of `/gnu/store/v5f24ky0nw76yy24jx1ihggs6yffnvvb-profile.drv' failed
>
> Thanks
> Tim
>
> On Sun, 21 May 2023 at 12:46, Simon Tournier <zimon.toutoune@gmail.com> wrote:
>
>> Hi,
>>
>> Please keep CC guix-devel.
>>
>> On Sun, 21 May 2023 at 04:44, Timothy Washington <twashing@gmail.com> wrote:
>>
>>> $ cat guix/packages/manifest.scm
>>> (define-module (guix packages manifest))
>>> (use-modules (gnu packages))
>>
>> Well, I am not sure these two lines are required.
>>
>>> building /gnu/store/x695f07186dwqpw2jk48b62p2s18f5ry-rust-rustscan-2.1.1.drv...
>>> \ 'build' phasebuilder for `/gnu/store/x695f07186dwqpw2jk48b62p2s18f5ry-rust-rustscan-2.1.1.drv' failed with exit code 1
>>
>> It means your custom package rust-rustscan does not build.
>>
>> Could you share your local file: ./guix/packages/shaka.scm containing
>> the definition of this custom package?
>>
>> Cheers,
>> simon

[-- Attachment #2: Type: text/html, Size: 14648 bytes --]

  parent reply	other threads:[~2023-05-22 18:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18  6:51 Howto reference a custom package from a manifest Timothy Washington
2023-05-19 16:15 ` Simon Tournier
     [not found]   ` <CAADtM-bc9FU6B+k5UaJctk3+T2aPO_z2edp=SM5LoZgd5JeNYA@mail.gmail.com>
2023-05-21 16:46     ` Simon Tournier
2023-05-21 20:35       ` Timothy Washington
2023-05-22  8:41         ` issue with packaging 'rustscan' Simon Tournier
2023-05-22  9:56           ` Tobias Kortkamp
2023-05-22 20:21             ` Timothy Washington
2023-05-22 18:17         ` Kaelyn [this message]
2023-05-22 20:20           ` Howto reference a custom package from a manifest Timothy Washington
2023-05-23 16:39             ` Kaelyn
2023-05-24 20:25               ` Timothy Washington
2023-05-24 22:16                 ` Kaelyn
2023-05-26 23:27                   ` Timothy Washington
2023-05-23 16:54             ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-05-24 20:10               ` Timothy Washington

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='whtm_6zx3HPrX1n-dUC3mSL4unrKAymlw2qK8P4GWvnQfFZ8DXm3V30ThQF7q8-g9-UYogwmvTeGTGS9TMi5RySJ7WBw9jFY4NZCurXjY5o=@protonmail.com' \
    --to=kaelyn.alexi@protonmail.com \
    --cc=guix-devel@gnu.org \
    --cc=twashing@gmail.com \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.