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 kind: pipeline
name: default name: default
workspace:
base: /drone
clone:
disable: true
steps: 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 - name: restore-cache
image: meltwater/drone-cache:dev image: meltwater/drone-cache:dev
environment: environment:
@ -14,21 +28,29 @@ steps:
restore: true restore: true
archive_format: "gzip" archive_format: "gzip"
bucket: drone-cache 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 region: garage
mount: mount:
- 'target' - 'netapp/target'
- 'cargo/registry/index'
- 'cargo/registry/cache'
- 'cargo/bin'
- 'cargo/git/db'
path_style: true path_style: true
endpoint: https://garage.deuxfleurs.fr endpoint: https://garage.deuxfleurs.fr
- name: build - name: build
image: rustlang/rust:nightly image: rustlang/rust:nightly
environment:
CARGO_HOME: /drone/cargo
commands: commands:
- apt-get update - apt-get update
- apt-get install --yes libsodium-dev - 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 fullmesh
- cargo build --example basalt - cargo build --example basalt --features "basalt"
- name: rebuild-cache - name: rebuild-cache
image: meltwater/drone-cache:dev image: meltwater/drone-cache:dev
@ -42,9 +64,13 @@ steps:
rebuild: true rebuild: true
archive_format: "gzip" archive_format: "gzip"
bucket: drone-cache 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 region: garage
mount: mount:
- 'target' - 'netapp/target'
- 'cargo/registry/index'
- 'cargo/registry/cache'
- 'cargo/bin'
- 'cargo/git/db'
path_style: true path_style: true
endpoint: https://garage.deuxfleurs.fr endpoint: https://garage.deuxfleurs.fr

View file

@ -14,6 +14,10 @@ categories = ["asynchronous", "network-programming"]
[lib] [lib]
name = "netapp" name = "netapp"
[features]
default = []
basalt = ["lru", "rand"]
[dependencies] [dependencies]
async-std = { version = "1.5.0", default-features = false } 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"] } 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" base64 = "0.12.1"
structopt = { version = "0.3", default-features = false } structopt = { version = "0.3", default-features = false }
rand = "0.5.5" rand = { version = "0.5.5", optional = true }
chrono = "0.4" chrono = "0.4"
log = "0.4.8" log = "0.4.8"
@ -33,8 +37,10 @@ arc-swap = "1.1"
async-trait = "0.1.7" async-trait = "0.1.7"
err-derive = "0.2.3" err-derive = "0.2.3"
bytes = "0.6.0" bytes = "0.6.0"
lru = "0.6" lru = { version = "0.6", optional = true }
sodiumoxide = { version = "0.2.5-0", package = "kuska-sodiumoxide" } sodiumoxide = { version = "0.2.5-0", package = "kuska-sodiumoxide" }
kuska-handshake = { version = "0.1.2", features = ["default", "tokio_compat"] } 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; pub mod fullmesh;
#[cfg(feature = "basalt")]
pub mod basalt; pub mod basalt;