Folaht’s first attempt to build a cargo package on Guix system - The one with windows dependencies

I feel like that would be too big a thread.

And I expect to run into more complex issues with each new package.

answer #1

$ guix build -f ant-node.scm
/home/folaht/Nwaȥ/Êsaj/Giks/yrop/yrop/packages/ant-node:29:13: error: license:apache2.0: unbound variable

answer #2

In the guix source code

answer #3

For crates, I can just just guix import crate and guix download --recursive --git. guix import crate not only will it return the hash code I needed, but a full-blown template! That’s amazing. I chose guix download --recursive --git for the hash however, because it’s on github where it’s being developed.

answer #4

It’s for scheme comments, I think.

answer #5

To get a crates list of a project, in this case ant-protocol, start a guix rust environment, download the crate, create a rust-crates file, do some cargo commands and then generate the rust-crates list from the project’s Cargo.lock file.

$ guix shell rust rust:cargo cargo-audit cargo-license
> curl -fsSL https://static.crates.io/crates/ant-node/ant-node-0.14.3.crate | tar -xz
> cd ant-node-1.14.3
> install -D -m 644 /dev/null yrop/packages/ant/node/rust-crates.scm
> cargo generate-lockfile
> cargo audit
> cargo license
> guix import -i yrop/packages/ant/node/rust-crates.scm crate -f Cargo.lock ant-node

Then fit that into a rust-crates template. (Credits to @hako)

answer #8

Since the error referred to a missing build dependency, pkg-config was added in native-inputs. Since library package zstd as part of pkg-config was also needed, module gnu packages compression was added.

(define-module yrop packages ant node)
...
#:use-module (gnu packages compression)
#:use-module (gnu packages pkg-config)...)

...

(define-public ant-node
  (package
    ...
    (native-inputs (list pkg-config (list zstd "lib")))
...))

answer #9

Add test arguments that skip these tests.

(arguments
        (list #:cargo-test-flags
            ''("--"
               "--skip=node::tests::test_build_upgrade_monitor_staged_rollout_disabled"
               "--skip=node::tests::test_build_upgrade_monitor_staged_rollout_enabled"
               "--skip=upgrade::apply::tests::test_auto_apply_upgrader_creation"
 ...)))