dpc / rdedup

Data deduplication engine, supporting optional compression and public key encryption.
834 stars 43 forks source link

Error building on POP_OS 21.10 #205

Closed benprew closed 2 years ago

benprew commented 2 years ago

Thanks for writing rdedup, it looks really cool!

I don't have much experience with rust, but I'm having trouble building rdedup and I was hoping you could help. Let me know if you need more info or would like me to run any other commands.

Here's the build commands:

lsb_release -a
rustc --version
cargo --version
cargo install rdedup

And the build log:

No LSB modules are available.
Distributor ID: Pop
Description:    Pop!_OS 21.10
Release:    21.10
Codename:   impish

rustc 1.58.1 (db9d1b20b 2022-01-20)

cargo 1.58.0 (f01b232bc 2022-01-19)

    Updating crates.io index
  Installing rdedup v3.2.1
   Compiling libc v0.2.118
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.36
   Compiling pkg-config v0.3.24
   Compiling unicode-xid v0.2.2
   Compiling lazy_static v1.4.0
   Compiling syn v1.0.86
   Compiling typenum v1.15.0
   Compiling serde_derive v1.0.136
   Compiling version_check v0.9.4
   Compiling maybe-uninit v2.0.0
   Compiling serde v1.0.136
   Compiling cfg-if v0.1.10
   Compiling same-file v1.0.6
   Compiling slog v2.7.0
   Compiling getrandom v0.1.16
   Compiling tinyvec_macros v0.1.0
   Compiling zstd-safe v4.1.3+zstd.1.5.1
   Compiling memchr v2.4.1
   Compiling scopeguard v1.1.0
   Compiling crc32fast v1.3.2
   Compiling hashbrown v0.11.2
   Compiling crossbeam-utils v0.8.7
   Compiling unicode-bidi v0.3.7
   Compiling opaque-debug v0.3.0
   Compiling ryu v1.0.9
   Compiling signature v1.5.0
   Compiling adler v1.0.2
   Compiling once_cell v1.9.0
   Compiling serde_json v1.0.79
   Compiling ppv-lite86 v0.2.16
   Compiling stable_deref_trait v1.2.0
   Compiling matches v0.1.9
   Compiling subtle v2.4.1
   Compiling linked-hash-map v0.5.4
   Compiling log v0.4.14
   Compiling percent-encoding v1.0.1
   Compiling slog-async v2.7.0
   Compiling itoa v1.0.1
   Compiling cpufeatures v0.2.1
   Compiling hex v0.4.3
   Compiling take_mut v0.2.2
   Compiling strsim v0.10.0
   Compiling textwrap v0.14.2
   Compiling bytevec v0.2.0
   Compiling base64 v0.12.3
   Compiling dangerous_option v0.2.0
   Compiling bitflags v1.3.2
   Compiling termcolor v1.1.2
   Compiling rdedup-cdc v0.1.0
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.6
   Compiling num-traits v0.2.14
   Compiling indexmap v1.8.0
   Compiling crossbeam-epoch v0.8.2
   Compiling num-integer v0.1.44
   Compiling miniz_oxide v0.4.4
   Compiling walkdir v2.3.2
   Compiling generic-array v0.14.5
   Compiling tinyvec v1.5.1
   Compiling rust-lzma v0.5.1
   Compiling ed25519 v1.3.0
   Compiling thread_local v1.1.4
   Compiling owning_ref v0.4.1
   Compiling yaml-rust v0.4.5
   Compiling sgdata v0.2.0
   Compiling quote v1.0.15
   Compiling unicode-normalization v0.1.19
   Compiling jobserver v0.1.24
   Compiling dirs-sys-next v0.1.2
   Compiling time v0.1.43
   Compiling atty v0.2.14
   Compiling fs2 v0.4.3
   Compiling num_cpus v1.13.1
   Compiling rpassword v4.0.5
   Compiling crossbeam-channel v0.5.2
   Compiling os_str_bytes v6.0.0
   Compiling slog-perf v0.2.0
   Compiling cc v1.0.72
   Compiling rand_core v0.5.1
   Compiling dirs-next v2.0.0
   Compiling idna v0.1.5
   Compiling crossbeam-queue v0.2.3
   Compiling crossbeam-channel v0.4.4
   Compiling clap v3.0.14
   Compiling flate2 v1.0.22
   Compiling rand_chacha v0.2.2
   Compiling digest v0.9.0
   Compiling crypto-mac v0.8.0
   Compiling block-buffer v0.9.0
   Compiling term v0.7.0
   Compiling crossbeam-deque v0.7.4
   Compiling url v1.7.2
   Compiling rand v0.7.3
   Compiling blake2 v0.9.2
   Compiling sha2 v0.9.9
   Compiling zstd-sys v1.6.2+zstd.1.5.1
   Compiling libsodium-sys v0.2.7
   Compiling bzip2-sys v0.1.11+1.0.8
   Compiling crossbeam v0.7.3
   Compiling bzip2 v0.4.3
   Compiling chrono v0.4.19
   Compiling serde_yaml v0.8.23
   Compiling slog-term v2.8.1
   Compiling zstd v0.9.2+zstd.1.5.1
   Compiling sodiumoxide v0.2.7
   Compiling rdedup-lib v3.2.0
   Compiling rdedup v3.2.1
error[E0432]: unresolved import `clap::Clap`
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:125:5
    |
