Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo install rustic-rs failed (E0308) #1268

Closed
9-2-1 opened this issue Sep 29, 2024 · 2 comments
Closed

cargo install rustic-rs failed (E0308) #1268

9-2-1 opened this issue Sep 29, 2024 · 2 comments
Labels
C-question Category: Further information is requested

Comments

@9-2-1
Copy link

9-2-1 commented Sep 29, 2024

I have used to build rustic-rs in termux (an android terminal emulator), and failed to build v0.8.1 while v0.8.0 and v0.7.0 were OK.

Compiling rustic-rs v0.8.1
error[E0308]: mismatched types
   --> /data/data/com.termux/files/home/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-2eab394af869c8a2/rustic-rs-0.8.1/src/commands.rs:299:63
    |
299 | ... = Repository::new_with_progress(&repo_opts.repo, &backends, p...
    |       -----------------------------                  ^^^^^^^^^ expected `RepositoryBackends`, found a different `RepositoryBackends`
    |       |
    |       arguments to this function are incorrect
    |
    = note: `RepositoryBackends` and `RepositoryBackends` have similar names, but are actually distinct types
note: `RepositoryBackends` is defined in crate `rustic_core`
   --> /data/data/com.termux/files/home/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-2eab394af869c8a2/rustic_core-0.4.0/src/backend.rs:540:1
    |
540 | pub struct RepositoryBackends {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `RepositoryBackends` is defined in crate `rustic_core`
   --> /data/data/com.termux/files/home/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-2eab394af869c8a2/rustic_core-0.3.1/src/backend.rs:519:1
    |
519 | pub struct RepositoryBackends {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `rustic_core` are being used?
note: associated function defined here
   --> /data/data/com.termux/files/home/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-2eab394af869c8a2/rustic_core-0.3.1/src/repository.rs:334:12
    |
334 |     pub fn new_with_progress(
    |            ^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `rustic-rs` (lib) due to 1 previous error

Likely because rustic-rs depends on rustic_core==0.3.1
while rustic-rs depends on rustic-backend, which depends on the latest rustic-core (==0.4.0 now)
which are different.

@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Sep 29, 2024
@simonsan
Copy link
Contributor

simonsan commented Sep 29, 2024

Did you try installing with cargo install --locked rustic-rs to utilize the generated lockfile?

EDIT: I checked with --locked and pushed a fix to the readme and online docs, so this is more obvious as a workaround in these cases.

@simonsan simonsan added C-question Category: Further information is requested and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Sep 29, 2024
@9-2-1
Copy link
Author

9-2-1 commented Sep 29, 2024

Did you try installing with cargo install --locked rustic-rs to utilize the generated lockfile?

It works, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants