Skip to content

boringtun doesn't compile on OpenBSD #218

@Kusoneko

Description

@Kusoneko

Hello all,

On OpenBSD 7.5 (also tried on 7.4 and -current with the same result), attempting to compile either master or crashey, the compilation fails at the exact same library:

   Compiling boringtun v0.3.0 (https://github.com/cjdelisle/boringtun?rev=f288b2f461e7322a278b63b1ddc4ab705b5b7462#f288b2f4)
error[E0432]: unresolved import `crate::device::errno_str`
 --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/drop_privileges.rs:4:5
  |
4 | use crate::device::errno_str;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^ no `errno_str` in `device`

error[E0432]: unresolved imports `super::errno`, `super::errno_str`
 --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/udp_unix.rs:4:13
  |
4 | use super::{errno, errno_str, Error};
  |             ^^^^^  ^^^^^^^^^ no `errno_str` in `device`
  |             |
  |             no `errno` in `device`

error[E0432]: unresolved import `poll`
  --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:48:5
   |
48 | use poll::*;
   |     ^^^^ use of undeclared crate or module `poll`

error[E0432]: unresolved import `tun`
  --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:49:5
   |
49 | use tun::*;
   |     ^^^ use of undeclared crate or module `tun`
   |
help: there is a crate or module with a similar name
   |
49 | use Tun::*;
   |     ~~~

error[E0412]: cannot find type `TunSocket` in this scope
   --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:126:34
    |
126 | pub struct DeviceHandle<T: Tun = TunSocket, S: Sock = UDPSocket> {
    |                                  ^^^^^^^^^ help: a struct with a similar name exists: `UDPSocket`
    |
   ::: /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/udp_unix.rs:13:1
    |
13  | pub struct UDPSocket {
    | -------------------- similarly named struct `UDPSocket` defined here

error[E0412]: cannot find type `EventPoll` in this scope
   --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:153:16
    |
153 |     queue: Arc<EventPoll<Handler<T, S>>>,
    |                ^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `EventRef` in this scope
   --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:162:26
    |
162 |     yield_notice: Option<EventRef>,
    |                          ^^^^^^^^ not found in this scope
    |
help: you might be missing a type parameter
    |
151 | pub struct Device<T: Tun, S: Sock, EventRef> {
    |                                  ++++++++++

error[E0412]: cannot find type `EventRef` in this scope
   --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:163:25
    |
163 |     exit_notice: Option<EventRef>,
    |                         ^^^^^^^^ not found in this scope
    |
help: you might be missing a type parameter
    |
151 | pub struct Device<T: Tun, S: Sock, EventRef> {
    |                                  ++++++++++

error[E0046]: not all trait items implemented, missing: `set_fwmark`
   --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/udp_unix.rs:238:1
    |
238 | impl Sock for UDPSocket {
    | ^^^^^^^^^^^^^^^^^^^^^^^ missing `set_fwmark` in implementation
    |
   ::: /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:115:5
    |
115 |     fn set_fwmark(&self, mark: u32) -> Result<(), Error>;
    |     ----------------------------------------------------- `set_fwmark` from trait

error[E0433]: failed to resolve: use of undeclared type `WaitResult`
   --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:261:21
    |
261 |                     WaitResult::Ok(handler) => {
    |                     ^^^^^^^^^^ use of undeclared type `WaitResult`

error[E0433]: failed to resolve: use of undeclared type `WaitResult`
   --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:272:21
    |
272 |                     WaitResult::EoF(handler) => {
    |                     ^^^^^^^^^^ use of undeclared type `WaitResult`

error[E0433]: failed to resolve: use of undeclared type `WaitResult`
   --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:275:21
    |
275 |                     WaitResult::Error(e) => error!(device_lock.config.logger, "Poll error {:}", e),
    |                     ^^^^^^^^^^ use of undeclared type `WaitResult`

error[E0433]: failed to resolve: use of undeclared type `EventPoll`
   --> /home/kusoneko/.cargo/git/checkouts/boringtun-43e0ebe9a562865b/f288b2f/src/device/mod.rs:371:20
    |
371 |         let poll = EventPoll::<Handler<T, S>>::new()?;
    |                    ^^^^^^^^^ use of undeclared type `EventPoll`

Some errors have detailed explanations: E0046, E0412, E0432, E0433.
For more information about an error, try `rustc --explain E0046`.
error: could not compile `boringtun` (lib) due to 13 previous errors; 24 warnings emitted

I had a quick look at the library's repository, it seems to be 99 commits out of date with upstream, however I'm not sure whether it's as simple as updating it to fix the issue, and it might simply cause more issues.

As I'm not exactly an expert on all this (cjdns, networking, C, Nodejs and Rust) so I'd like some help on figuring out how to fix this if possible.

Thank you,
Kusoneko.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions