From 7f4a07e51c55866aeced6ea45841647c62ceba5e Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Tue, 17 Oct 2023 10:33:53 +0200 Subject: [PATCH 1/6] fix: Add cargo clean --- rust-nostd-avr/compile.sh | 3 ++- rust-nostd-esp/compile.sh | 1 + rust-std-esp/compile.sh | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rust-nostd-avr/compile.sh b/rust-nostd-avr/compile.sh index 37bb741..d8fff8c 100755 --- a/rust-nostd-avr/compile.sh +++ b/rust-nostd-avr/compile.sh @@ -30,7 +30,8 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then sed -i 's/^[[:space:]]*name[[:space:]]*=[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']\([[:space:]]*\)$/\nname = "'${PROJECT_NAME}'"/' Cargo.toml fi +cargo clean cargo audit cargo build --release --out-dir output -Z unstable-options -avr-objcopy -R .eeprom -O ihex ./target/${MCU}/release/${PROJECT_NAME}.elf ${HOME}/build-out/project.hex +avr-objcopy -R .eeprom -O ihex ./target/${MCU}/release/${PROJECT_NAME}.elf ${HOME}/build-out/project.hex cp ./target/${MCU}/release/${PROJECT_NAME}.elf ${HOME}/build-out/project.elf diff --git a/rust-nostd-esp/compile.sh b/rust-nostd-esp/compile.sh index f434dfd..b5baf75 100755 --- a/rust-nostd-esp/compile.sh +++ b/rust-nostd-esp/compile.sh @@ -39,6 +39,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then rnamer -n ${PROJECT_NAME} fi +cargo clean cargo audit cargo build --release --out-dir output -Z unstable-options espflash save-image --chip ${WOKWI_MCU_NO_DASH} --flash-size 4mb ${PROJECT_ROOT}/output/${PROJECT_NAME} ${HOME}/build-out/project.bin diff --git a/rust-std-esp/compile.sh b/rust-std-esp/compile.sh index 94da5fa..94431f5 100755 --- a/rust-std-esp/compile.sh +++ b/rust-std-esp/compile.sh @@ -40,6 +40,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then rnamer -n ${PROJECT_NAME} fi +cargo clean cargo audit cargo build --release --out-dir output -Z unstable-options espflash save-image --chip ${WOKWI_MCU_NO_DASH} --flash-size 4mb ${PROJECT_ROOT}/output/${PROJECT_NAME} ${HOME}/build-out/project.bin From 92f5e8f0fb747df997dde09e6352ddf27d4e6e0e Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Tue, 17 Oct 2023 10:34:31 +0200 Subject: [PATCH 2/6] feat: Bump Xtensa Rust Version --- rust-nostd-esp/Dockerfile | 2 +- rust-std-esp/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-nostd-esp/Dockerfile b/rust-nostd-esp/Dockerfile index f634d02..0fd9748 100644 --- a/rust-nostd-esp/Dockerfile +++ b/rust-nostd-esp/Dockerfile @@ -1,4 +1,4 @@ -FROM espressif/idf-rust:all_1.72.0.0 +FROM espressif/idf-rust:all_1.73.0.0 USER esp ENV USER=esp diff --git a/rust-std-esp/Dockerfile b/rust-std-esp/Dockerfile index 816aafd..6b92550 100644 --- a/rust-std-esp/Dockerfile +++ b/rust-std-esp/Dockerfile @@ -1,4 +1,4 @@ -FROM espressif/idf-rust:all_1.72.0.0 +FROM espressif/idf-rust:all_1.73.0.0 USER esp ENV USER=esp From 1fae9b1934310c0fa393843ab39f1c1156c0d280 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Tue, 17 Oct 2023 11:04:23 +0200 Subject: [PATCH 3/6] fix: Delete cache --- rust-nostd-avr/compile.sh | 1 + rust-nostd-esp/compile.sh | 1 + rust-std-esp/compile.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/rust-nostd-avr/compile.sh b/rust-nostd-avr/compile.sh index d8fff8c..695741b 100755 --- a/rust-nostd-avr/compile.sh +++ b/rust-nostd-avr/compile.sh @@ -30,6 +30,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then sed -i 's/^[[:space:]]*name[[:space:]]*=[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']\([[:space:]]*\)$/\nname = "'${PROJECT_NAME}'"/' Cargo.toml fi +rm -rf ${HOME}/.cargo/registry/index/* ${HOME}/.cargo/.package-cache cargo clean cargo audit cargo build --release --out-dir output -Z unstable-options diff --git a/rust-nostd-esp/compile.sh b/rust-nostd-esp/compile.sh index b5baf75..083e006 100755 --- a/rust-nostd-esp/compile.sh +++ b/rust-nostd-esp/compile.sh @@ -39,6 +39,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then rnamer -n ${PROJECT_NAME} fi +rm -rf ${HOME}/.cargo/registry/index/* ${HOME}/.cargo/.package-cache cargo clean cargo audit cargo build --release --out-dir output -Z unstable-options diff --git a/rust-std-esp/compile.sh b/rust-std-esp/compile.sh index 94431f5..edcac2f 100755 --- a/rust-std-esp/compile.sh +++ b/rust-std-esp/compile.sh @@ -40,6 +40,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then rnamer -n ${PROJECT_NAME} fi +rm -rf ${HOME}/.cargo/registry/index/* ${HOME}/.cargo/.package-cache cargo clean cargo audit cargo build --release --out-dir output -Z unstable-options From 5857773ad709062f13da2358ce4cfb25b3d9c36b Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Tue, 17 Oct 2023 14:33:25 +0200 Subject: [PATCH 4/6] fix: Fix timeouts --- rust-nostd-avr/compile.sh | 5 ++++- rust-nostd-esp/Dockerfile | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rust-nostd-avr/compile.sh b/rust-nostd-avr/compile.sh index 695741b..467913c 100755 --- a/rust-nostd-avr/compile.sh +++ b/rust-nostd-avr/compile.sh @@ -30,9 +30,12 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then sed -i 's/^[[:space:]]*name[[:space:]]*=[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']\([[:space:]]*\)$/\nname = "'${PROJECT_NAME}'"/' Cargo.toml fi -rm -rf ${HOME}/.cargo/registry/index/* ${HOME}/.cargo/.package-cache +rm -rf ~/.cargo/.package-cache +echo "cargo clean" cargo clean +echo "cargo audit" cargo audit +echo "cargo build" cargo build --release --out-dir output -Z unstable-options avr-objcopy -R .eeprom -O ihex ./target/${MCU}/release/${PROJECT_NAME}.elf ${HOME}/build-out/project.hex cp ./target/${MCU}/release/${PROJECT_NAME}.elf ${HOME}/build-out/project.elf diff --git a/rust-nostd-esp/Dockerfile b/rust-nostd-esp/Dockerfile index 0fd9748..2bd9334 100644 --- a/rust-nostd-esp/Dockerfile +++ b/rust-nostd-esp/Dockerfile @@ -28,6 +28,8 @@ RUN mkdir -p /home/esp/build-in /home/esp/build-out # Prebuild the template project for all targets, to test the container. # We remove the target directory to reduce the image size. +RUN sudo pkill rls cargo +RUN rm -rf /home/esp/.cargo/registry/index/* /home/esp/.cargo/.package-cache RUN WOKWI_MCU=esp32 ./compile.sh && rm -rf rust-project-esp32/target RUN WOKWI_MCU=esp32-c3 ./compile.sh && rm -rf rust-project-esp32c3/target RUN WOKWI_MCU=esp32-c6 ./compile.sh && rm -rf rust-project-esp32c6/target From 1dd59d41458ea1769c652648d2ca2d341baafd27 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Wed, 18 Oct 2023 13:41:51 +0200 Subject: [PATCH 5/6] fix: Update order --- rust-nostd-avr/compile.sh | 7 +------ rust-nostd-esp/Dockerfile | 2 -- rust-nostd-esp/compile.sh | 4 +--- rust-std-esp/compile.sh | 4 +--- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/rust-nostd-avr/compile.sh b/rust-nostd-avr/compile.sh index 467913c..e2a9618 100755 --- a/rust-nostd-avr/compile.sh +++ b/rust-nostd-avr/compile.sh @@ -30,12 +30,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then sed -i 's/^[[:space:]]*name[[:space:]]*=[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']\([[:space:]]*\)$/\nname = "'${PROJECT_NAME}'"/' Cargo.toml fi -rm -rf ~/.cargo/.package-cache -echo "cargo clean" -cargo clean -echo "cargo audit" -cargo audit -echo "cargo build" cargo build --release --out-dir output -Z unstable-options +cargo audit avr-objcopy -R .eeprom -O ihex ./target/${MCU}/release/${PROJECT_NAME}.elf ${HOME}/build-out/project.hex cp ./target/${MCU}/release/${PROJECT_NAME}.elf ${HOME}/build-out/project.elf diff --git a/rust-nostd-esp/Dockerfile b/rust-nostd-esp/Dockerfile index 2bd9334..0fd9748 100644 --- a/rust-nostd-esp/Dockerfile +++ b/rust-nostd-esp/Dockerfile @@ -28,8 +28,6 @@ RUN mkdir -p /home/esp/build-in /home/esp/build-out # Prebuild the template project for all targets, to test the container. # We remove the target directory to reduce the image size. -RUN sudo pkill rls cargo -RUN rm -rf /home/esp/.cargo/registry/index/* /home/esp/.cargo/.package-cache RUN WOKWI_MCU=esp32 ./compile.sh && rm -rf rust-project-esp32/target RUN WOKWI_MCU=esp32-c3 ./compile.sh && rm -rf rust-project-esp32c3/target RUN WOKWI_MCU=esp32-c6 ./compile.sh && rm -rf rust-project-esp32c6/target diff --git a/rust-nostd-esp/compile.sh b/rust-nostd-esp/compile.sh index 083e006..a77baad 100755 --- a/rust-nostd-esp/compile.sh +++ b/rust-nostd-esp/compile.sh @@ -39,9 +39,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then rnamer -n ${PROJECT_NAME} fi -rm -rf ${HOME}/.cargo/registry/index/* ${HOME}/.cargo/.package-cache -cargo clean -cargo audit cargo build --release --out-dir output -Z unstable-options +cargo audit espflash save-image --chip ${WOKWI_MCU_NO_DASH} --flash-size 4mb ${PROJECT_ROOT}/output/${PROJECT_NAME} ${HOME}/build-out/project.bin cp output/${PROJECT_NAME} ${HOME}/build-out/project.elf diff --git a/rust-std-esp/compile.sh b/rust-std-esp/compile.sh index edcac2f..98fa21b 100755 --- a/rust-std-esp/compile.sh +++ b/rust-std-esp/compile.sh @@ -40,9 +40,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then rnamer -n ${PROJECT_NAME} fi -rm -rf ${HOME}/.cargo/registry/index/* ${HOME}/.cargo/.package-cache -cargo clean -cargo audit cargo build --release --out-dir output -Z unstable-options +cargo audit espflash save-image --chip ${WOKWI_MCU_NO_DASH} --flash-size 4mb ${PROJECT_ROOT}/output/${PROJECT_NAME} ${HOME}/build-out/project.bin cp output/${PROJECT_NAME} ${HOME}/build-out/project.elf From 508250ac6e2cc2e6de52d678a4e23c2bad0e855a Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Wed, 18 Oct 2023 14:26:30 +0200 Subject: [PATCH 6/6] fix: Pin cargo-audit version and revert changes --- rust-nostd-avr/Dockerfile | 2 +- rust-nostd-avr/compile.sh | 2 +- rust-nostd-esp/Dockerfile | 2 +- rust-nostd-esp/compile.sh | 2 +- rust-std-esp/Dockerfile | 2 +- rust-std-esp/compile.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rust-nostd-avr/Dockerfile b/rust-nostd-avr/Dockerfile index db59542..4155a84 100644 --- a/rust-nostd-avr/Dockerfile +++ b/rust-nostd-avr/Dockerfile @@ -29,7 +29,7 @@ RUN cargo --version RUN rustup show # Install extra crates -RUN cargo install cargo-audit cargo-generate +RUN cargo install cargo-audit@0.17.6 cargo-generate # Generate project templates RUN cargo generate -a Rahix/avr-hal-template --name rust-project-uno --vcs none --silent -d board="Arduino Uno" diff --git a/rust-nostd-avr/compile.sh b/rust-nostd-avr/compile.sh index e2a9618..8be60d9 100755 --- a/rust-nostd-avr/compile.sh +++ b/rust-nostd-avr/compile.sh @@ -30,7 +30,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then sed -i 's/^[[:space:]]*name[[:space:]]*=[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']\([[:space:]]*\)$/\nname = "'${PROJECT_NAME}'"/' Cargo.toml fi -cargo build --release --out-dir output -Z unstable-options cargo audit +cargo build --release --out-dir output -Z unstable-options avr-objcopy -R .eeprom -O ihex ./target/${MCU}/release/${PROJECT_NAME}.elf ${HOME}/build-out/project.hex cp ./target/${MCU}/release/${PROJECT_NAME}.elf ${HOME}/build-out/project.elf diff --git a/rust-nostd-esp/Dockerfile b/rust-nostd-esp/Dockerfile index 0fd9748..5045b4d 100644 --- a/rust-nostd-esp/Dockerfile +++ b/rust-nostd-esp/Dockerfile @@ -4,7 +4,7 @@ USER esp ENV USER=esp # Install extra crates -RUN cargo install cargo-audit && \ +RUN cargo install cargo-audit@0.17.6 && \ GENERATE_VERSION=$(git ls-remote --refs --sort="version:refname" --tags "https://github.com/cargo-generate/cargo-generate" | cut -d/ -f3- | tail -n1) && \ curl -L "https://github.com/cargo-generate/cargo-generate/releases/latest/download/cargo-generate-${GENERATE_VERSION}-x86_64-unknown-linux-gnu.tar.gz" -o "${HOME}/.cargo/bin/cargo-generate.tar.gz" && \ tar xf "${HOME}/.cargo/bin/cargo-generate.tar.gz" -C ${HOME}/.cargo/bin && \ diff --git a/rust-nostd-esp/compile.sh b/rust-nostd-esp/compile.sh index a77baad..f434dfd 100755 --- a/rust-nostd-esp/compile.sh +++ b/rust-nostd-esp/compile.sh @@ -39,7 +39,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then rnamer -n ${PROJECT_NAME} fi -cargo build --release --out-dir output -Z unstable-options cargo audit +cargo build --release --out-dir output -Z unstable-options espflash save-image --chip ${WOKWI_MCU_NO_DASH} --flash-size 4mb ${PROJECT_ROOT}/output/${PROJECT_NAME} ${HOME}/build-out/project.bin cp output/${PROJECT_NAME} ${HOME}/build-out/project.elf diff --git a/rust-std-esp/Dockerfile b/rust-std-esp/Dockerfile index 6b92550..ca9ef12 100644 --- a/rust-std-esp/Dockerfile +++ b/rust-std-esp/Dockerfile @@ -4,7 +4,7 @@ USER esp ENV USER=esp # Install extra crates -RUN cargo install cargo-audit && \ +RUN cargo install cargo-audit@0.17.6 && \ GENERATE_VERSION=$(git ls-remote --refs --sort="version:refname" --tags "https://github.com/cargo-generate/cargo-generate" | cut -d/ -f3- | tail -n1) && \ curl -L "https://github.com/cargo-generate/cargo-generate/releases/latest/download/cargo-generate-${GENERATE_VERSION}-x86_64-unknown-linux-gnu.tar.gz" -o "${HOME}/.cargo/bin/cargo-generate.tar.gz" && \ tar xf "${HOME}/.cargo/bin/cargo-generate.tar.gz" -C ${HOME}/.cargo/bin && \ diff --git a/rust-std-esp/compile.sh b/rust-std-esp/compile.sh index 98fa21b..94da5fa 100755 --- a/rust-std-esp/compile.sh +++ b/rust-std-esp/compile.sh @@ -40,7 +40,7 @@ if [ -f ${HOME}/build-in/Cargo.toml ]; then rnamer -n ${PROJECT_NAME} fi -cargo build --release --out-dir output -Z unstable-options cargo audit +cargo build --release --out-dir output -Z unstable-options espflash save-image --chip ${WOKWI_MCU_NO_DASH} --flash-size 4mb ${PROJECT_ROOT}/output/${PROJECT_NAME} ${HOME}/build-out/project.bin cp output/${PROJECT_NAME} ${HOME}/build-out/project.elf