Skip to content

error when compiling for x86_64-pc-windows-gnu #3

Description

@ntzb

hi and thanks for rperf.
it is mentioned in the readme that rperf should build and work on all major platforms, though its development and usage focus is on Linux-based systems, so that is where it will be most feature-complete.
trying to switch from iperf to rperf, I need some binaries for Windows and Linux aarch64.

compiling for Windows fails with:

❯ cargo build --release --target x86_64-pc-windows-gnu
  Downloaded winapi-build v0.1.1
  Downloaded miow v0.2.2
  Downloaded kernel32-sys v0.2.2
  Downloaded ws2_32-sys v0.2.1
  Downloaded winapi-util v0.1.5
  Downloaded windows-targets v0.48.5
  Downloaded winapi v0.2.8
  Downloaded winapi v0.3.9
  Downloaded windows-sys v0.48.0
  Downloaded winapi-x86_64-pc-windows-gnu v0.4.0
  Downloaded windows_x86_64_gnu v0.48.5
  Downloaded windows v0.48.0
  Downloaded 12 crates (20.0 MB) in 2.60s (largest was `windows` at 11.9 MB)
   Compiling winapi-x86_64-pc-windows-gnu v0.4.0
   Compiling winapi v0.3.9
   Compiling winapi-build v0.1.1
   Compiling windows_x86_64_gnu v0.48.5
   Compiling winapi v0.2.8
   Compiling libc v0.2.147
   Compiling memchr v2.6.3
   Compiling bitflags v1.2.1
   Compiling kernel32-sys v0.2.2
   Compiling ws2_32-sys v0.2.1
   Compiling cfg-if v0.1.10
   Compiling cfg-if v1.0.0
   Compiling regex-syntax v0.7.5
   Compiling windows-targets v0.48.5
   Compiling aho-corasick v1.0.5
   Compiling serde v1.0.188
   Compiling num-traits v0.2.16
   Compiling memoffset v0.6.5
   Compiling slab v0.4.9
   Compiling regex-automata v0.3.8
   Compiling unicode-width v0.1.10
   Compiling log v0.4.20
   Compiling serde_json v1.0.105
   Compiling textwrap v0.11.0
   Compiling windows-sys v0.48.0
   Compiling getrandom v0.2.10
   Compiling num_cpus v1.16.0
   Compiling vec_map v0.8.2
   Compiling ryu v1.0.15
   Compiling regex v1.9.5
   Compiling net2 v0.2.39
   Compiling atty v0.2.14
   Compiling winapi-util v0.1.5
   Compiling termcolor v1.2.0
   Compiling time v0.1.45
   Compiling strsim v0.8.0
   Compiling itoa v1.0.9
   Compiling humantime v2.1.0
   Compiling iovec v0.1.4
   Compiling env_logger v0.8.4
   Compiling clap v2.33.4
   Compiling chrono v0.4.28
   Compiling miow v0.2.2
   Compiling mio v0.6.23
   Compiling core_affinity v0.5.10
   Compiling ctrlc v3.4.1
   Compiling uuid v0.8.2
   Compiling nix v0.20.2
   Compiling simple-error v0.2.3
   Compiling rperf v0.1.8 (/Users/nitzan/Downloads/rperf)
error[E0433]: failed to resolve: could not find `sys` in `nix`
  --> src/stream/tcp.rs:23:10
   |
23 | use nix::sys::socket::{setsockopt, sockopt::RcvBuf, sockopt::SndBuf};
   |          ^^^ could not find `sys` in `nix`

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> src/stream/tcp.rs:70:18
   |
70 |     use std::os::unix::io::AsRawFd;
   |                  ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `unix` in `os`
   --> src/stream/tcp.rs:416:18
    |
416 |     use std::os::unix::io::AsRawFd;
    |                  ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `sys` in `nix`
  --> src/stream/udp.rs:26:10
   |
26 | use nix::sys::socket::{setsockopt, sockopt::RcvBuf, sockopt::SndBuf};
   |          ^^^ could not find `sys` in `nix`

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> src/stream/udp.rs:72:18
   |
72 |     use std::os::unix::io::AsRawFd;
   |                  ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `unix` in `os`
   --> src/stream/udp.rs:439:18
    |
439 |     use std::os::unix::io::AsRawFd;
    |                  ^^^^ could not find `unix` in `os`

error[E0599]: no method named `as_raw_fd` found for struct `mio::net::TcpStream` in the current scope
   --> src/stream/tcp.rs:261:90
    |
261 | ...                   super::setsockopt(stream.as_raw_fd(), super::RcvBuf, &self.receive_buffer)?;
    |                                                ^^^^^^^^^ method not found in `TcpStream`

error[E0599]: no method named `as_raw_fd` found for struct `mio::net::TcpStream` in the current scope
   --> src/stream/tcp.rs:492:46
    |
492 |                     super::setsockopt(stream.as_raw_fd(), super::SndBuf, &self.send_buffer)?;
    |                                              ^^^^^^^^^ method not found in `TcpStream`

error[E0599]: no method named `as_raw_fd` found for struct `std::net::UdpSocket` in the current scope
   --> src/stream/udp.rs:209:46
    |
209 |                     super::setsockopt(socket.as_raw_fd(), super::RcvBuf, receive_buffer)?;
    |                                              ^^^^^^^^^ method not found in `UdpSocket`

warning: use of deprecated associated function `chrono::NaiveDateTime::from_timestamp`: use `from_timestamp_opt()` instead
   --> src/stream/udp.rs:258:52
    |
258 |             let current_timestamp = NaiveDateTime::from_timestamp(now.as_secs() as i64, now.subsec_nanos());
    |                                                    ^^^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated associated function `chrono::NaiveDateTime::from_timestamp`: use `from_timestamp_opt()` instead
   --> src/stream/udp.rs:302:55
    |
302 |                 let source_timestamp = NaiveDateTime::from_timestamp(origin_seconds, origin_nanoseconds);
    |                                                       ^^^^^^^^^^^^^^

error[E0599]: no method named `as_raw_fd` found for struct `std::net::UdpSocket` in the current scope
   --> src/stream/udp.rs:475:46
    |
475 |                     super::setsockopt(socket.as_raw_fd(), super::SndBuf, send_buffer)?;
    |                                              ^^^^^^^^^ method not found in `UdpSocket`

Some errors have detailed explanations: E0433, E0599.
For more information about an error, try `rustc --explain E0433`.
warning: `rperf` (bin "rperf") generated 2 warnings
error: could not compile `rperf` (bin "rperf") due to 10 previous errors; 2 warnings emitted

it seems that there are some dependencies on *nix tcp/udp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions