-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update devcontainer to bookworm container using rust-nightly #170
Open
Vollbrecht
wants to merge
3
commits into
esp-rs:master
Choose a base branch
from
Vollbrecht:vscode-con-bookworm
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,4 @@ | ||||||
ARG VARIANT=bullseye | ||||||
FROM debian:${VARIANT} | ||||||
FROM ghcr.io/rust-lang/rust:nightly-bookworm | ||||||
ENV DEBIAN_FRONTEND=noninteractive | ||||||
ENV LC_ALL=C.UTF-8 | ||||||
ENV LANG=C.UTF-8 | ||||||
|
@@ -10,47 +9,42 @@ ARG CONTAINER_GROUP=esp | |||||
ARG ESP_BOARD=all | ||||||
ARG GITHUB_TOKEN | ||||||
|
||||||
# Install dependencies | ||||||
ARG RUST_INSTALL_DIR=/usr/local/cargo | ||||||
|
||||||
# Install dependencies needed for esp-idf + clang for riscv rust | ||||||
RUN apt-get update \ | ||||||
&& apt-get install -y git curl gcc clang ninja-build libudev-dev unzip xz-utils\ | ||||||
python3 python3-pip python3-venv libusb-1.0-0 libssl-dev pkg-config libpython2.7 \ | ||||||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts | ||||||
&& apt-get install -y flex bison gperf python3-pip python3-venv cmake ninja-build ccache dfu-util clang \ | ||||||
&& apt-get clean -y \ | ||||||
&& rm -rf /var/lib/apt/lists/* /tmp/library-scripts | ||||||
|
||||||
# Set users | ||||||
RUN adduser --disabled-password --gecos "" ${CONTAINER_USER} | ||||||
USER ${CONTAINER_USER} | ||||||
WORKDIR /home/${CONTAINER_USER} | ||||||
|
||||||
# Install rustup | ||||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ | ||||||
--default-toolchain none -y --profile minimal | ||||||
|
||||||
# Update envs | ||||||
ENV PATH=${PATH}:/home/${CONTAINER_USER}/.cargo/bin | ||||||
|
||||||
# Install extra crates | ||||||
RUN ARCH=$($HOME/.cargo/bin/rustup show | grep "Default host" | sed -e 's/.* //') && \ | ||||||
curl -L "https://github.com/esp-rs/espup/releases/latest/download/espup-${ARCH}" -o "${HOME}/.cargo/bin/espup" && \ | ||||||
chmod u+x "${HOME}/.cargo/bin/espup" && \ | ||||||
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" && \ | ||||||
chmod u+x "${HOME}/.cargo/bin/ldproxy" && \ | ||||||
curl -L "https://github.com/bjoernQ/esp-web-flash-server/releases/latest/download/web-flash-${ARCH}.zip" -o "${HOME}/.cargo/bin/web-flash.zip" && \ | ||||||
unzip "${HOME}/.cargo/bin/web-flash.zip" -d "${HOME}/.cargo/bin/" && \ | ||||||
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" -%} | ||||||
curl -L "https://github.com/esp-rs/espup/releases/latest/download/espup-${ARCH}" -o "${RUST_INSTALL_DIR}/bin/espup" && \ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
chmod u+x "${RUST_INSTALL_DIR}/bin/espup" && \ | ||||||
{% endif -%} | ||||||
curl -L "https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-${ARCH}.zip" -o "${RUST_INSTALL_DIR}/bin/ldproxy.zip" && \ | ||||||
unzip "${RUST_INSTALL_DIR}/bin/ldproxy.zip" -d "${RUST_INSTALL_DIR}/bin/" && \ | ||||||
rm "${RUST_INSTALL_DIR}/bin/ldproxy.zip" && \ | ||||||
chmod u+x "${RUST_INSTALL_DIR}/bin/ldproxy" && \ | ||||||
curl -L "https://github.com/bjoernQ/esp-web-flash-server/releases/latest/download/web-flash-${ARCH}.zip" -o "${RUST_INSTALL_DIR}/bin/web-flash.zip" && \ | ||||||
unzip "${RUST_INSTALL_DIR}/bin/web-flash.zip" -d "${RUST_INSTALL_DIR}/bin/" && \ | ||||||
rm "${RUST_INSTALL_DIR}/bin/web-flash.zip" && \ | ||||||
chmod u+x "${RUST_INSTALL_DIR}/bin/web-flash" | ||||||
|
||||||
# Install Xtensa Rust | ||||||
{% if arch != "riscv" -%} | ||||||
RUN if [ -n "${GITHUB_TOKEN}" ]; then export GITHUB_TOKEN=${GITHUB_TOKEN}; fi \ | ||||||
&& ${HOME}/.cargo/bin/espup install\ | ||||||
&& ${RUST_INSTALL_DIR}/bin/espup install\ | ||||||
--targets "${ESP_BOARD}" \ | ||||||
--log-level debug \ | ||||||
--export-file /home/${CONTAINER_USER}/export-esp.sh | ||||||
{% endif %} | ||||||
|
||||||
# Set default toolchain | ||||||
{% if arch == "riscv" -%} | ||||||
|
@@ -59,7 +53,9 @@ RUN rustup default nightly | |||||
RUN rustup default esp | ||||||
{% endif %} | ||||||
|
||||||
{% if arch != "riscv" -%} | ||||||
# Activate ESP environment | ||||||
RUN echo "source /home/${CONTAINER_USER}/export-esp.sh" >> ~/.bashrc | ||||||
{% endif %} | ||||||
|
||||||
CMD [ "/bin/bash" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see some value on having
espflash
orcargo-espflash
installed, they offer subcomands likesave-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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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