all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Howto reference a custom package from a manifest
@ 2023-05-18  6:51 Timothy Washington
  2023-05-19 16:15 ` Simon Tournier
  0 siblings, 1 reply; 15+ messages in thread
From: Timothy Washington @ 2023-05-18  6:51 UTC (permalink / raw)
  To: help-guix

I successfully installed a custom rust package (see "*Howto supply
cargo-build-system dependency to guix package definition*
<https://lists.gnu.org/archive/html/help-guix/2023-05/msg00009.html>").

It is located in
/gnu/store/10sivvy746n5jdnsgny5afxpwa5yzy5f-rust-rustscan-2.1.1/bin/rustscan

It's definition is
(define-public rust-rustscan-2
  (package
    (name "rust-rustscan")
    (version "2.1.1")
    ...))

But I'm getting a failure when trying to reference it in a local profile,
using specifications->manifest

A. How do I get more detail on the error, in order to troubleshoot. --debug
isn't yielding anything

B. How do I make rust-rustscan (my custom build of a rust package),
available in a global profile.


# guix/packages/manifest.scm
(specifications->manifest '("rust-rustscan-2"))  ;; Also fails...
(specifications->manifest '("rust-rustscan"))

# bash
$ guix package -m guix/packages/manifest.scm
guix package: error: rust-rustscan-2: unknown package
guix package: error: failed to load 'guix/packages/manifest.scm':
gnu/packages.scm:551:4: In procedure specification->package+output:

$ guix package -m guix/packages/manifest.scm --debug=5
guix package: error: rust-rustscan: unknown package
guix package: error: failed to load 'guix/packages/manifest.scm':
gnu/packages.scm:551:4: In procedure specification->package+output:
Throw to key `quit' with args `(1)'.

Tim

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
  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>
  0 siblings, 1 reply; 15+ messages in thread
From: Simon Tournier @ 2023-05-19 16:15 UTC (permalink / raw)
  To: Timothy Washington, help-guix

Hi,

On jeu., 18 mai 2023 at 02:51, Timothy Washington <twashing@gmail.com> wrote:

> It's definition is
> (define-public rust-rustscan-2
>   (package
>     (name "rust-rustscan")
>     (version "2.1.1")
>     ...))
>
> But I'm getting a failure when trying to reference it in a local profile,
> using specifications->manifest
>
> A. How do I get more detail on the error, in order to troubleshoot. --debug
> isn't yielding anything
>
> B. How do I make rust-rustscan (my custom build of a rust package),
> available in a global profile.

Well, from my understanding, the failure is because Guix is not able to
find the module where your custom package is defined.  And you have
various options, I think.

 1. Via the option --load-path
 2. Via a channel
    a) Using “guix pull”
    b) Using “guix time-machine”


1. Let say your custom package is defined in a Guile module located to
path/to/your/custom/package.scm, then,

    guix package -L path/to/your/custom/package.scm \
         -m guix/packages/manifest.scm

should do the job.

Give a look at: https://guix.gnu.org/manual/devel/en/guix.html#Package-Modules


2. If this path/to/your/custom is turned into a Git repository, i.e., a
channel, then you can add to some channels.scm file and then run:

    guix pull -C channels.scm

but I suggest instead to run,

    guix time-machine -C channels.scm \
         -- package -m guix/packages/manifest.scm

Last, you can put this channels.scm under ~/.config/guix and then “guix
pull” will load automatically.

Give a look at: https://guix.gnu.org/manual/devel/en/guix.html#Channels


Hope that helps,
simon




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
       [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
  0 siblings, 1 reply; 15+ messages in thread
From: Simon Tournier @ 2023-05-21 16:46 UTC (permalink / raw)
  To: Timothy Washington, Guix Devel

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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
  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 18:17         ` Howto reference a custom package from a manifest Kaelyn
  0 siblings, 2 replies; 15+ messages in thread
From: Timothy Washington @ 2023-05-21 20:35 UTC (permalink / raw)
  To: Simon Tournier; +Cc: Guix Devel


[-- Attachment #1.1: Type: text/plain, Size: 5136 bytes --]

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.
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 #1.2: Type: text/html, Size: 8416 bytes --]

[-- Attachment #2: shaka.scm --]
[-- Type: application/octet-stream, Size: 6398 bytes --]

(define-module (guix packages shaka)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system cargo)
  #:use-module (guix gexp)
  #:use-module (gnu packages crates-graphics)
  #:use-module (gnu packages crates-io)
  #:use-module (guix licenses))

(use-modules
 (guix profiles)
 ((guix licenses) #:prefix license:))


(define-public rust-text-placeholder-0.4
  (package
    (name "rust-text-placeholder")
    (version "0.4.1")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "text_placeholder" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0q0iq60dflczvyfp3m4wn3w358yyxmcljmzdb9b5favwnb2c8qcn"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs (("rust-serde" ,rust-serde-1)
                       ("rust-serde-json" ,rust-serde-json-1))))
    (home-page "https://github.com/bernardoamc/text-placeholder")
    (synopsis "A flexible text template engine")
    (description "This package provides a flexible text template engine")
    (license (list license:expat license:asl2.0))))

(define-public rust-rlimit-0.8
  (package
    (name "rust-rlimit")
    (version "0.8.3")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "rlimit" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "18vsz3fdj4s8yjp96wwq7wvrlc3vzzsqki8mfpha9m5zr0g8l9zp"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs (("rust-libc" ,rust-libc-0.2))))
    (home-page "https://github.com/Nugine/rlimit/")
    (synopsis "Resource limits")
    (description "Resource limits")
    (license license:expat)))

(define-public rust-gcd-2
  (package
    (name "rust-gcd")
    (version "2.3.0")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "gcd" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "06l4fib4dh4m6gazdrzzzinhvcpcfh05r4i4gzscl03vnjhqnx8x"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t))
    (home-page "https://github.com/frewsxcv/rust-gcd")
    (synopsis "Calculate the greatest common divisor")
    (description "Calculate the greatest common divisor")
    (license (list license:expat license:asl2.0))))

(define-public rust-colorful-0.2
  (package
    (name "rust-colorful")
    (version "0.2.2")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "colorful" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "1kj7vb4glvwcp75ambq2npf3dv1vjq4zkz12j8ypyzasaii0bbwp"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t))
    (home-page "https://github.com/mellite/colorful")
    (synopsis "Make your terminal output colorful")
    (description "Make your terminal output colorful")
    (license license:expat)))

(define-public rust-cidr-utils-0.5
  (package
    (name "rust-cidr-utils")
    (version "0.5.10")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "cidr-utils" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0750jbxvdbyyxcqnzsw438158r9drs2g077ymx9r9lv193q3dypx"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs (("rust-debug-helper" ,rust-debug-helper-0.3)
                       ("rust-num-bigint" ,rust-num-bigint-0.4)
                       ("rust-num-traits" ,rust-num-traits-0.2)
                       ("rust-once-cell" ,rust-once-cell-1)
                       ("rust-regex" ,rust-regex-1)
                       ("rust-serde" ,rust-serde-1))))
    (home-page "https://magiclen.org/cidr-utils")
    (synopsis
     "This crate provides data structures and functions to deal with IPv4 CIDRs and IPv6 CIDRs.")
    (description
     "This crate provides data structures and functions to deal with IPv4 CIDRs and
IPv6 CIDRs.")
    (license license:expat)))

(define-public rustscan
  (package
   (name "rust-rustscan")
    (version "2.1.1")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "rustscan" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "1xdxzp4dfa8dcc6srz5apbfxkcm1a1w5d4k7wym4x0ql5kibfb4b"))))
    (build-system cargo-build-system)
    (arguments
     `(#:tests? #f
       #:cargo-inputs (("rust-ansi-term" ,rust-ansi-term-0.12)
                       ("rust-anyhow" ,rust-anyhow-1)
                       ("rust-async-std" ,rust-async-std-1)
                       ("rust-cidr-utils" ,rust-cidr-utils-0.5)
                       ("rust-colored" ,rust-colored-2)
                       ("rust-colorful" ,rust-colorful-0.2)
                       ("rust-dirs" ,rust-dirs-3)
                       ("rust-env-logger" ,rust-env-logger-0.8)
                       ("rust-futures" ,rust-futures-0.3)
                       ("rust-gcd" ,rust-gcd-2)
                       ("rust-itertools" ,rust-itertools-0.9)
                       ("rust-log" ,rust-log-0.4)
                       ("rust-rand" ,rust-rand-0.7)
                       ("rust-rlimit" ,rust-rlimit-0.8)
                       ("rust-serde" ,rust-serde-1)
                       ("rust-serde-derive" ,rust-serde-derive-1)
                       ("rust-shell-words" ,rust-shell-words-1)
                       ("rust-structopt" ,rust-structopt-0.3)
                       ("rust-subprocess" ,rust-subprocess-0.2)
                       ("rust-text-placeholder" ,rust-text-placeholder-0.4)
                       ("rust-toml" ,rust-toml-0.5)
                       ("rust-trust-dns-resolver" ,rust-trust-dns-resolver-0.19))
       #:cargo-development-inputs (("rust-wait-timeout" ,rust-wait-timeout-0.2))))
    (home-page "https://github.com/rustscan/rustscan")
    (synopsis "Faster Nmap Scanning with Rust")
    (description "Faster Nmap Scanning with Rust")
    (license license:expat)))

^ permalink raw reply	[flat|nested] 15+ messages in thread

* issue with packaging 'rustscan'
  2023-05-21 20:35       ` Timothy Washington
@ 2023-05-22  8:41         ` Simon Tournier
  2023-05-22  9:56           ` Tobias Kortkamp
  2023-05-22 18:17         ` Howto reference a custom package from a manifest Kaelyn
  1 sibling, 1 reply; 15+ messages in thread
From: Simon Tournier @ 2023-05-22  8:41 UTC (permalink / raw)
  To: Timothy Washington; +Cc: Guix Devel

Hi,

On Sun, 21 May 2023 at 22:35, Timothy Washington <twashing@gmail.com> wrote:

> guix build -L ~/dotfiles/ rust-rustscan

[...]

>  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

The issue is that the Rust package named 'ring' cannot be built.
Since I am not an expert about Rust packaging, I do not know why and
how to fix this.  Well, one needs to put their hand in dirty Rust
packaging ;-)


Cheers,
simon


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: issue with packaging 'rustscan'
  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
  0 siblings, 1 reply; 15+ messages in thread
From: Tobias Kortkamp @ 2023-05-22  9:56 UTC (permalink / raw)
  To: Simon Tournier; +Cc: Timothy Washington, guix-devel


Simon Tournier <zimon.toutoune@gmail.com> writes:

> Hi,
>
> On Sun, 21 May 2023 at 22:35, Timothy Washington <twashing@gmail.com> wrote:
>
>> guix build -L ~/dotfiles/ rust-rustscan
>
> [...]
>
>>  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
>
> The issue is that the Rust package named 'ring' cannot be built.
> Since I am not an expert about Rust packaging, I do not know why and
> how to fix this.  Well, one needs to put their hand in dirty Rust
> packaging ;-)

Hello,

usually this error ("failed to execute" + "No such file or directory")
means that some build dependency is missing. In this case the build
script (build.rs) fails to run "perl
crypto/fipsmodule/aes/asm/aesni-x86_64.pl" to generate an assembly file.

Solution: add perl to native-inputs.

Best regards,

Tobias


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
  2023-05-21 20:35       ` Timothy Washington
  2023-05-22  8:41         ` issue with packaging 'rustscan' Simon Tournier
@ 2023-05-22 18:17         ` Kaelyn
  2023-05-22 20:20           ` Timothy Washington
  1 sibling, 1 reply; 15+ messages in thread
