esp-rs / esp-idf-template

A "Hello, world!" template of a Rust binary crate for the ESP-IDF framework.
414 stars 50 forks source link

update devcontainer to bookworm container using rust-nightly #170

Open Vollbrecht opened 11 months ago

Vollbrecht commented 11 months ago

supersedes #169

SergioGasquez commented 11 months ago

What about using idf-rust tags, which are generated in this workflow from this container file. The container file could probably be improved, and IIRC, you did some work on that a while ago? We could pick that work, finish it and leverage it here too

Vollbrecht commented 11 months ago

What about using idf-rust tags, which are generated in this workflow from this container file.

If i understand you correctly you want to (depending on the tag) just link to an existing build image from the repo? yeah we may should do this.

As you see i already only include the xtensa toolchain if riscv is not set in this. Also i removed espflash from the container and some libusb dep's that really only needed if one would attempt to forward the usb-connection.

I think its good to switch from base bookworm to the rust-lang nightly image. Your opinion here?

I also thinking about adding an unrelated thing, but useful for guys using the container to put the compiled binary into a different outdir with this option inside the config.toml

[build]
.....
out-dir = "bin" # copy build artifacts to bin/

[unstable] 
unstable-options = true # for out-dir usage

So if one wants to flash from hosts its simpler to locate the elf file

Vollbrecht commented 11 months ago

the container don't build on ci because the action itself sources the source /home/esp/export-esp.sh. I could adapt the action with a simple if / else, but i think i will look into the published idf-rust containers first

Vollbrecht commented 11 months ago

for now i created https://github.com/esp-rs/rust-build/issues/247 where we can coordinate potential improvements for all projects

SergioGasquez commented 11 months ago

I think its good to switch from base bookworm to the rust-lang nightly image. Your opinion here?

There is even a nightly-bookworm-slim which is 240 MB smaller, we could also evaluate it.

Regarding setting the output to bin I dont have an strong opinion, to be honest. Im used to locate the elf files under the target folder, but I might be a bit biased. Also, espflash/espfhash can be very handy here.

Vollbrecht commented 11 months ago

I think its good to switch from base bookworm to the rust-lang nightly image. Your opinion here?

There is even a nightly-bookworm-slim which is 240 MB smaller, we could also evaluate it.

this should be the same image just from docker-hub and not from ghcr ?

Regarding setting the output to bin I dont have an strong opinion, to be honest. Im used to locate the elf files under the target folder, but I might be a bit biased. Also, espflash/espfhash can be very handy here.

Does espflash correctly autofinds debug/release elf on no_std projects? for my projects i always need to give it the path to the elf

SergioGasquez commented 11 months ago

this should be the same image just from docker-hub and not from ghcr ?

Just checked and its also available in GitHub registry: https://github.com/rust-lang/docker-rust-nightly/pkgs/container/rust/144487152?tag=nightly-bookworm-slim

Does espflash correctly autofinds debug/release elf on no_std projects? for my projects i always need to give it the path to the elf

No, I meant it for the save-image subcomand