rust-embedded-community / async-on-embedded

Apache License 2.0
123 stars 11 forks source link

Update riscv dependency version #10

Closed chemicstry closed 4 years ago

chemicstry commented 4 years ago

This updates riscv dependency version and resolves bare-metal conflict when building for stm32:

error: failed to select a version for `bare-metal`.
    ... required by package `stm32f4xx-hal v0.8.0`
    ... which is depended on by `gimbal-ctrl v0.1.0 (C:\Users\User\Documents\Dev\gimbal-ctrl)`
versions that meet the requirements `^0.2.5` are: 0.2.5

all possible versions conflict with previously selected packages.

  previously selected package `bare-metal v0.2.1`
    ... which is depended on by `riscv v0.5.6`
    ... which is depended on by `async-embedded v0.0.0-alpha.0 (https://github.com/rust-embedded-community/async-on-embedded?rev=5609a9d#5609a9d2)`
    ... which is depended on by `gimbal-ctrl v0.1.0 (C:\Users\User\Documents\Dev\gimbal-ctrl)`

failed to select a version for `bare-metal` which could resolve this conflict

This is a problem because cargo selects versions with all cfg(...) macros evaluated to true, so even if not building for riscv arch, it fails to select proper bare-metal version.

chemicstry commented 4 years ago

I've also hit another similar problem where memchr fails to build because riscv has it as a build dependency and forces std feature flag. This can be resolved with an unstable cargo feature https://github.com/rust-lang/cargo/issues/7915 which isolates regular and build dependency feature flags.