mikedilger / gossip

Gossip is a nostr client
Other
692 stars 77 forks source link

Unable to compile on Windows from Git #773

Closed clin1234 closed 3 months ago

clin1234 commented 3 months ago

Running cargo install --git https://github.com/mikedilger/gossip yielded this output:


error[E0412]: cannot find type `Id` in module `task`
   --> gossip-lib\src\overlord\mod.rs:59:37
    |
59  |     minions_task_url: HashMap<task::Id, RelayUrl>,
    |                                     ^^ not found in `task`
    |
note: found an item that was configured out
   --> C:\Users\ךינשגכהד\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.38.0\src\task\mod.rs:365:40
    |
365 |         pub use crate::runtime::task::{Id, id, try_id};
    |                                        ^^
help: consider importing one of these items
    |
3   + use nostr_types::Id;
    |
3   + use tracing::Id;
    |
help: if you import `Id`, refer to it directly
    |
59  -     minions_task_url: HashMap<task::Id, RelayUrl>,
59  +     minions_task_url: HashMap<Id, RelayUrl>,
    |

error[E0412]: cannot find type `Id` in module `task`
   --> gossip-lib\src\overlord\mod.rs:418:47
    |
418 | ...ption<Result<(task::Id, MinionResult), task::JoinError>>,
    |                        ^^ not found in `task`
    |
note: found an item that was configured out
   --> C:\Users\ךינשגכהד\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.38.0\src\task\mod.rs:365:40
    |
365 |         pub use crate::runtime::task::{Id, id, try_id};
    |                                        ^^
help: consider importing one of these items
    |
3   + use nostr_types::Id;
    |
3   + use tracing::Id;
    |
help: if you import `Id`, refer to it directly
    |
418 -         task_nextjoined: Option<Result<(task::Id, MinionResult), task::JoinError>>,
418 +         task_nextjoined: Option<Result<(Id, MinionResult), task::JoinError>>,
    |

For more information about this error, try `rustc --explain E0412`.
warning: `gossip-lib` (lib) generated 1 warning
error: could not compile `gossip-lib` (lib) due to 2 previous errors; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
error: failed to compile `gossip v0.11.0-unstable (https://github.com/mikedilger/gossip#cb464711)`, intermediate artifacts can be found at `C:\Users\0BAC~1\AppData\Local\Temp\cargo-installkzx7Aj`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
mikedilger commented 3 months ago

This command cargo install --git https://github.com/mikedilger/gossip isn't smart enough to build gossip properly. In particular, it fails to read and consider the .cargo/config.toml file which passes a rustflag to the tokio library.

You might try this (I haven't tried it myself):

$ export RUSTFLAGS="--cfg tokio_unstable"
$ cargo install  --git https://github.com/mikedilger/gossip
mikedilger commented 3 months ago

I'll assume you got this working. Reopen if you still need help.