From d4f2c6cf00b481f5d346bc3a1cd820883c8add23 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Tue, 2 Mar 2021 21:14:58 +0100 Subject: Remove cargo namespaced-features --- .cargo/config | 2 -- .github/workflows/rust.yml | 2 +- ci.sh | 30 ++++++++++++++++++++++++++++++ embassy-nrf-examples/.cargo/config | 1 - embassy-nrf-examples/Cargo.toml | 1 + embassy-nrf/src/gpiote.rs | 2 +- embassy-stm32f4-examples/Cargo.toml | 1 + embassy-traits/Cargo.toml | 10 ++-------- embassy/Cargo.toml | 12 ++++++------ test-build.sh | 30 ------------------------------ 10 files changed, 42 insertions(+), 49 deletions(-) delete mode 100644 .cargo/config create mode 100755 ci.sh delete mode 100755 test-build.sh diff --git a/.cargo/config b/.cargo/config deleted file mode 100644 index a14129b9d..000000000 --- a/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[unstable] -namespaced-features = true diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 44e092a67..006416121 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,4 +22,4 @@ jobs: components: rust-src override: true - name: Build - run: ./test-build.sh + run: ./ci.sh diff --git a/ci.sh b/ci.sh new file mode 100755 index 000000000..d556fb313 --- /dev/null +++ b/ci.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -euxo pipefail + +# embassy std +(cd embassy-std-examples; cargo build) + +# embassy embedded +(cd embassy; cargo build --target thumbv7em-none-eabi) +(cd embassy; cargo build --target thumbv7em-none-eabi --features log) +(cd embassy; cargo build --target thumbv7em-none-eabi --features defmt) + +# embassy-nrf + +(cd embassy-nrf-examples; cargo build --target thumbv7em-none-eabi --bins) + +(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52810) +#(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52811) # nrf52811-hal doesn't exist yet +(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52832) +(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52833) +(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52840) + +(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52840,log) +(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52840,defmt) + +# embassy-stm32f4 + +(cd embassy-stm32f4-examples; cargo build --target thumbv7em-none-eabi --bins) +(cd embassy-stm32f4; cargo build --target thumbv7em-none-eabi --features stm32f405) +(cd embassy-stm32f4; cargo build --target thumbv7em-none-eabi --features stm32f405,defmt) diff --git a/embassy-nrf-examples/.cargo/config b/embassy-nrf-examples/.cargo/config index 37e38ec95..17b9c8d80 100644 --- a/embassy-nrf-examples/.cargo/config +++ b/embassy-nrf-examples/.cargo/config @@ -1,5 +1,4 @@ [unstable] -namespaced-features = true build-std = ["core"] build-std-features = ["panic_immediate_abort"] diff --git a/embassy-nrf-examples/Cargo.toml b/embassy-nrf-examples/Cargo.toml index cf82a475f..1f67b6a8c 100644 --- a/embassy-nrf-examples/Cargo.toml +++ b/embassy-nrf-examples/Cargo.toml @@ -18,6 +18,7 @@ defmt-error = [] [dependencies] embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] } +embassy-traits = { version = "0.1.0", path = "../embassy-traits", features = ["defmt"] } embassy-nrf = { version = "0.1.0", path = "../embassy-nrf", features = ["defmt", "defmt-trace", "52840"] } defmt = "0.2.0" diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs index 7cc649107..5dc80a639 100644 --- a/embassy-nrf/src/gpiote.rs +++ b/embassy-nrf/src/gpiote.rs @@ -4,8 +4,8 @@ use core::ops::Deref; use core::pin::Pin; use core::ptr; use core::task::{Context, Poll}; -use embassy::traits::gpio::{WaitForHigh, WaitForLow}; use embassy::interrupt::InterruptExt; +use embassy::traits::gpio::{WaitForHigh, WaitForLow}; use embassy::util::Signal; use crate::hal::gpio::{Input, Level, Output, Pin as GpioPin, Port}; diff --git a/embassy-stm32f4-examples/Cargo.toml b/embassy-stm32f4-examples/Cargo.toml index 3e117ecb0..16581f4fd 100644 --- a/embassy-stm32f4-examples/Cargo.toml +++ b/embassy-stm32f4-examples/Cargo.toml @@ -18,6 +18,7 @@ defmt-error = [] [dependencies] embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] } +embassy-traits = { version = "0.1.0", path = "../embassy-traits", features = ["defmt"] } embassy-stm32f4 = { version = "*", path = "../embassy-stm32f4", features = ["stm32f401"] } defmt = "0.2.0" diff --git a/embassy-traits/Cargo.toml b/embassy-traits/Cargo.toml index 09db74ab9..626bf9f3a 100644 --- a/embassy-traits/Cargo.toml +++ b/embassy-traits/Cargo.toml @@ -4,14 +4,8 @@ version = "0.1.0" authors = ["Dario Nieuwenhuis "] edition = "2018" -[dependencies] -defmt = { version = "0.2.0", optional = true } - [features] std = [] -defmt-trace = [] -defmt-debug = [] -defmt-info = [] -defmt-warn = [] -defmt-error = [] \ No newline at end of file +[dependencies] +defmt = { version = "0.2.0", optional = true } diff --git a/embassy/Cargo.toml b/embassy/Cargo.toml index 116ab2245..1b8e2a075 100644 --- a/embassy/Cargo.toml +++ b/embassy/Cargo.toml @@ -6,12 +6,12 @@ edition = "2018" [features] std = ["futures/std", "embassy-traits/std"] -defmt = ["embassy-traits/defmt", "dep:defmt"] -defmt-trace = ["embassy-traits/defmt-trace"] -defmt-debug = ["embassy-traits/defmt-debug"] -defmt-info = ["embassy-traits/defmt-info"] -defmt-warn = ["embassy-traits/defmt-warn"] -defmt-error = ["embassy-traits/defmt-error"] + +defmt-trace = [] +defmt-debug = [] +defmt-info = [] +defmt-warn = [] +defmt-error = [] [dependencies] defmt = { version = "0.2.0", optional = true } diff --git a/test-build.sh b/test-build.sh deleted file mode 100755 index d556fb313..000000000 --- a/test-build.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -# embassy std -(cd embassy-std-examples; cargo build) - -# embassy embedded -(cd embassy; cargo build --target thumbv7em-none-eabi) -(cd embassy; cargo build --target thumbv7em-none-eabi --features log) -(cd embassy; cargo build --target thumbv7em-none-eabi --features defmt) - -# embassy-nrf - -(cd embassy-nrf-examples; cargo build --target thumbv7em-none-eabi --bins) - -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52810) -#(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52811) # nrf52811-hal doesn't exist yet -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52832) -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52833) -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52840) - -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52840,log) -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52840,defmt) - -# embassy-stm32f4 - -(cd embassy-stm32f4-examples; cargo build --target thumbv7em-none-eabi --bins) -(cd embassy-stm32f4; cargo build --target thumbv7em-none-eabi --features stm32f405) -(cd embassy-stm32f4; cargo build --target thumbv7em-none-eabi --features stm32f405,defmt) -- cgit