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

Compilation problem (rust-1.34.0, NetBSD) #82

Closed
0-wiz-0 opened this issue May 8, 2019 · 3 comments
Closed

Compilation problem (rust-1.34.0, NetBSD) #82

0-wiz-0 opened this issue May 8, 2019 · 3 comments

Comments

@0-wiz-0
Copy link

0-wiz-0 commented May 8, 2019

I just tried building git head (37be474) on NetBSD with rust-1.34.0. It failed:

# git clone ...

# cargo build
...
   Compiling boringtun v0.2.0
error[E0432]: unresolved import
 --> src/device/api.rs:4:13
  |
4 | use super::{make_array, AllowedIP, Device, Error, SocketAddr, X25519PublicKey, X25519SecretKey};
  |             ^^^^^^^^^^

error[E0433]: failed to resolve: use of undeclared type or module `WaitResult`
   --> src/device/mod.rs:218:21
    |
218 |                     WaitResult::Ok(handler) => {
    |                     ^^^^^^^^^^ use of undeclared type or module `WaitResult`

error[E0433]: failed to resolve: use of undeclared type or module `WaitResult`
   --> src/device/mod.rs:229:21
    |
229 |                     WaitResult::EoF(handler) => {
    |                     ^^^^^^^^^^ use of undeclared type or module `WaitResult`

error[E0433]: failed to resolve: use of undeclared type or module `WaitResult`
   --> src/device/mod.rs:232:21
    |
232 |                     WaitResult::Error(e) => eprintln!("Poll error {:}", e),
    |                     ^^^^^^^^^^ use of undeclared type or module `WaitResult`

error[E0433]: failed to resolve: use of undeclared type or module `EventPoll`
   --> src/device/mod.rs:331:20
    |
331 |         let poll = EventPoll::<Handler>::new()?;
    |                    ^^^^^^^^^ use of undeclared type or module `EventPoll`

error[E0433]: failed to resolve: use of undeclared type or module `TunSocket`
   --> src/device/mod.rs:334:30
    |
334 |         let iface = Arc::new(TunSocket::new(name)?.set_non_blocking()?);
    |                              ^^^^^^^^^ use of undeclared type or module `TunSocket`

error[E0425]: cannot find function `errno_str` in this scope
  --> src/device/drop_privileges.rs:32:42
   |
32 |         return Err(Error::DropPrivileges(errno_str()));
   |                                          ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
  --> src/device/drop_privileges.rs:37:42
   |
37 |         return Err(Error::DropPrivileges(errno_str()));
   |                                          ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
  --> src/device/udp_unix.rs:33:37
   |
33 |             -1 => Err(Error::Socket(errno_str())),
   |                                     ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
  --> src/device/udp_unix.rs:41:37
   |
41 |             -1 => Err(Error::Socket(errno_str())),
   |                                     ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
  --> src/device/udp_unix.rs:49:36
   |
49 |             -1 => Err(Error::FCntl(errno_str())),
   |                                    ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
  --> src/device/udp_unix.rs:51:40
   |
51 |                 -1 => Err(Error::FCntl(errno_str())),
   |                                        ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
  --> src/device/udp_unix.rs:71:41
   |
71 |             -1 => Err(Error::SetSockOpt(errno_str())),
   |                                         ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
  --> src/device/udp_unix.rs:86:42
   |
86 |             -1 => Err(Error::GetSockName(errno_str())),
   |                                          ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
   --> src/device/udp_unix.rs:140:35
    |
140 |             -1 => Err(Error::Bind(errno_str())),
    |                                   ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
   --> src/device/udp_unix.rs:157:35
    |
157 |             -1 => Err(Error::Bind(errno_str())),
    |                                   ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
   --> src/device/udp_unix.rs:192:38
    |
192 |             -1 => Err(Error::Connect(errno_str())),
    |                                      ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno_str` in this scope
   --> src/device/udp_unix.rs:211:38
    |
211 |             -1 => Err(Error::Connect(errno_str())),
    |                                      ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `errno` in this scope
   --> src/device/udp_unix.rs:300:39
    |
300 |             return Err(Error::UDPRead(errno()));
    |                                       ^^^^^ not found in this scope

error[E0425]: cannot find function `errno` in this scope
   --> src/device/udp_unix.rs:337:39
    |
337 |             return Err(Error::UDPRead(errno()));
    |                                       ^^^^^ not found in this scope

error[E0425]: cannot find function `errno` in this scope
   --> src/device/udp_unix.rs:352:38
    |
352 |             -1 => Err(Error::UDPRead(errno())),
    |                                      ^^^^^ not found in this scope

error[E0412]: cannot find type `EventPoll` in this scope
   --> src/device/mod.rs:112:16
    |
112 |     queue: Arc<EventPoll<Handler>>,
    |                ^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `TunSocket` in this scope
   --> src/device/mod.rs:117:16
    |
117 |     iface: Arc<TunSocket>,
    |                ^^^^^^^^^ help: a struct with a similar name exists: `UDPSocket`

error[E0412]: cannot find type `EventRef` in this scope
   --> src/device1 |     yield_notice: Option<EventRef>,
    |                          ^^^^^^^^ not found in this scope

error[E0412]: cannot find type `EventRef` in this scope
   --> src/device/mod.rs:122:25
    |
122 |     exit_notice: Option<EventRef>,
    |           scope

error[E0412]: cannot find type `TunSocket` in this scope
   --> src/device/mod.rs:137:16
    |
137 |     iface: Arc<TunSocket>,
    |                ^^^^^^^^^ help: a struct with a similar name exists: `UDPSocket`

error[E0412]: cannot find type `14 |     fn register_iface_handler(&self, iface: Arc<TunSocket>) -> Result<(), Error> {
    |                                                 ^^^^^^^^^ help: a struct with a similar name exists: `UDPSocket`

warning: unused import: `crate::device::errno_s:4:5
  |
4 | use crate::device::errno_str;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

warning: unused imports: `errno_str`, `errno`
 --> src/device/udp_unix.rs:4:13
  |
4 | use super::{errno, errno_str, Error};
 
warning: unused import: `crate::poll::*`
  --> src/device/mod.rs:47:5
   |
47 | use crate::poll::*;
   |     ^^^^^^^^^^^^^^

warning: unused import: `crate::tun::*`
  --> src/device/mod.rs:48:5
   |
48 | use crate::tun::*;
   |     ^^^^^^^^^^^^^

error[E
   --> src/device/mod.rs:217:29
    |
217 |                 match queue.wait() {
    |                             ^^^^
    |
    = note: queue is a function, perhaps you wish to call it

error[E0599]: no method named `mtu` found for type `std::sync::Arc-> src/device/mod.rs:335:25
    |
335 |         let mtu = iface.mtu()?;
    |                         ^^^
    |
    = note: iface is a function, perhaps you wish to call it

error[E0599]: no method named `set_fwmark` found for type `&std::sync::Arc<device   --> src/device/mod.rs:450:18
    |
450 |             sock.set_fwmark(mark)?;
    |                  ^^^^^^^^^^

error[E0599]: no method named `set_fwmark` found for type `&std::sync::Arc<device::udp::UDPSocket>` in the current scope
   --> src/device/m    sock.set_fwmark(mark)?;
    |                  ^^^^^^^^^^

error[E0599]: no method named `set_fwmark` found for type `&std::sync::Arc<device::udp::UDPSocket>` in the current scope
   --> src/device/mod.rs:460:22
    |
460 |                 sock.set_fw    |                      ^^^^^^^^^^

error[E0308]: mismatched types
  --> src/device/api.rs:66:57
   |
66 |                         "set=1" => api_set(&mut reader, d),
   |                                                         ^ types differ in mutabi
   = note: expected type `&mut device::dev_lock::LockReadGuard<'_, device::Device>`
              found type `&device::Device`

error[E0599]: no method named `set_fwmark` found for type `std::sync::Arc<device::udp::UDPSocket>` in the current scope
   --> |                      ^^^^^^^^^^

error[E0063]: missing field `sin_len` in initializer of `libc::unix::bsd::netbsdlike::netbsd::sockaddr_in`
   --> src/device/udp_unix.rs:124:20
    |
124 |         let addr = sockaddr_in {
    |                    ^^^^^missing `sin_len`

error[E0063]: missing field `sin_len` in initializer of `libc::unix::bsd::netbsdlike::netbsd::sockaddr_in`
   --> src/device/udp_unix.rs:174:20
    |
174 |         let addr = sockaddr_in {
    |                    ^^^^^^^^^^^ missing `sor[E0063]: missing field `sin_len` in initializer of `libc::unix::bsd::netbsdlike::netbsd::sockaddr_in`
   --> src/device/udp_unix.rs:228:20
    |
228 |         let addr = sockaddr_in {
    |                    ^^^^^^^^^^^ missing `sin_len`

error[E0063]:libc::unix::bsd::netbsdlike::netbsd::sockaddr_in`
   --> src/device/udp_unix.rs:315:24
    |
315 |         let mut addr = sockaddr_in {
    |                        ^^^^^^^^^^^ missing `sin_len`

error: aborting due to 38 previous errors

Some errors occu0433, E0599.
For more information about an error, try `rustc --explain E0063`.
error: Could not compile `boringtun`.

To learn more, run the command again with --verbose.

I don't know enough about rust to differentiate this in NetBSD problem and general problems, sorry.

@vkrasnov
Copy link
Contributor

vkrasnov commented May 8, 2019

None of the BSDs are supported yet, although FreeBSD is coming soon.

@Bren2010 Bren2010 closed this as completed Oct 9, 2021
@0-wiz-0
Copy link
Author

0-wiz-0 commented Oct 9, 2021

Since this was closed, I just tried the code again, but:

   Compiling boringtun v0.3.0 (/disk/6/archive/foreign/boringtun)
error[E0432]: unresolved import `poll`
  --> src/device/mod.rs:48:5
   |
48 | use poll::{EventPoll, EventRef, WaitResult};
   |     ^^^^ use of undeclared crate or module `poll`

error[E0432]: unresolved imports `tun`, `crate::device::errno_str`, `super::errno`, `super::errno_str`
  --> src/device/mod.rs:49:5
   |
49 | use tun::{errno, errno_str, TunSocket};
   |     ^^^ use of undeclared crate or module `tun`
   |
  ::: src/device/drop_privileges.rs:4:5
   |
4  | use crate::device::errno_str;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: src/device/udp_unix.rs:4:13
   |
4  | use super::{errno, errno_str, Error};
   |             ^^^^^  ^^^^^^^^^

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

error[E0599]: no method named `wait` found for struct `Arc<_>` in the current scope
   --> src/device/mod.rs:272:29
    |
272 |                 match queue.wait() {
    |                             ^^^^ method not found in `Arc<_>`
    |
    = note: `queue` is a function, perhaps you wish to call it

error[E0308]: mismatched types
  --> src/device/api.rs:66:57
   |
66 |                         "set=1" => api_set(&mut reader, d),
   |                                                         ^ types differ in mutability
   |
   = note: expected mutable reference `&mut LockReadGuard<'_, Device<_, _>>`
                      found reference `&Device<_, _>`
note: return type inferred to be `&mut LockReadGuard<'_, Device<_, _>>` here
  --> src/device/api.rs:55:33
   |
55 |                     _ => return Action::Continue,
   |                                 ^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/device/api.rs:96:57
   |
96 |                         "set=1" => api_set(&mut reader, d),
   |                                                         ^ types differ in mutability
   |
   = note: expected mutable reference `&mut LockReadGuard<'_, Device<_, _>>`
                      found reference `&Device<_, _>`

error[E0063]: missing field `sin_len` in initializer of `libc::sockaddr_in`
  --> src/device/udp_unix.rs:20:20
   |
20 |         let addr = sockaddr_in {
   |                    ^^^^^^^^^^^ missing `sin_len`

error[E0063]: missing field `sin_len` in initializer of `libc::sockaddr_in`
  --> src/device/udp_unix.rs:60:20
   |
60 |         let addr = sockaddr_in {
   |                    ^^^^^^^^^^^ missing `sin_len`

error[E0063]: missing field `sin_len` in initializer of `libc::sockaddr_in`
   --> src/device/udp_unix.rs:104:20
    |
104 |         let addr = sockaddr_in {
    |                    ^^^^^^^^^^^ missing `sin_len`

error[E0063]: missing field `sin_len` in initializer of `libc::sockaddr_in`
   --> src/device/udp_unix.rs:183:24
    |
183 |         let mut addr = sockaddr_in {
    |                        ^^^^^^^^^^^ missing `sin_len`

error: aborting due to 10 previous errors


Does this mean you have no intention of supporting NetBSD?

@Bren2010
Copy link
Contributor

Bren2010 commented Oct 9, 2021

Like Vlad said, we don't currently support BSD. There are plans to add support but I don't know when they'll be realized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants