Skip to content

Commit

Permalink
Update and rework dependencies
Browse files Browse the repository at this point in the history
Update parking_lot, base64, and slog.
Move binary dependencies into a feature, and build by default.
This allows library users to avoid building clap, slog-term, and daemonize.
Don't build binary deps for --lib in CI/CD
  • Loading branch information
jeff-hiner committed Jul 26, 2021
1 parent 42fe845 commit cb83c8e
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 125 deletions.
163 changes: 55 additions & 108 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 14 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,38 @@ repository = "https://github.com/cloudflare/boringtun"
edition = "2018"

[dependencies]
base64 = "0.12"
base64 = "0.13"
hex = "0.4"
untrusted = "0.7"
libc = "0.2"
parking_lot = "0.10"
slog = "2.5"
slog-term = "2.5"
parking_lot = "0.11"
slog = "2.7"
slog-term = { version = "2.7", optional = true }
ip_network = "0.3.4"
ip_network_table = "0.1.2"
clap = { version = "2.33", default-features = false, features = ["suggestions"], optional = true }
daemonize = { version = "0.4.1", optional = true }

[dev-dependencies]
slog-term = { version = "2.7" }

[target.'cfg(not(target_arch="arm"))'.dependencies]
ring = "0.16"

[target.'cfg(not(any(target_os="windows", target_os="ios", target_os="android")))'.dependencies]
chrono = "0.4"
daemonize = "0.4.1"
clap = { version = "2.33", default-features=false, features = ["suggestions"] }

[target.'cfg(target_os="android")'.dependencies]
jni = "0.10"

[features]
default = ["build-binary"]
build-binary = ["slog-term", "clap", "daemonize"]

[lib]
crate-type = ["lib", "staticlib", "dylib"]

[[bin]]
name = "boringtun"
path = "src/main.rs"
required-features = ["build-binary"]

[[example]]
name = "benchmarks"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cargo install boringtun

### Building

- Library only: `cargo build --lib --release [--target $(TARGET_TRIPLE)]`
- Library only: `cargo build --lib --no-default-features --release [--target $(TARGET_TRIPLE)]`
- Executable: `cargo build --bin boringtun --release [--target $(TARGET_TRIPLE)]`

By default the executable is placed in the `./target/release` folder. You can copy it to a desired location manually, or install it using `cargo install --bin boringtun --path .`.
Expand Down
Loading

0 comments on commit cb83c8e

Please sign in to comment.