boringtun icon indicating copy to clipboard operation
boringtun copied to clipboard

Target aarch64-apple-ios fails to build

Open protonjohn opened this issue 3 years ago • 0 comments

I added the aarch64-apple-ios target using rustup target add aarch64-apple-ios. However, when I attempt to build version 0.4.0 of this project with cargo build --release --target aarch64-apple-ios, I get the following build error:

   Compiling boringtun v0.4.0 (/Users/jkb/src/boringtun)
warning: dropping unsupported crate type `dylib` for target `aarch64-apple-ios`

warning: `boringtun` (lib) generated 1 warning
error[E0432]: unresolved import `clap`
  --> src/main.rs:14:5
   |
14 | use clap::{value_t, App, Arg};
   |     ^^^^ use of undeclared crate or module `clap`

error[E0432]: unresolved import `daemonize`
  --> src/main.rs:15:5
   |
15 | use daemonize::Daemonize;
   |     ^^^^^^^^^ use of undeclared crate or module `daemonize`

error: cannot determine resolution for the macro `value_t`
  --> src/main.rs:98:18
   |
98 |     let tun_fd = value_t!(matches.value_of("tun-fd"), isize).unwrap_or_else(|e| e.exit());
   |                  ^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the macro `value_t`
   --> src/main.rs:103:21
    |
103 |     let n_threads = value_t!(matches.value_of("threads"), usize).unwrap_or_else(|e| e.exit());
    |                     ^^^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the macro `value_t`
   --> src/main.rs:105:9
    |
105 |         value_t!(matches.value_of("verbosity"), tracing::Level).unwrap_or_else(|e| e.exit());
    |         ^^^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports

error[E0308]: mismatched types
  --> src/main.rs:24:13
   |
23 | /         if device::tun::parse_utun_name(&_v).is_ok() {
24 | |             Ok(())
   | |             ^^^^^^ expected `()`, found enum `Result`
25 | |         } else {
26 | |             Err("Tunnel name must have the format 'utun[0-9]+', use 'utun' for automatic assignment".to_owned())
27 | |         }
   | |_________- expected this to be `()`
   |
   = note: expected unit type `()`
                   found enum `Result<(), _>`
help: consider using a semicolon here
   |
24 |             Ok(());
   |                   +
help: consider using a semicolon here
   |
27 |         };
   |          +
help: you might have meant to return this value
   |
24 |             return Ok(());
   |             ++++++       +

error[E0308]: mismatched types
  --> src/main.rs:26:13
   |
23 | /         if device::tun::parse_utun_name(&_v).is_ok() {
24 | |             Ok(())
25 | |         } else {
26 | |             Err("Tunnel name must have the format 'utun[0-9]+', use 'utun' for automatic assignment".to_owned())
   | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `Result`
27 | |         }
   | |_________- expected this to be `()`
   |
   = note: expected unit type `()`
                   found enum `Result<_, String>`
help: consider using a semicolon here
   |
26 |             Err("Tunnel name must have the format 'utun[0-9]+', use 'utun' for automatic assignment".to_owned());
   |                                                                                                                 +
help: consider using a semicolon here
   |
27 |         };
   |          +
help: you might have meant to return this value
   |
26 |             return Err("Tunnel name must have the format 'utun[0-9]+', use 'utun' for automatic assignment".to_owned());
   |             ++++++                                                                                                     +

error[E0277]: the size for values of type `str` cannot be known at compilation time
   --> src/main.rs:101:9
    |
101 |         tun_name = matches.value_of("tun-fd").unwrap();
    |         ^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
    = note: the left-hand-side of an assignment must have a statically known size

protonjohn avatar Apr 27 '22 08:04 protonjohn