From: Kaelyn @ 2023-05-22 18:17 UTC (permalink / raw)
  To: Timothy Washington; +Cc: Simon Tournier, Guix Devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
  2023-05-22 18:17         ` Howto reference a custom package from a manifest Kaelyn
@ 2023-05-22 20:20           ` Timothy Washington
  2023-05-23 16:39             ` Kaelyn
  2023-05-23 16:54             ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
  0 siblings, 2 replies; 15+ messages in thread
From: Timothy Washington @ 2023-05-22 20:20 UTC (permalink / raw)
  To: Kaelyn; +Cc: Simon Tournier, Guix Devel


[-- Attachment #1.1: Type: text/plain, Size: 7777 bytes --]

Yes that was it! I added "(native-inputs (list perl python))" to my package
definition.

$ guix build -L ~/dotfiles/ rust-rustscan   # A. Now builds again!
/gnu/store/4bldy27x1f2mzjqg5jd176nrawl98y1y-rust-rustscan-2.1.1

$ 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
...

guix package --list-profiles   # C. does NOT show the custom profile just
built
/home/twashing/.config/guix/current
/home/twashing/.guix-profile

cat /gnu/store/xll763hpl7mvdkxd3kf8f98pygarzh41-profile.drv   # D. DOES
show the new profile in /gnu/store
Derive([("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile","","")],
...
("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile"),("preferLocalBuild","1")])


i. Using a direct "guix build" gives you a directory in "/gnu/store". And
you can add that bin to your PATH.
ii. But for "/gnu/store/*-profile/", would you just loop over those profile
directories, and run each "/gnu/store/*-profile/etc/profile"?


I'm attaching the full package definition to this email.

Thanks a lot!
Tim


On Mon, 22 May 2023 at 14:18, Kaelyn <kaelyn.alexi@protonmail.com> wrote:

> 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 #1.2: Type: text/html, Size: 14683 bytes --]

[-- Attachment #2: manifest.scm --]
[-- Type: text/x-scheme, Size: 299 bytes --]

;; (define-module (guix packages manifest))

;; (use-modules (gnu packages))

;; (specifications->manifest '("gcc-toolchain" "make" "git" "emacs" "vim" "tree" "ungoogled-chromium"))
(specifications->manifest '("gcc-toolchain" "make" "git" "emacs" "vim" "tree" "ungoogled-chromium" "rust-rustscan"))

[-- Attachment #3: rustscan.scm --]
[-- Type: text/x-scheme, Size: 6472 bytes --]

(define-module (guix packages rustscan)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system cargo)
  #:use-module (guix gexp)
  #:use-module (gnu packages crates-graphics)
  #:use-module (gnu packages crates-io)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages python)

  #:use-module ((guix licenses) #:prefix license:))

(define-public rust-text-placeholder-0.4
  (package
    (name "rust-text-placeholder")
    (version "0.4.1")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "text_placeholder" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0q0iq60dflczvyfp3m4wn3w358yyxmcljmzdb9b5favwnb2c8qcn"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs (("rust-serde" ,rust-serde-1)
                       ("rust-serde-json" ,rust-serde-json-1))))
    (home-page "https://github.com/bernardoamc/text-placeholder")
    (synopsis "A flexible text template engine")
    (description "This package provides a flexible text template engine")
    (license (list license:expat license:asl2.0))))

(define-public rust-rlimit-0.8
  (package
    (name "rust-rlimit")
    (version "0.8.3")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "rlimit" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "18vsz3fdj4s8yjp96wwq7wvrlc3vzzsqki8mfpha9m5zr0g8l9zp"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs (("rust-libc" ,rust-libc-0.2))))
    (home-page "https://github.com/Nugine/rlimit/")
    (synopsis "Resource limits")
    (description "Resource limits")
    (license license:expat)))

(define-public rust-gcd-2
  (package
    (name "rust-gcd")
    (version "2.3.0")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "gcd" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "06l4fib4dh4m6gazdrzzzinhvcpcfh05r4i4gzscl03vnjhqnx8x"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t))
    (home-page "https://github.com/frewsxcv/rust-gcd")
    (synopsis "Calculate the greatest common divisor")
    (description "Calculate the greatest common divisor")
    (license (list license:expat license:asl2.0))))

(define-public rust-colorful-0.2
  (package
    (name "rust-colorful")
    (version "0.2.2")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "colorful" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "1kj7vb4glvwcp75ambq2npf3dv1vjq4zkz12j8ypyzasaii0bbwp"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t))
    (home-page "https://github.com/mellite/colorful")
    (synopsis "Make your terminal output colorful")
    (description "Make your terminal output colorful")
    (license license:expat)))

(define-public rust-cidr-utils-0.5
  (package
    (name "rust-cidr-utils")
    (version "0.5.10")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "cidr-utils" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0750jbxvdbyyxcqnzsw438158r9drs2g077ymx9r9lv193q3dypx"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs (("rust-debug-helper" ,rust-debug-helper-0.3)
                       ("rust-num-bigint" ,rust-num-bigint-0.4)
                       ("rust-num-traits" ,rust-num-traits-0.2)
                       ("rust-once-cell" ,rust-once-cell-1)
                       ("rust-regex" ,rust-regex-1)
                       ("rust-serde" ,rust-serde-1))))
    (home-page "https://magiclen.org/cidr-utils")
    (synopsis
     "This crate provides data structures and functions to deal with IPv4 CIDRs and IPv6 CIDRs.")
    (description
     "This crate provides data structures and functions to deal with IPv4 CIDRs and
IPv6 CIDRs.")
    (license license:expat)))

(define-public rust-rustscan-2
  (package
    (name "rust-rustscan")
    (version "2.1.1")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "rustscan" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "1xdxzp4dfa8dcc6srz5apbfxkcm1a1w5d4k7wym4x0ql5kibfb4b"))))
    (build-system cargo-build-system)
    (arguments
     `(#:tests? #f
       #:cargo-inputs (("rust-ansi-term" ,rust-ansi-term-0.12)
                       ("rust-anyhow" ,rust-anyhow-1)
                       ("rust-async-std" ,rust-async-std-1)
                       ("rust-cidr-utils" ,rust-cidr-utils-0.5)
                       ("rust-colored" ,rust-colored-2)
                       ("rust-colorful" ,rust-colorful-0.2)
                       ("rust-dirs" ,rust-dirs-3)
                       ("rust-env-logger" ,rust-env-logger-0.8)
                       ("rust-futures" ,rust-futures-0.3)
                       ("rust-gcd" ,rust-gcd-2)
                       ("rust-itertools" ,rust-itertools-0.9)
                       ("rust-log" ,rust-log-0.4)
                       ("rust-rand" ,rust-rand-0.7)
                       ("rust-rlimit" ,rust-rlimit-0.8)
                       ("rust-serde" ,rust-serde-1)
                       ("rust-serde-derive" ,rust-serde-derive-1)
                       ("rust-shell-words" ,rust-shell-words-1)
                       ("rust-structopt" ,rust-structopt-0.3)
                       ("rust-subprocess" ,rust-subprocess-0.2)
                       ("rust-text-placeholder" ,rust-text-placeholder-0.4)
                       ("rust-toml" ,rust-toml-0.5)
                       ("rust-trust-dns-resolver" ,rust-trust-dns-resolver-0.19))
       #:cargo-development-inputs (("rust-wait-timeout" ,rust-wait-timeout-0.2))))
    (native-inputs (list perl python))
    (home-page "https://github.com/rustscan/rustscan")
    (synopsis "Faster Nmap Scanning with Rust")
    (description "Faster Nmap Scanning with Rust")
    (license license:expat)))


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: issue with packaging 'rustscan'
  2023-05-22  9:56           ` Tobias Kortkamp
@ 2023-05-22 20:21             ` Timothy Washington
  0 siblings, 0 replies; 15+ messages in thread
