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