make basalt optionnal during compilation

This commit is contained in:
Alex 2021-03-10 22:32:14 +01:00
parent a2e2f5e96b
commit c05600d749
3 changed files with 42 additions and 8 deletions

View file

@ -1,7 +1,21 @@
kind: pipeline
name: default
workspace:
base: /drone
clone:
disable: true
steps:
- name: clone
image: alpine/git
commands:
- mkdir -p cargo
- git clone $DRONE_GIT_HTTP_URL
- cd netapp
- git checkout $DRONE_COMMIT
- name: restore-cache
image: meltwater/drone-cache:dev
environment:
@ -14,21 +28,29 @@ steps:
restore: true
archive_format: "gzip"
bucket: drone-cache
cache_key: '{{ .Repo.Name }}_{{ checksum "Cargo.lock" }}_{{ arch }}_{{ os }}_gzip'
cache_key: '{{ .Repo.Name }}_{{ checksum "netapp/Cargo.lock" }}_{{ arch }}_{{ os }}_gzip'
region: garage
mount:
- 'target'
- 'netapp/target'
- 'cargo/registry/index'
- 'cargo/registry/cache'
- 'cargo/bin'
- 'cargo/git/db'
path_style: true
endpoint: https://garage.deuxfleurs.fr
- name: build
image: rustlang/rust:nightly
environment:
CARGO_HOME: /drone/cargo
commands:
- apt-get update
- apt-get install --yes libsodium-dev
- cargo build
- cargo install cargo-all-features
- cd netapp
- cargo build-all-features
- cargo build --example fullmesh
- cargo build --example basalt
- cargo build --example basalt --features "basalt"
- name: rebuild-cache
image: meltwater/drone-cache:dev
@ -42,9 +64,13 @@ steps:
rebuild: true
archive_format: "gzip"
bucket: drone-cache
cache_key: '{{ .Repo.Name }}_{{ checksum "Cargo.lock" }}_{{ arch }}_{{ os }}_gzip'
cache_key: '{{ .Repo.Name }}_{{ checksum "netapp/Cargo.lock" }}_{{ arch }}_{{ os }}_gzip'
region: garage
mount:
- 'target'
- 'netapp/target'
- 'cargo/registry/index'
- 'cargo/registry/cache'
- 'cargo/bin'
- 'cargo/git/db'
path_style: true
endpoint: https://garage.deuxfleurs.fr

View file

@ -14,6 +14,10 @@ categories = ["asynchronous", "network-programming"]
[lib]
name = "netapp"
[features]
default = []
basalt = ["lru", "rand"]
[dependencies]
async-std = { version = "1.5.0", default-features = false }
tokio = { version = "0.2", default-features = false, features = ["net", "tcp", "rt-core", "rt-threaded", "sync", "time", "macros"] }
@ -24,7 +28,7 @@ hex = "0.4.2"
base64 = "0.12.1"
structopt = { version = "0.3", default-features = false }
rand = "0.5.5"
rand = { version = "0.5.5", optional = true }
chrono = "0.4"
log = "0.4.8"
@ -33,8 +37,10 @@ arc-swap = "1.1"
async-trait = "0.1.7"
err-derive = "0.2.3"
bytes = "0.6.0"
lru = "0.6"
lru = { version = "0.6", optional = true }
sodiumoxide = { version = "0.2.5-0", package = "kuska-sodiumoxide" }
kuska-handshake = { version = "0.1.2", features = ["default", "tokio_compat"] }
[package.metadata.cargo-all-features]
skip_optional_dependencies = true

View file

@ -1,2 +1,4 @@
pub mod fullmesh;
#[cfg(feature = "basalt")]
pub mod basalt;