From: Timothy Washington @ 2023-05-22 20:21 UTC (permalink / raw)
  To: Tobias Kortkamp; +Cc: Simon Tournier, guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 4021 bytes --]

This was also touched on in the email thread "*Howto reference a custom
package from a manifest*". But I also wanted to acknowledge that "*Solution:
add perl to native-inputs*" was indeed the right answer. So thanks for
that.

I added "(native-inputs (list perl python))" to my package definition.

$ guix build -L ~/dotfiles/ rust-rustscan   # A. Now builds again!
/gnu/store/4bldy27x1f2mzjqg5jd176nrawl98y1y-rust-rustscan-2.1.1

$ 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
...

guix package --list-profiles   # C. does NOT show the custom profile just
built
/home/twashing/.config/guix/current
/home/twashing/.guix-profile

cat /gnu/store/xll763hpl7mvdkxd3kf8f98pygarzh41-profile.drv   # D. DOES
show the new profile in /gnu/store
Derive([("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile","","")],
...
("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile"),("preferLocalBuild","1")])


i. Using a direct "guix build" gives you a directory in "/gnu/store". And
you can add that bin to your PATH.
ii. But for "/gnu/store/*-profile/", would you just loop over those profile
directories, and run each "/gnu/store/*-profile/etc/profile"?


I'm attaching the full package definition to this email.

Thanks again!
Tim


On Mon, 22 May 2023 at 06:13, Tobias Kortkamp <tobias.kortkamp@gmail.com>
wrote:

>
> Simon Tournier <zimon.toutoune@gmail.com> writes:
>
> > Hi,
> >
> > On Sun, 21 May 2023 at 22:35, Timothy Washington <twashing@gmail.com>
> wrote:
> >
> >> guix build -L ~/dotfiles/ rust-rustscan
> >
> > [...]
> >
> >>  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
> >
> > The issue is that the Rust package named 'ring' cannot be built.
> > Since I am not an expert about Rust packaging, I do not know why and
> > how to fix this.  Well, one needs to put their hand in dirty Rust
> > packaging ;-)
>
> Hello,
>
> usually this error ("failed to execute" + "No such file or directory")
> means that some build dependency is missing. In this case the build
> script (build.rs) fails to run "perl
> crypto/fipsmodule/aes/asm/aesni-x86_64.pl" to generate an assembly file.
>
> Solution: add perl to native-inputs.
>
> Best regards,
>
> Tobias
>

[-- Attachment #1.2: Type: text/html, Size: 7376 bytes --]

[-- Attachment #2: rustscan.scm --]
[-- Type: text/x-scheme, Size: 6472 bytes --]

(define-module (guix packages rustscan)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system cargo)
  #:use-module (guix gexp)
  #:use-module (gnu packages crates-graphics)
  #:use-module (gnu packages crates-io)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages python)

  #:use-module ((guix licenses) #:prefix license:))

(define-public rust-text-placeholder-0.4
  (package
    (name "rust-text-placeholder")
    (version "0.4.1")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "text_placeholder" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0q0iq60dflczvyfp3m4wn3w358yyxmcljmzdb9b5favwnb2c8qcn"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs (("rust-serde" ,rust-serde-1)
                       ("rust-serde-json" ,rust-serde-json-1))))
    (home-page "https://github.com/bernardoamc/text-placeholder")
    (synopsis "A flexible text template engine")
    (description "This package provides a flexible text template engine")
    (license (list license:expat license:asl2.0))))

(define-public rust-rlimit-0.8
  (package
    (name "rust-rlimit")
    (version "0.8.3")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "rlimit" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "18vsz3fdj4s8yjp96wwq7wvrlc3vzzsqki8mfpha9m5zr0g8l9zp"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs (("rust-libc" ,rust-libc-0.2))))
    (home-page "https://github.com/Nugine/rlimit/")
    (synopsis "Resource limits")
    (description "Resource limits")
    (license license:expat)))

(define-public rust-gcd-2
  (package
    (name "rust-gcd")
    (version "2.3.0")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "gcd" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "06l4fib4dh4m6gazdrzzzinhvcpcfh05r4i4gzscl03vnjhqnx8x"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t))
    (home-page "https://github.com/frewsxcv/rust-gcd")
    (synopsis "Calculate the greatest common divisor")
    (description "Calculate the greatest common divisor")
    (license (list license:expat license:asl2.0))))

