stm32-rs / stm32-usbd-examples

stm32-usbd examples for different microcontrollers
48 stars 19 forks source link

Can't build workspacce #1

Closed therealprof closed 5 years ago

therealprof commented 5 years ago

Trying a cargo build in the workspace path generates:

error: failed to run custom build command for `stm32-usbd v0.1.0 (/Users/egger/OSS/stm32-usbd-examples/stm32-usbd)`
process didn't exit successfully: `/Users/egger/OSS/stm32-usbd-examples/target/debug/build/stm32-usbd-b58b756788449979/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'More than one family feature selected: ["stm32f042xx", "stm32f103xx", "stm32f303xc", "stm32l4x2xx"]', stm32-usbd/build.rs:16:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
Disasm commented 5 years ago

I'm not sure if it's possible to build something useful with this command in workspace root. What did you expect to get as a result?

therealprof commented 5 years ago

My expectation would be that all the workspace members are built individually. This is how example crates usually work, like: https://github.com/actix/examples.git

Disasm commented 5 years ago

I hope this commit makes things a bit better: https://github.com/Disasm/stm32-usbd-examples/commit/818a37e20d407bb952166087465d59f06455c244

$ cargo build
error: manifest path `/tmp/stm32-usbd-examples` contains no package: The manifest is virtual, and the workspace has no members
Disasm commented 5 years ago

Unfortunately, some of the workspace members are not examples and also examples need to be compiled with different architecture targets. However, if you have any ideas -- please tell me.

therealprof commented 5 years ago

Hm. Unfortunately the instructions also don't work... at least this the STM32F042 example doesn't compile out of the box:

$ pwd
/Users/egger/OSS/stm32-usbd-examples/example-stm32f042k6
$ cargo build
error: no packages to compile
Disasm commented 5 years ago

Oh, that last fix broke everything.

therealprof commented 5 years ago

This is fixed by f4f20f2ead5b6eabb7d7051324d437a9e4a049dd.