Nix-build errors

I cloned from Nest and ran nix-build but got some errors:

Some errors have detailed explanations: E0405, E0412, E0422, E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0405`.
builder for '/nix/store/hmj2lw0jjrpfk4ay2plzda8j9i9dnq5z-rust_libpijul-1.0.0-alpha.19.drv' failed with exit code 1
cannot build derivation '/nix/store/yyp8iqy4fqmsgz7v87ziisj0g7jnssvx-rust_pijul-1.0.0-alpha.23.drv': 1 dependencies couldn't be built
error: build of '/nix/store/yyp8iqy4fqmsgz7v87ziisj0g7jnssvx-rust_pijul-1.0.0-alpha.23.drv' failed

NixOS unstable 21.03pre257780.e9158eca70a (Okapi)
Pijul 5YDI33C4QRHATA6H3HHMBYFOBLAMXLLHWSDGJAH57DR6AMWO7AAQC

I found the E0422 bug trying to compile using cargo, on Fedora linux. Using 1.48 rustc.

Hi @bdarcus,

First, I’m sorry that nest.pijul.com is down, I’ve been working hard to bring it back to life with all the upgrades (massive changes in Libpijul, Tokio 1.0) happening at the same time.

Which error is E0422? Where does the message come from in the code?
Also, are you using the latest version, i.e. 1.0.0-alpha.27 (cargo install pijul --version 1.0.0-alpha.27)?

If in doubt, you can check crates.io/crates/pijul to find out what the latest version is.

I was trying to build the latest alpha listed in the documentation. I wasn’t aware there was a newer one.

cargo install pijul --version 1.0.0-alpha.24 --features git

But 27 doesn’t compile either.

Here’s the output:

The associated type used was not defined in the trait.

Erroneous code example:

trait T1 {
    type Bar;
}

type Foo = T1<F=i32>; // error: associated type `F` not found for `T1`

// or:

trait T2 {
    type Bar;

    // error: Baz is used but not declared
    fn return_bool(&self, _: &Self::Bar, _: &Self::Baz) -> bool;
}

Make sure that you have defined the associated type in the trait body.
Also, verify that you used the right trait or you didn’t misspell the
associated type name. Example:

trait T1 {
    type Bar;
}

type Foo = T1<Bar=i32>; // ok!

// or:

trait T2 {
    type Bar;
    type Baz; // we declare `Baz` in our trait.

    // and now we can use it here:
    fn return_bool(&self, _: &Self::Bar, _: &Self::Baz) -> bool;
}

Well, unfortunately, I can’t do much with error “templates”, would you mind giving an example of an actual error?

How am I supposed to do that? I just copy-and-pasted the output from the terminal.

Edit: actually, I can tell you the problems are specific to the git feature. When I remove that, it compiles.

Alright, sorry for the misunderstanding. I don’t think any trait is name T1 or T2 in the entire codebase, which is why I was a bit surprised.
I believe I fixed the Git feature in 1.0.0-alpha.31, does that work for you?

1 Like

Yes; it compiles now. Thanks.

The build still fails for me on PESRJZBOH6PQSDPJ7SDJX52O65FMPEV4373YYEWZSF7ATXDQL2VAC running nix-build.


Building src/lib.rs (tokio-compat-02)
Running rustc --crate-name tokio_compat_02 src/lib.rs --out-dir target/lib -L dependency=target/deps --cap-lints allow -C opt-level=3 -C codegen-units=24 --remap-path-prefix=/build=/ --extern bytes=/nix/store/cakracfw3yy37ni9jnbf25rzzxh5b0d0-rust_bytes-0.5.6-lib/lib/libbytes-1ecf79f91a.rlib --extern once_cell=/nix/store/2i54cwqa10vdl3g5khap1wviqh4mm93l-rust_once_cell-1.5.2-lib/lib/libonce_cell-916fc7e4e4.rlib --extern pin_project_lite=/nix/store/5a1xfmhfak16mipy4pkf1rsnz5iqiv97-rust_pin-project-lite-0.1.11-lib/lib/libpin_project_lite-b0239377b7.rlib --extern tokio_02=/nix/store/b37fj9fsa3sgjins4j223m4rk0h43l45-rust_tokio-0.2.24-lib/lib/libtokio-00b2277e3e.rlib --extern tokio_02=/nix/store/b37fj9fsa3sgjins4j223m4rk0h43l45-rust_tokio-0.2.24-lib/lib/libtokio-00b2277e3e.rlib --extern tokio_02=/nix/store/hwlq1avnzvkk1n0h0bkabmlhhadbf89r-rust_tokio-0.3.6-lib/lib/libtokio-ffd448e601.rlib --extern tokio_02=/nix/store/hwlq1avnzvkk1n0h0bkabmlhhadbf89r-rust_tokio-0.3.6-lib/lib/libtokio-ffd448e601.rlib --cfg feature="default" --edition 2018 -C metadata=601e7958df -C extra-filename=-601e7958df --crate-type lib --color always
error[E0465]: multiple rlib candidates for `tokio_02` found
  --> src/lib.rs:88:5
   |
88 | use tokio_02::runtime::{Handle, Runtime};
   |     ^^^^^^^^
   |
note: candidate #1: /nix/store/b37fj9fsa3sgjins4j223m4rk0h43l45-rust_tokio-0.2.24-lib/lib/libtokio-00b2277e3e.rlib
  --> src/lib.rs:88:5
   |
88 | use tokio_02::runtime::{Handle, Runtime};
   |     ^^^^^^^^
note: candidate #2: /nix/store/hwlq1avnzvkk1n0h0bkabmlhhadbf89r-rust_tokio-0.3.6-lib/lib/libtokio-ffd448e601.rlib
  --> src/lib.rs:88:5
   |
88 | use tokio_02::runtime::{Handle, Runtime};
   |     ^^^^^^^^

error: aborting due to previous error

builder for '/nix/store/14hfyidlxffwsw6y8ji3l528zby44p1n-rust_tokio-compat-02-0.1.2.drv' failed with exit code 1
cannot build derivation '/nix/store/rdwp6aax1qmq3jy01dkwj0hcns6wxga0-rust_pijul-1.0.0-alpha.29.drv': 1 dependencies couldn't be built
error: build of '/nix/store/rdwp6aax1qmq3jy01dkwj0hcns6wxga0-rust_pijul-1.0.0-alpha.29.drv' failed