schwa / simple-disk-benchmark-rs

A simple disk benchmark tool.
MIT License
11 stars 0 forks source link

Failure to build on Debian GNU/Linux 12 (bookworm) #1

Closed blackketter closed 6 months ago

blackketter commented 6 months ago

Thought I'd try to install on a Raspberry Pi 5 running Debian GNU/Linux 12 (bookworm) with a new install of rustc (1.76.0). I'm rust illiterate, so not sure how to proceed. Results:

$ cargo install simple-disk-benchmark
    Updating crates.io index
  Installing simple-disk-benchmark v0.1.4
    Updating crates.io index
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling libc v0.2.153
   Compiling rand_core v0.4.2
   Compiling autocfg v0.1.8
   Compiling serde v1.0.197
   Compiling num-traits v0.2.18
   Compiling rand_core v0.3.1
   Compiling num-bigint v0.2.6
   Compiling utf8parse v0.2.1
   Compiling lazy_static v1.4.0
   Compiling anstyle-parse v0.2.3
   Compiling quote v1.0.35
   Compiling syn v2.0.53
   Compiling num-complex v0.2.4
   Compiling num-rational v0.2.4
   Compiling rand_pcg v0.1.2
   Compiling rand_chacha v0.1.1
   Compiling cfg-if v1.0.0
   Compiling colorchoice v1.0.0
   Compiling anstyle-query v1.0.2
   Compiling memchr v2.7.1
   Compiling anstyle v1.0.6
   Compiling rustversion v1.0.14
   Compiling num-integer v0.1.46
   Compiling anstream v0.6.13
   Compiling getrandom v0.2.12
   Compiling rand v0.6.5
   Compiling strsim v0.11.0
   Compiling heck v0.5.0
   Compiling syn v1.0.109
   Compiling clap_lex v0.7.0
   Compiling portable-atomic v1.6.0
   Compiling log v0.4.21
   Compiling clap_builder v4.5.2
   Compiling rand_core v0.6.4
   Compiling num-iter v0.1.44
   Compiling aho-corasick v1.1.3
   Compiling serde_derive v1.0.197
   Compiling clap_derive v4.5.3
   Compiling rand_os v0.1.3
   Compiling is-terminal v0.4.12
   Compiling rand_xorshift v0.1.1
   Compiling rand_isaac v0.1.1
   Compiling rand_hc v0.1.0
   Compiling rand_jitter v0.1.4
   Compiling rust_decimal v1.34.3
   Compiling powerfmt v0.2.0
   Compiling regex-syntax v0.8.2
   Compiling anyhow v1.0.81
   Compiling itoa v1.0.10
   Compiling serde_json v1.0.114
   Compiling ppv-lite86 v0.2.17
   Compiling heck v0.4.1
   Compiling strum_macros v0.26.2
   Compiling deranged v0.3.11
   Compiling rand_chacha v0.3.1
   Compiling regex-automata v0.4.6
   Compiling colored v1.9.4
   Compiling clap v4.5.3
   Compiling num v0.2.1
   Compiling console v0.15.8
   Compiling number_prefix v0.4.0
   Compiling num-conv v0.1.0
   Compiling time-core v0.1.2
   Compiling num_threads v0.1.7
   Compiling minimal-lexical v0.2.1
   Compiling ryu v1.0.17
   Compiling arrayvec v0.7.4
   Compiling nom v7.1.3
   Compiling enum-display-derive v0.1.1
   Compiling time v0.3.34
   Compiling indicatif v0.17.8
   Compiling statistical v1.0.0
   Compiling clap-verbosity-flag v2.2.0
   Compiling regex v1.10.3
   Compiling fern v0.6.2
   Compiling rand v0.8.5
   Compiling strum v0.26.2
   Compiling minijinja v1.0.14
   Compiling os_info v3.8.1
   Compiling colored v2.1.0
   Compiling humantime v2.1.0
   Compiling rasciigraph v0.2.0
   Compiling simple-disk-benchmark v0.1.4
error[E0433]: failed to resolve: use of undeclared crate or module `nix`
  --> /home/dean/.cargo/registry/src/index.crates.io-6f17d22bba15001f/simple-disk-benchmark-0.1.4/src/timer/mod.rs:10:5
   |
10 | use nix::fcntl::{splice, SpliceFFlags};
   |     ^^^ use of undeclared crate or module `nix`

error[E0053]: method `open_for_benchmarking` has an incompatible type for trait
  --> /home/dean/.cargo/registry/src/index.crates.io-6f17d22bba15001f/simple-disk-benchmark-0.1.4/src/disk_benchmark/support.rs:41:36
   |
41 |     fn open_for_benchmarking(path: Path, no_disable_cache: bool) -> Result<File> {
   |                                    ^^^^
   |                                    |
   |                                    expected `&Path`, found `Path`
   |                                    help: change the parameter type to match the trait: `&Path`
   |
note: type in trait
  --> /home/dean/.cargo/registry/src/index.crates.io-6f17d22bba15001f/simple-disk-benchmark-0.1.4/src/disk_benchmark/support.rs:19:36
   |
19 |     fn open_for_benchmarking(path: &Path, no_disable_cache: bool) -> Result<File>;
   |                                    ^^^^^
   = note: expected signature `fn(&Path, _) -> Result<_, _>`
              found signature `fn(Path, _) -> Result<_, _>`

error[E0046]: not all trait items implemented, missing: `create_for_benchmarking`
  --> /home/dean/.cargo/registry/src/index.crates.io-6f17d22bba15001f/simple-disk-benchmark-0.1.4/src/disk_benchmark/support.rs:40:1
   |
18 |     fn create_for_benchmarking(path: &Path, no_disable_cache: bool) -> Result<File>;
   |     -------------------------------------------------------------------------------- `create_for_benchmarking` from trait
...
40 | impl DiskBenchmark for File {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `create_for_benchmarking` in implementation

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
  --> /home/dean/.cargo/registry/src/index.crates.io-6f17d22bba15001f/simple-disk-benchmark-0.1.4/src/disk_benchmark/support.rs:41:30
   |
41 |     fn open_for_benchmarking(path: Path, no_disable_cache: bool) -> Result<File> {
   |                              ^^^^ doesn't have a size known at compile-time
   |
   = help: within `Path`, the trait `Sized` is not implemented for `[u8]`
note: required because it appears within the type `Path`
  --> /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/path.rs:1992:12
help: function arguments must have a statically known size, borrowed types always have a known size
   |
41 |     fn open_for_benchmarking(path: &Path, no_disable_cache: bool) -> Result<File> {
   |                                    +

Some errors have detailed explanations: E0046, E0053, E0277, E0433.
For more information about an error, try `rustc --explain E0046`.
error: could not compile `simple-disk-benchmark` (bin "simple-disk-benchmark") due to 4 previous errors
error: failed to compile `simple-disk-benchmark v0.1.4`, intermediate artifacts can be found at `/tmp/cargo-installL2Ox6z`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
schwa commented 6 months ago

Oh thanks for letting me know. Will try and take a look ASAP.