update devcontainer to bookworm container using rust-nightly #170
update devcontainer to bookworm container using rust-nightly #170Vollbrecht wants to merge 3 commits intoesp-rs:masterfrom
Conversation
Co-authored-by: John Sarracco <john.sarracco@warecorp.com>
|
What about using |
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 usageSo if one wants to flash from hosts its simpler to locate the elf file |
|
the container don't build on ci because the action itself sources the |
|
for now i created esp-rs/rust-build#247 where we can coordinate potential improvements for all projects |
| rm "${HOME}/.cargo/bin/web-flash.zip" && \ | ||
| chmod u+x "${HOME}/.cargo/bin/web-flash" | ||
| RUN ARCH=$(${RUST_INSTALL_DIR}/bin/rustup show | grep "Default host" | sed -e 's/.* //') && \ | ||
| {% if arch != "riscv" -%} |
There was a problem hiding this comment.
| {% if arch != "riscv" -%} | |
| {% if arch == "xtensa" -%} |
| curl -L "https://github.com/esp-rs/espflash/releases/latest/download/cargo-espflash-${ARCH}.zip" -o "${HOME}/.cargo/bin/cargo-espflash.zip" && \ | ||
| unzip "${HOME}/.cargo/bin/cargo-espflash.zip" -d "${HOME}/.cargo/bin/" && \ | ||
| rm "${HOME}/.cargo/bin/cargo-espflash.zip" && \ | ||
| chmod u+x "${HOME}/.cargo/bin/cargo-espflash" && \ | ||
| curl -L "https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-${ARCH}.zip" -o "${HOME}/.cargo/bin/ldproxy.zip" && \ | ||
| unzip "${HOME}/.cargo/bin/ldproxy.zip" -d "${HOME}/.cargo/bin/" && \ | ||
| rm "${HOME}/.cargo/bin/ldproxy.zip" && \ |
There was a problem hiding this comment.
I see some value on having espflash or cargo-espflash installed, they offer subcomands like save-image that can be really helpful even in a container, and also the user would like to forward the usb-connection and flash from the container as you mentioned.
There was a problem hiding this comment.
yeah i am on board with it, i just stripped them in here with the mind of a potential container that is often build. If we follow that what i wrote on esp-rs/rust-lang issue i think it should be all included in both the all and the target specific images
There is even a nightly-bookworm-slim which is 240 MB smaller, we could also evaluate it. Regarding setting the output to |
this should be the same image just from docker-hub and not from ghcr ?
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 |
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
No, I meant it for the |
supersedes #169