(define-public rust-colorful-0.2
  (package
    (name "rust-colorful")
    (version "0.2.2")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "colorful" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "1kj7vb4glvwcp75ambq2npf3dv1vjq4zkz12j8ypyzasaii0bbwp"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t))
    (home-page "https://github.com/mellite/colorful")
    (synopsis "Make your terminal output colorful")
    (description "Make your terminal output colorful")
    (license license:expat)))

(define-public rust-cidr-utils-0.5
  (package
    (name "rust-cidr-utils")
    (version "0.5.10")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "cidr-utils" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0750jbxvdbyyxcqnzsw438158r9drs2g077ymx9r9lv193q3dypx"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs (("rust-debug-helper" ,rust-debug-helper-0.3)
                       ("rust-num-bigint" ,rust-num-bigint-0.4)
                       ("rust-num-traits" ,rust-num-traits-0.2)
                       ("rust-once-cell" ,rust-once-cell-1)
                       ("rust-regex" ,rust-regex-1)
                       ("rust-serde" ,rust-serde-1))))
    (home-page "https://magiclen.org/cidr-utils")
    (synopsis
     "This crate provides data structures and functions to deal with IPv4 CIDRs and IPv6 CIDRs.")
    (description
     "This crate provides data structures and functions to deal with IPv4 CIDRs and
IPv6 CIDRs.")
    (license license:expat)))