125 | use clap::Clap;
    |     ^^^^^^^^^^ no `Clap` in the root

error: cannot determine resolution for the derive macro `Clap`
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:316:17
    |
316 | #[derive(Debug, Clap)]
    |                 ^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:317:3
    |
317 | #[clap(author, about = "Data deduplication toolkit")]
    |   ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:319:7
    |
319 |     #[clap(name = "dir", short = 'd', long, value_name = "PATH")]
    |       ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:323:7
    |
323 |     #[clap(
    |       ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:332:7
    |
332 |     #[clap(short = 'v', parse(from_occurrences))]
    |       ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:336:7
    |
336 |     #[clap(short = 't', parse(from_occurrences))]
    |       ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:340:7
    |
340 |     #[clap(subcommand)]
    |       ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot determine resolution for the derive macro `Clap`
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:344:17
    |
344 | #[derive(Debug, Clap)]
    |                 ^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:345:3
    |
345 | #[clap(setting = clap::AppSettings::DeriveDisplayOrder)]
    |   ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:347:7
    |
347 |     #[clap(setting = clap::AppSettings::DeriveDisplayOrder)]
    |       ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:350:11
    |
350 |         #[clap(
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:359:11
    |
359 |         #[clap(
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:368:11
    |
368 |         #[clap(
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:377:11
    |
377 |         #[clap(long, default_value = "0", value_name = "N")]
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:381:11
    |
381 |         #[clap(
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:390:11
    |
390 |         #[clap(
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:399:11
    |
399 |         #[clap(long, validator = validate_nesting, default_value = "2", value_name = "N")]
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:403:11
    |
403 |         #[clap(
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:415:11
    |
415 |         #[clap(name = "NAME")]
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:422:11
    |
422 |         #[clap(name = "NAME")]
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:427:7
    |
427 |     #[clap(visible_alias = "ls")]
    |       ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:431:7
    |
431 |     #[clap(visible_alias = "rm")]
    |       ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:434:11
    |
434 |         #[clap(name = "NAME", required = true)]
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:439:7
    |
439 |     #[clap(name = "change_passphrase", visible_alias = "chpasswd")]
    |       ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:445:11
    |
445 |         #[clap(name = "NAME", required = true)]
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:452:11
    |
452 |         #[clap(
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:463:11
    |
463 |         #[clap(name = "NAME", required = true)]
    |           ^^^^
    |
    = note: `clap` is in scope, but it is a crate, not an attribute

error[E0599]: no function or associated item named `parse` found for struct `CliOpts` in the current scope
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:470:29
    |
318 | struct CliOpts {
    | -------------- function or associated item `parse` not found for this
...
470 |     let cli_opts = CliOpts::parse();
    |                             ^^^^^ function or associated item not found in `CliOpts`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `parse`, perhaps you need to implement it:
            candidate #1: `Parser`

error[E0277]: the size for values of type `str` cannot be known at compilation time
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:473:13
    |
473 |         let s = loc.into_string().map_err(|_| {
    |             ^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
    = note: all local variables must have a statically known size
    = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `str` cannot be known at compilation time
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:473:17
    |
473 |           let s = loc.into_string().map_err(|_| {
    |  _________________^
474 | |             io::Error::new(
475 | |                 io::ErrorKind::InvalidData,
476 | |                 "URI not valid UTF-8 string".to_string(),
477 | |             )
478 | |         })?;
    | |___________^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
    = note: all local variables must have a statically known size
    = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `str` cannot be known at compilation time
   --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/rdedup-3.2.1/src/bin.rs:478:11
    |
478 |         })?;
    |           ^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
note: required by a bound in `Break`
   --> /home/ben/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/control_flow.rs:83:25
    |
83  | pub enum ControlFlow<B, C = ()> {
    |                         ^ required by this bound in `Break`

Some errors have detailed explanations: E0277, E0432, E0599.
For more information about an error, try `rustc --explain E0277`.
error: failed to compile `rdedup v3.2.1`, intermediate artifacts can be found at `/tmp/cargo-installpsGJsm`

Caused by:
  could not compile `rdedup` due to 32 previous errors
dpc commented 2 years ago

Some old rust compiler? rustc --version?

pfernie commented 2 years ago

This seems to do with installing it via cargo install; it is resolving the clap dependency to 3.1.0:

   Compiling clap v3.1.0

despite the Cargo.toml specifying a hard version:

# Default features disabled so they can be explicitly opted into
rdedup-lib = { version = "3.2.0", path = "lib", default-features = false }
clap = "=3.0.0-beta.2"
log = "0.4.11"
hex = "0.4.2"

Looks like by default cargo install will ignore a Cargo.lock:

By default, the Cargo.lock file that is included with the package will be ignored. This means that Cargo will recompute which versions of dependencies to use, possibly using newer versions that have been released since the package was published. The --locked flag can be used to force Cargo to use the packaged Cargo.lock file if it is available.

cargo install --locked works for me here (I typically don't install it via cargo install, so this is new to me).

Generally, we could probably update to the non-beta clap, though (I assume all errors are stemming from this).

(Edit: I don't personally have time immediately to do the upgrade; I will open an issue instead)

benprew commented 2 years ago

Thanks for getting back to me so quickly!

I'm using the latest version of rust (1.58.1) according to https://www.rust-lang.org/.

running cargo install --locked rdedup fixed it for me. I made a PR #207 to update the README with the fixed command, let me know if it's not right.

Thanks!