(define-public rust-rustscan-2
  (package
    (name "rust-rustscan")
    (version "2.1.1")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "rustscan" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "1xdxzp4dfa8dcc6srz5apbfxkcm1a1w5d4k7wym4x0ql5kibfb4b"))))
    (build-system cargo-build-system)
    (arguments
     `(#:tests? #f
       #:cargo-inputs (("rust-ansi-term" ,rust-ansi-term-0.12)
                       ("rust-anyhow" ,rust-anyhow-1)
                       ("rust-async-std" ,rust-async-std-1)
                       ("rust-cidr-utils" ,rust-cidr-utils-0.5)
                       ("rust-colored" ,rust-colored-2)
                       ("rust-colorful" ,rust-colorful-0.2)
                       ("rust-dirs" ,rust-dirs-3)
                       ("rust-env-logger" ,rust-env-logger-0.8)
                       ("rust-futures" ,rust-futures-0.3)
                       ("rust-gcd" ,rust-gcd-2)
                       ("rust-itertools" ,rust-itertools-0.9)
                       ("rust-log" ,rust-log-0.4)
                       ("rust-rand" ,rust-rand-0.7)
                       ("rust-rlimit" ,rust-rlimit-0.8)
                       ("rust-serde" ,rust-serde-1)
                       ("rust-serde-derive" ,rust-serde-derive-1)
                       ("rust-shell-words" ,rust-shell-words-1)
                       ("rust-structopt" ,rust-structopt-0.3)
                       ("rust-subprocess" ,rust-subprocess-0.2)
                       ("rust-text-placeholder" ,rust-text-placeholder-0.4)
                       ("rust-toml" ,rust-toml-0.5)
                       ("rust-trust-dns-resolver" ,rust-trust-dns-resolver-0.19))
       #:cargo-development-inputs (("rust-wait-timeout" ,rust-wait-timeout-0.2))))
    (native-inputs (list perl python))
    (home-page "https://github.com/rustscan/rustscan")
    (synopsis "Faster Nmap Scanning with Rust")
    (description "Faster Nmap Scanning with Rust")
    (license license:expat)))


[-- Attachment #3: manifest.scm --]
[-- Type: text/x-scheme, Size: 299 bytes --]

;; (define-module (guix packages manifest))

;; (use-modules (gnu packages))

;; (specifications->manifest '("gcc-toolchain" "make" "git" "emacs" "vim" "tree" "ungoogled-chromium"))
(specifications->manifest '("gcc-toolchain" "make" "git" "emacs" "vim" "tree" "ungoogled-chromium" "rust-rustscan"))

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
  2023-05-22 20:20           ` Timothy Washington
@ 2023-05-23 16:39             ` Kaelyn
  2023-05-24 20:25               ` Timothy Washington
  2023-05-23 16:54             ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
  1 sibling, 1 reply; 15+ messages in thread
From: Kaelyn @ 2023-05-23 16:39 UTC (permalink / raw)
  To: Timothy Washington; +Cc: Simon Tournier, Guix Devel

Hi Tim,

------- Original Message -------
On Monday, May 22nd, 2023 at 8:20 PM, Timothy Washington <twashing@gmail.com> wrote:


> Yes that was it! I added "(native-inputs (list perl python))" to my package definition.
> $ guix build -L ~/dotfiles/ rust-rustscan # A. Now builds again!
> /gnu/store/4bldy27x1f2mzjqg5jd176nrawl98y1y-rust-rustscan-2.1.1
> 
> $ 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
> 
> ...
> 
> guix package --list-profiles # C. does NOT show the custom profile just built
> /home/twashing/.config/guix/current
> /home/twashing/.guix-profile

This is expected. When you ran the "guix package -L ~/dotfiles/ -m ~/dotfiles/guix/packages/manifest.scm" command above, that not only built the manifest 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 active generation marked (it's typically the last / latest generation, and should be in this case). Running "guix package -I" will list the packages in the current generation of your default guix profile, which should contain the 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/twashing/guix-profile, which in turn is a symlink to one of the numbered symlinks in that same /var/guix directory (i.e. if your current generation number is 14, then /var/guix/profiles/per-user/twashing/guix-profile will point to /var/guix/profiles/per-user/twashing/guix-profile-14-link). Each of those 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.

> 
> 
> cat /gnu/store/xll763hpl7mvdkxd3kf8f98pygarzh41-profile.drv # D. DOES show the new profile in /gnu/store
> Derive([("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile","","")], ... ("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile"),("preferLocalBuild","1")])
> 
> 
> 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 existing generation of the system profile or other profiles (the profile generation symlinks like the guix-profile-14-link mentioned above are the garbage 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 profile directories, and run each "/gnu/store/*-profile/etc/profile"?

This is a very bad idea, as many or most of those "/gnu/store/*-profile" directories are different generations of the same profile, and sourcing them all would result in many conflicts and other troubles, including having unpredictable and likely outdated versions of commands being picked up before newer counterparts.

Cheers,
Kaelyn

> 
> 
> I'm attaching the full package definition to this email.
> 
> Thanks a lot!Tim
> 
> On Mon, 22 May 2023 at 14:18, Kaelyn <kaelyn.alexi@protonmail.com> wrote:
> 
> > 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"). 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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
  2023-05-22 20:20           ` Timothy Washington
  2023-05-23 16:39             ` Kaelyn
@ 2023-05-23 16:54             ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
  2023-05-24 20:10               ` Timothy Washington
  1 sibling, 1 reply; 15+ messages in thread
From: Felix Lechner via Development of GNU Guix and the GNU System distribution. @ 2023-05-23 16:54 UTC (permalink / raw)
  To: Timothy Washington; +Cc: Kaelyn, Simon Tournier, Guix Devel, Tobias Kortkamp

Hi Timothy,

On Tue, May 23, 2023 at 12:31 AM Timothy Washington <twashing@gmail.com> wrote:
>
> Yes that was it! I added "(native-inputs (list perl python))" to my package definition.
>
> $ guix build -L ~/dotfiles/ rust-rustscan   # A. Now builds again!

Hats off to Tobias Kortkamp for pinpointing the issue so confidently
and so quickly! We have a lot of amazing packaging talent on this
list.

> i. Using a direct "guix build" gives you a directory in "/gnu/store". And you can add that bin to your PATH.

You may wish to have a look at 'guix shell'. It does something very
similar via an intermediate collection of symlinks that look like an
aggregate file tree, which we call a profile.

> I'm attaching the full package definition to this email.

Should 'rustscan' perhaps become part of Guix? I'd be happy to assist
with preparing such a patch while preserving your authorship.

Kind regards
Felix


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
  2023-05-23 16:54             ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
@ 2023-05-24 20:10               ` Timothy Washington
  0 siblings, 0 replies; 15+ messages in thread
From: Timothy Washington @ 2023-05-24 20:10 UTC (permalink / raw)
  To: Felix Lechner; +Cc: Kaelyn, Simon Tournier, Guix Devel, Tobias Kortkamp

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

"*Hats off to Tobias Kortkamp for pinpointing the issue so confidently and
so quickly*"
Yes, that was impressive :)

"*Should 'rustscan' perhaps become part of Guix?*"
In fact I have that in mind, yes! Initially however, I did use this
pattern (see
"*Howto supply cargo-build-system dependency to guix package definition*
<https://lists.gnu.org/archive/html/help-guix/2023-05/msg00009.html>"). And
seemingly got a different package definition.

guix import crate -r rustscan
guix build -L ~/dotfiles/ rust-rustscan-2

RustScan/RustScan <https://github.com/RustScan/RustScan> versions haven't
changed since I first tried to do this.
So I'm happy to work with you to add rustscan to Guix.
As a part of that exercise,

   - is there a way to make that process repeatable?
   - Can we ensure the current package definition works on all systems?


Thanks
Tim

On Tue, 23 May 2023 at 12:54, Felix Lechner <felix.lechner@lease-up.com>
wrote:

> Hi Timothy,
>
> On Tue, May 23, 2023 at 12:31 AM Timothy Washington <twashing@gmail.com>
> wrote:
> >
> > Yes that was it! I added "(native-inputs (list perl python))" to my
> package definition.
> >
> > $ guix build -L ~/dotfiles/ rust-rustscan   # A. Now builds again!
>
> Hats off to Tobias Kortkamp for pinpointing the issue so confidently
> and so quickly! We have a lot of amazing packaging talent on this
> list.
>
> > i. Using a direct "guix build" gives you a directory in "/gnu/store".
> And you can add that bin to your PATH.
>
> You may wish to have a look at 'guix shell'. It does something very
> similar via an intermediate collection of symlinks that look like an
> aggregate file tree, which we call a profile.
>
> > I'm attaching the full package definition to this email.
>
> Should 'rustscan' perhaps become part of Guix? I'd be happy to assist
> with preparing such a patch while preserving your authorship.
>
> Kind regards
> Felix
>

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
  2023-05-23 16:39             ` Kaelyn
@ 2023-05-24 20:25               ` Timothy Washington
  2023-05-24 22:16                 ` Kaelyn
  0 siblings, 1 reply; 15+ messages in thread
From: Timothy Washington @ 2023-05-24 20:25 UTC (permalink / raw)
  To: Kaelyn; +Cc: Simon Tournier, Guix Devel

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

*.* This is expected. When you ran the "guix package -L ~/dotfiles/ -m
~/dotfiles/guix/packages/manifest.scm" command above, that not only built
the manifest but also
used the manifest to create a new generation of
/home/twashing/.guix-profile.

Ah I see.

*.* If you run "guix package --list-generations" you should see a list of
all of the existing (numbered) generations with the currently active
generation marked
(it's typically the last / latest generation, and should be in this case).
. Running "guix package -I" will list the packages in the current
generation of your default guix profile,
which should contain the 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/twashing/guix-profile,
which in turn is a symlink to one of the numbered symlinks in that same
/var/guix directory (i.e. if your current generation number is 14, then
/var/guix/profiles/per-user/twashing/guix-profile will point to
/var/guix/profiles/per-user/twashing/guix-profile-14-link).

*.* Each of those 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.

This is really useful for my understanding. Thank-you!

But when I restart my machine, the currently installed tools (from "guix
package -i foo") are not available on login.
For example, I manually ran "guix package -i tree git". And after
restarting my machine, those were no longer available, even though
presumably they should have been part of my latest generation.
I do remember trying to load the tools like below. But git and tree were
still not available.
". /home/twashing/.guix-profile/etc/profile"

Are tools in generations cumulative?
And how can I load the cumulative sum of all my generations, and any custom
profiles I create?

Thanks again
Tim


On Tue, 23 May 2023 at 12:39, Kaelyn <kaelyn.alexi@protonmail.com> wrote:

> Hi Tim,
>
> ------- Original Message -------
> On Monday, May 22nd, 2023 at 8:20 PM, Timothy Washington <
> twashing@gmail.com> wrote:
>
>
> > Yes that was it! I added "(native-inputs (list perl python))" to my
> package definition.
> > $ guix build -L ~/dotfiles/ rust-rustscan # A. Now builds again!
> > /gnu/store/4bldy27x1f2mzjqg5jd176nrawl98y1y-rust-rustscan-2.1.1
> >
> > $ 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
> >
> > ...
> >
> > guix package --list-profiles # C. does NOT show the custom profile just
> built
> > /home/twashing/.config/guix/current
> > /home/twashing/.guix-profile
>
> This is expected. When you ran the "guix package -L ~/dotfiles/ -m
> ~/dotfiles/guix/packages/manifest.scm" command above, that not only built
> the manifest 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 active generation marked (it's typically the last / latest
> generation, and should be in this case). Running "guix package -I" will
> list the packages in the current generation of your default guix profile,
> which should contain the 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/twashing/guix-profile, which in turn is a
> symlink to one of the numbered symlinks in that same /var/guix directory
> (i.e. if your current generation number is 14, then
> /var/guix/profiles/per-user/twashing/guix-profile will point to
> /var/guix/profiles/per-user/twashing/guix-profile-14-link). Each of those
> 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.
>
> >
> >
> > cat /gnu/store/xll763hpl7mvdkxd3kf8f98pygarzh41-profile.drv # D. DOES
> show the new profile in /gnu/store
> >
> Derive([("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile","","")],
> ...
> ("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile"),("preferLocalBuild","1")])
> >
> >
> > 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 existing generation of the system profile or other profiles (the
> profile generation symlinks like the guix-profile-14-link mentioned above
> are the garbage 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
> profile directories, and run each "/gnu/store/*-profile/etc/profile"?
>
> This is a very bad idea, as many or most of those "/gnu/store/*-profile"
> directories are different generations of the same profile, and sourcing
> them all would result in many conflicts and other troubles, including
> having unpredictable and likely outdated versions of commands being picked
> up before newer counterparts.
>
> Cheers,
> Kaelyn
>

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
  2023-05-24 20:25               ` Timothy Washington
@ 2023-05-24 22:16                 ` Kaelyn
  2023-05-26 23:27                   ` Timothy Washington
  0 siblings, 1 reply; 15+ messages in thread
From: Kaelyn @ 2023-05-24 22:16 UTC (permalink / raw)
  To: Timothy Washington; +Cc: Simon Tournier, Guix Devel


------- Original Message -------
On Wednesday, May 24th, 2023 at 8:25 PM, Timothy Washington <twashing@gmail.com> wrote:


> . This is expected. When you ran the "guix package -L ~/dotfiles/ -m ~/dotfiles/guix/packages/manifest.scm" command above, that not only built the manifest but also
> used the manifest to create a new generation of /home/twashing/.guix-profile.
> 
> Ah I see.
> 
> . If you run "guix package --list-generations" you should see a list of all of the existing (numbered) generations with the currently active generation marked
> (it's typically the last / latest generation, and should be in this case).
> . Running "guix package -I" will list the packages in the current generation of your default guix profile,
> which should contain the 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/twashing/guix-profile,
> which in turn is a symlink to one of the numbered symlinks in that same /var/guix directory (i.e. if your current generation number is 14, then /var/guix/profiles/per-user/twashing/guix-profile will point to /var/guix/profiles/per-user/twashing/guix-profile-14-link).
> 
> . Each of those 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.
> 
> This is really useful for my understanding. Thank-you!
> 
> But when I restart my machine, the currently installed tools (from "guix package -i foo") are not available on login.
> For example, I manually ran "guix package -i tree git". And after restarting my machine, those were no longer available, even though presumably they should have been part of my latest generation.
> I do remember trying to load the tools like below. But git and tree were still not available.
> ". /home/twashing/.guix-profile/etc/profile"
> 
> Are tools in generations cumulative?

They are when installed or removed via "guix package -i" and "guix package -r". Updating your profile using a manifest is not cumulative--the new generation of your profile will have exactly the set of packages in the manifest. You can then use "guix package -i" and "guix package -r" to modify the installed set, but the set will be reset if/when "guix package -m my-manifest.scm" is run.

> And how can I load the cumulative sum of all my generations, and any custom profiles I create?

The most reproducible way to maintain the set of packages in your default profile is to include them in your manifest (e.g. adding git and tree to the list of packages included in the manifest, then running "guix package -m your-manifest.scm" again). The generations of a profile are like git commits or filesystem snapshots in that they represent the profile at different points in time, and they aren't really meant to be composed together. If you'd like to maintain separate profiles for different sets of packages or groups of functionality instead of installing all the things you need in your default profile, I might recommend taking a look at the Guix Cookbook, in particular https://guix.gnu.org/cookbook/en/html_node/Guix-Profiles-in-Practice.html.

On a different tack, if you have no issue with installing all of the packages you need in a single profile using a manifest, and you'd like a way of managing at least some of your home configuration (shell aliases, simple config files, etc), there is also "guix home" for a declarative way of specify those pieces: https://guix.gnu.org/en/manual/devel/en/html_node/Home-Configuration.html. In a manner of speaking, it is to your home directory what "guix system" is to the OS when booting Guix.

Cheers,
Kaelyn

> 
> Thanks againTim
> 
> On Tue, 23 May 2023 at 12:39, Kaelyn <kaelyn.alexi@protonmail.com> wrote:
> 
> > Hi Tim,
> > 
> > ------- Original Message -------
> > On Monday, May 22nd, 2023 at 8:20 PM, Timothy Washington <twashing@gmail.com> wrote:
> > 
> > 
> > > Yes that was it! I added "(native-inputs (list perl python))" to my package definition.
> > > $ guix build -L ~/dotfiles/ rust-rustscan # A. Now builds again!
> > > /gnu/store/4bldy27x1f2mzjqg5jd176nrawl98y1y-rust-rustscan-2.1.1
> > >
> > > $ 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
> > >
> > > ...
> > >
> > > guix package --list-profiles # C. does NOT show the custom profile just built
> > > /home/twashing/.config/guix/current
> > > /home/twashing/.guix-profile
> > 
> > This is expected. When you ran the "guix package -L ~/dotfiles/ -m ~/dotfiles/guix/packages/manifest.scm" command above, that not only built the manifest 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 active generation marked (it's typically the last / latest generation, and should be in this case). Running "guix package -I" will list the packages in the current generation of your default guix profile, which should contain the 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/twashing/guix-profile, which in turn is a symlink to one of the numbered symlinks in that same /var/guix directory (i.e. if your current generation number is 14, then /var/guix/profiles/per-user/twashing/guix-profile will point to /var/guix/profiles/per-user/twashing/guix-profile-14-link). Each of those 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.
> > 
> > >
> > >
> > > cat /gnu/store/xll763hpl7mvdkxd3kf8f98pygarzh41-profile.drv # D. DOES show the new profile in /gnu/store
> > > Derive([("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile","","")], ... ("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile"),("preferLocalBuild","1")])
> > >
> > >
> > > 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 existing generation of the system profile or other profiles (the profile generation symlinks like the guix-profile-14-link mentioned above are the garbage 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 profile directories, and run each "/gnu/store/*-profile/etc/profile"?
> > 
> > This is a very bad idea, as many or most of those "/gnu/store/*-profile" directories are different generations of the same profile, and sourcing them all would result in many conflicts and other troubles, including having unpredictable and likely outdated versions of commands being picked up before newer counterparts.
> > 
> > Cheers,
> > Kaelyn


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Howto reference a custom package from a manifest
  2023-05-24 22:16                 ` Kaelyn
@ 2023-05-26 23:27                   ` Timothy Washington
  0 siblings, 0 replies; 15+ messages in thread
From: Timothy Washington @ 2023-05-26 23:27 UTC (permalink / raw)
  To: Kaelyn; +Cc: Simon Tournier, Guix Devel

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

Thanks very much Kaelyn.

This clarifies things a lot 👏

Tim


On Wed, 24 May 2023 at 18:17, Kaelyn <kaelyn.alexi@protonmail.com> wrote:

>
> ------- Original Message -------
> On Wednesday, May 24th, 2023 at 8:25 PM, Timothy Washington <
> twashing@gmail.com> wrote:
>
>
> > . This is expected. When you ran the "guix package -L ~/dotfiles/ -m
> ~/dotfiles/guix/packages/manifest.scm" command above, that not only built
> the manifest but also
> > used the manifest to create a new generation of
> /home/twashing/.guix-profile.
> >
> > Ah I see.
> >
> > . If you run "guix package --list-generations" you should see a list of
> all of the existing (numbered) generations with the currently active
> generation marked
> > (it's typically the last / latest generation, and should be in this
> case).
> > . Running "guix package -I" will list the packages in the current
> generation of your default guix profile,
> > which should contain the 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/twashing/guix-profile,
> > which in turn is a symlink to one of the numbered symlinks in that same
> /var/guix directory (i.e. if your current generation number is 14, then
> /var/guix/profiles/per-user/twashing/guix-profile will point to
> /var/guix/profiles/per-user/twashing/guix-profile-14-link).
> >
> > . Each of those 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.
> >
> > This is really useful for my understanding. Thank-you!
> >
> > But when I restart my machine, the currently installed tools (from "guix
> package -i foo") are not available on login.
> > For example, I manually ran "guix package -i tree git". And after
> restarting my machine, those were no longer available, even though
> presumably they should have been part of my latest generation.
> > I do remember trying to load the tools like below. But git and tree were
> still not available.
> > ". /home/twashing/.guix-profile/etc/profile"
> >
> > Are tools in generations cumulative?
>
> They are when installed or removed via "guix package -i" and "guix package
> -r". Updating your profile using a manifest is not cumulative--the new
> generation of your profile will have exactly the set of packages in the
> manifest. You can then use "guix package -i" and "guix package -r" to
> modify the installed set, but the set will be reset if/when "guix package
> -m my-manifest.scm" is run.
>
> > And how can I load the cumulative sum of all my generations, and any
> custom profiles I create?
>
> The most reproducible way to maintain the set of packages in your default
> profile is to include them in your manifest (e.g. adding git and tree to
> the list of packages included in the manifest, then running "guix package
> -m your-manifest.scm" again). The generations of a profile are like git
> commits or filesystem snapshots in that they represent the profile at
> different points in time, and they aren't really meant to be composed
> together. If you'd like to maintain separate profiles for different sets of
> packages or groups of functionality instead of installing all the things
> you need in your default profile, I might recommend taking a look at the
> Guix Cookbook, in particular
> https://guix.gnu.org/cookbook/en/html_node/Guix-Profiles-in-Practice.html.
>
> On a different tack, if you have no issue with installing all of the
> packages you need in a single profile using a manifest, and you'd like a
> way of managing at least some of your home configuration (shell aliases,
> simple config files, etc), there is also "guix home" for a declarative way
> of specify those pieces:
> https://guix.gnu.org/en/manual/devel/en/html_node/Home-Configuration.html.
> In a manner of speaking, it is to your home directory what "guix system" is
> to the OS when booting Guix.
>
> Cheers,
> Kaelyn
>

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-05-29 16:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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         ` Howto reference a custom package from a manifest Kaelyn
2023-05-22 20:20           ` 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

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.