From 5f2ea5dcbdade9d606b64f9a19d1aab394757ca0 Mon Sep 17 00:00:00 2001 From: Juraj Michalek Date: Wed, 4 Aug 2021 15:17:33 +0200 Subject: [PATCH 01/10] docs: update installation instructions for 1.54.0 --- ...tensa-installation-aarch64-apple-darwin.md | 20 +++++++++++------ ...xtensa-installation-x86_64-apple-darwin.md | 20 +++++++++++------ ...a-installation-x86_64-unknown-linux-gnu.md | 22 ++++++++++++------- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md index e6e1edb..29641e4 100644 --- a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md @@ -11,15 +11,21 @@ Tested OS: macOS Big Sur M1 ``` rustup toolchain install nightly -mkdir -p ~/.rustup/toolchains/esp +VERSION="1.54.0-dev" +ARCH="aarch64-apple-darwin" +RUST_DIST="rust-${VERSION}-${ARCH}" +RUST_SRC_DIST="rust-src-${VERSION}" +TOOLCHAIN_DESTINATION_DIR="~/.rustup/toolchains/esp" -wget --continue https://dl.espressif.com/dl/idf-rust/dist/aarch64-apple-darwin/rust-1.53.0-dev-aarch64-apple-darwin.tar.xz -tar xvf rust-1.53.0-dev-aarch64-apple-darwin.tar.xz -./rust-1.53.0-dev-aarch64-apple-darwin/install.sh --destdir=~/.rustup/toolchains/esp --prefix="" --without=rust-docs +mkdir -p ${TOOLCHAIN} -wget --continue https://dl.espressif.com/dl/idf-rust/dist/noarch/rust-src-1.53.0-dev.tar.xz -tar xvf rust-src-1.53.0-dev.tar.xz -./rust-src-1.53.0-dev/install.sh --destdir=~/.rustup/toolchains/esp --prefix="" +wget https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz +tar xvf ${RUST_DIST}.tar.xz +./${RUST_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs + +wget https://dl.espressif.com/dl/idf-rust/dist/noarch/${RUST_SRC_DIST}.tar.xz +tar xvf ${RUST_SRC_DIST}.tar.xz +./${RUST_SRC_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs rustup default esp diff --git a/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md b/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md index 241d3a4..b3b1d71 100644 --- a/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md @@ -11,15 +11,21 @@ Tested OS: macOS Big Sur x64 ``` rustup toolchain install nightly -mkdir -p ~/.rustup/toolchains/esp +VERSION="1.54.0-dev" +ARCH="x86_64-apple-darwin" +RUST_DIST="rust-${VERSION}-${ARCH}" +RUST_SRC_DIST="rust-src-${VERSION}" +TOOLCHAIN_DESTINATION_DIR="~/.rustup/toolchains/esp" -wget https://dl.espressif.com/dl/idf-rust/dist/x86_64-apple-darwin/rust-1.53.0-dev-x86_64-apple-darwin.tar.xz -tar xvf rust-1.53.0-dev-x86_64-apple-darwin.tar.xz -./rust-1.53.0-dev-x86_64-apple-darwin/install.sh --destdir=~/.rustup/toolchains/esp --prefix="" --without=rust-docs +mkdir -p ${TOOLCHAIN} -wget https://dl.espressif.com/dl/idf-rust/dist/noarch/rust-src-1.53.0-dev.tar.xz -tar xvf rust-src-1.53.0-dev.tar.xz -./rust-src-1.53.0-dev/install.sh --destdir=~/.rustup/toolchains/esp --prefix="" --without=rust-docs +wget https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz +tar xvf ${RUST_DIST}.tar.xz +./${RUST_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs + +wget https://dl.espressif.com/dl/idf-rust/dist/noarch/${RUST_SRC_DIST}.tar.xz +tar xvf ${RUST_SRC_DIST}.tar.xz +./${RUST_SRC_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs rustup default esp diff --git a/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md b/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md index a76e4d2..d703677 100644 --- a/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md +++ b/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md @@ -13,19 +13,25 @@ sudo apt install gcc wget xz-utils rustup toolchain install nightly -mkdir -p ~/.rustup/toolchains/esp +VERSION="1.54.0-dev" +ARCH="x86_64-unknown-linux-gnu" +RUST_DIST="rust-${VERSION}-${ARCH}" +RUST_SRC_DIST="rust-src-${VERSION}" +TOOLCHAIN_DESTINATION_DIR="~/.rustup/toolchains/esp" -wget https://dl.espressif.com/dl/idf-rust/dist/x86_64-unknown-linux-gnu/rust-1.53.0-dev-x86_64-unknown-linux-gnu.tar.xz -tar xvf rust-1.53.0-dev-x86_64-unknown-linux-gnu.tar.xz -./rust-1.53.0-dev-x86_64-unknown-linux-gnu/install.sh --destdir=~/.rustup/toolchains/esp --prefix="" --without=rust-docs +mkdir -p ${TOOLCHAIN} -wget https://dl.espressif.com/dl/idf-rust/dist/noarch/rust-src-1.53.0-dev.tar.xz -tar xvf rust-src-1.53.0-dev.tar.xz -./rust-src-1.53.0-dev/install.sh --destdir=~/.rustup/toolchains/esp --prefix="" --without=rust-docs +wget https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz +tar xvf ${RUST_DIST}.tar.xz +./${RUST_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs + +wget https://dl.espressif.com/dl/idf-rust/dist/noarch/${RUST_SRC_DIST}.tar.xz +tar xvf ${RUST_SRC_DIST}.tar.xz +./${RUST_SRC_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs rustup default esp -wget https://dl.espressif.com/dl/idf-rust/dist/x86_64-unknown-linux-gnu/xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-linux-amd64.tar.xz +wget https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-linux-amd64.tar.xz tar xf xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-linux-amd64.tar.xz export PATH="`pwd`/xtensa-esp32-elf-clang/bin/:$PATH" From 1dfbb9753eb4b086456c3e5f4ab1bb2ed3ef47c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Thu, 5 Aug 2021 13:40:45 +0200 Subject: [PATCH 02/10] update Dockerfile and revert aarch64 to 1.53 --- Dockerfile | 25 ++++++++++++------- ...tensa-installation-aarch64-apple-darwin.md | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8e981b8..a4270ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,22 +6,29 @@ ENV LANG=C.UTF-8 ENV RUSTUP_HOME=/opt/rust ENV CARGO_HOME=/opt/cargo ENV PATH=/opt/cargo/bin:/opt/rust/bin:/opt/xtensa-esp32-elf-clang/bin:$PATH + +ARG VERSION="1.54.0-dev" +ARG ARCH="x86_64-unknown-linux-gnu" +ARG RUST_DIST="rust-${VERSION}-${ARCH}" +ARG RUST_SRC_DIST="rust-src-${VERSION}" +ARG TOOLCHAIN_DESTINATION_DIR="/opt/esp" + RUN curl https://sh.rustup.rs -sSf | bash -s -- --profile minimal --default-toolchain nightly -y WORKDIR /opt -RUN wget -q https://dl.espressif.com/dl/idf-rust/dist/x86_64-unknown-linux-gnu/rust-1.53.0-dev-x86_64-unknown-linux-gnu.tar.xz \ - && tar xvf rust-1.53.0-dev-x86_64-unknown-linux-gnu.tar.xz \ - && ./rust-1.53.0-dev-x86_64-unknown-linux-gnu/install.sh --destdir=/opt/esp --prefix="" --without=rust-docs \ - && rm -rf rust-1.53.0-dev-x86_64-unknown-linux-gnu* +RUN wget -q https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz \ + && tar xvf ${RUST_DIST}.tar.xz \ + && ./${RUST_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs \ + && rm -rf ${RUST_DIST} ${RUST_DIST}.tar.xz -RUN wget -q https://dl.espressif.com/dl/idf-rust/dist/noarch/rust-src-1.53.0-dev.tar.xz \ - && tar xvf rust-src-1.53.0-dev.tar.xz \ - && ./rust-src-1.53.0-dev/install.sh --destdir=/opt/esp --prefix="" --without=rust-docs \ - && rm -rf rust-src-1.53.0-dev* \ +RUN wget -q https://dl.espressif.com/dl/idf-rust/dist/noarch/${RUST_SRC_DIST}.tar.xz \ + && tar xvf ${RUST_SRC_DIST}.tar.xz \ + && ./${RUST_SRC_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs \ + && rm -rf ${RUST_SRC_DIST} ${RUST_SRC_DIST}.tar.xz \ && rustup toolchain link esp /opt/esp \ && rustup default esp -RUN wget -q https://dl.espressif.com/dl/idf-rust/dist/x86_64-unknown-linux-gnu/xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-linux-amd64.tar.xz \ +RUN wget -q https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-linux-amd64.tar.xz \ && tar xf xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-linux-amd64.tar.xz \ && rm xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-linux-amd64.tar.xz diff --git a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md index 29641e4..8af6b90 100644 --- a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md @@ -11,7 +11,7 @@ Tested OS: macOS Big Sur M1 ``` rustup toolchain install nightly -VERSION="1.54.0-dev" +VERSION="1.53.0-dev" ARCH="aarch64-apple-darwin" RUST_DIST="rust-${VERSION}-${ARCH}" RUST_SRC_DIST="rust-src-${VERSION}" From c8b0b145e24167fb94b5d249e402d5c5724f26e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Thu, 5 Aug 2021 15:27:41 +0200 Subject: [PATCH 03/10] aarch64 package of Rust 1.54.0 --- ...tensa-installation-aarch64-apple-darwin.md | 2 +- ...nsa-installation-x86_64-pc-windows-msvc.md | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md index 8af6b90..29641e4 100644 --- a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md @@ -11,7 +11,7 @@ Tested OS: macOS Big Sur M1 ``` rustup toolchain install nightly -VERSION="1.53.0-dev" +VERSION="1.54.0-dev" ARCH="aarch64-apple-darwin" RUST_DIST="rust-${VERSION}-${ARCH}" RUST_SRC_DIST="rust-src-${VERSION}" diff --git a/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md b/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md index 9a3c516..1b1cb2f 100644 --- a/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md +++ b/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md @@ -15,28 +15,34 @@ choco install 7zip rustup toolchain install nightly +$Version="1.54.0-dev" +$Arch="x86_64-pc-windows-msvc" +$RustDist="rust-${VERSION}-${ARCH}" +$RustSrcDist="rust-src-${VERSION}" +$ToolchainDestinationDir="~/.rustup/toolchains/esp" + mkdir -p ~\.rustup\toolchains\esp -Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/x86_64-pc-windows-msvc/rust-1.53.0-dev-x86_64-pc-windows-msvc.tar.xz -OutFile rust-1.53.0-dev-x86_64-pc-windows-msvc.tar.xz -7z e .\rust-1.53.0-dev-x86_64-pc-windows-msvc.tar.xz -7z x .\rust-1.53.0-dev-x86_64-pc-windows-msvc.tar -pushd rust-1.53.0-dev-x86_64-pc-windows-msvc +Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/${Arch}/${RustDist}.tar.xz -OutFile ${RustDist}.tar.xz +7z e .\${RustDist}.tar.xz +7z x .\${RustDist}.tar +pushd ${RustDist} cp -Recurse .\rustc\bin ~\.rustup\toolchains\esp\ cp -Recurse .\rustc\lib ~\.rustup\toolchains\esp\ cp -Recurse .\rustc\share ~\.rustup\toolchains\esp\ -cp -ErrorAction SilentlyContinue -Recurse .\rust-std-x86_64-pc-windows-msvc\lib\* ~\.rustup\toolchains\esp\lib\ +cp -ErrorAction SilentlyContinue -Recurse .\rust-std-${Arch}\lib\* ~\.rustup\toolchains\esp\lib\ popd -Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/noarch/rust-src-1.53.0-dev.tar.xz -OutFile rust-src-1.53.0-dev.tar.xz -7z e .\rust-src-1.53.0-dev.tar.xz -7z x .\rust-src-1.53.0-dev.tar -pushd rust-src-1.53.0-dev +Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/noarch/${RustSrcDist}.tar.xz -OutFile ${RustSrcDist} +7z e .\${RustSrcDist}.tar.xz +7z x .\${RustSrcDist}.tar +pushd ${RustSrcDist} cp -ErrorAction SilentlyContinue -Recurse .\rust-src\lib\* ~\.rustup\toolchains\esp\lib\ popd rustup default esp -Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/x86_64-pc-windows-msvc/xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip -OutFile xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip +Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/${Arch}/xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip -OutFile xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip 7z x xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip $ClangPath=Join-Path -Path (Get-Location) -ChildPath xtensa-esp32-elf-clang\bin $env:PATH="${ClangPath};$env:PATH" From c555cbd5da017579d7ec81b6815fd1ae1ed7b2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Thu, 5 Aug 2021 15:35:25 +0200 Subject: [PATCH 04/10] docs: correction in toolchain directory name --- docs/rust-on-xtensa-installation-aarch64-apple-darwin.md | 8 ++++---- docs/rust-on-xtensa-installation-x86_64-apple-darwin.md | 2 +- ...ust-on-xtensa-installation-x86_64-unknown-linux-gnu.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md index 29641e4..5e1b14a 100644 --- a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md @@ -17,19 +17,19 @@ RUST_DIST="rust-${VERSION}-${ARCH}" RUST_SRC_DIST="rust-src-${VERSION}" TOOLCHAIN_DESTINATION_DIR="~/.rustup/toolchains/esp" -mkdir -p ${TOOLCHAIN} +mkdir -p ${TOOLCHAIN_DESTINATION_DIR} -wget https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz +wget "https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz" tar xvf ${RUST_DIST}.tar.xz ./${RUST_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs -wget https://dl.espressif.com/dl/idf-rust/dist/noarch/${RUST_SRC_DIST}.tar.xz +wget "https://dl.espressif.com/dl/idf-rust/dist/noarch/${RUST_SRC_DIST}.tar.xz" tar xvf ${RUST_SRC_DIST}.tar.xz ./${RUST_SRC_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs rustup default esp -wget --continue https://dl.espressif.com/dl/idf-rust/dist/aarch64-apple-darwin/xtensa-esp32-elf-llvm11_0_0-aarch64-apple-darwin.tar.xz +wget --continue "https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/xtensa-esp32-elf-llvm11_0_0-aarch64-apple-darwin.tar.xz" tar xf xtensa-esp32-elf-llvm11_0_0-aarch64-apple-darwin.tar.xz export PATH="`pwd`/xtensa-esp32-elf-clang/bin/:$PATH" diff --git a/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md b/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md index b3b1d71..98d754b 100644 --- a/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md @@ -17,7 +17,7 @@ RUST_DIST="rust-${VERSION}-${ARCH}" RUST_SRC_DIST="rust-src-${VERSION}" TOOLCHAIN_DESTINATION_DIR="~/.rustup/toolchains/esp" -mkdir -p ${TOOLCHAIN} +mkdir -p ${TOOLCHAIN_DESTINATION_DIR} wget https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz tar xvf ${RUST_DIST}.tar.xz diff --git a/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md b/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md index d703677..8b61049 100644 --- a/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md +++ b/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md @@ -19,7 +19,7 @@ RUST_DIST="rust-${VERSION}-${ARCH}" RUST_SRC_DIST="rust-src-${VERSION}" TOOLCHAIN_DESTINATION_DIR="~/.rustup/toolchains/esp" -mkdir -p ${TOOLCHAIN} +mkdir -p ${TOOLCHAIN_DESTINATION_DIR} wget https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz tar xvf ${RUST_DIST}.tar.xz From 986cb6dd367b5c7f1b990083ca6f1413090193b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Thu, 5 Aug 2021 15:41:04 +0200 Subject: [PATCH 05/10] docs: add quotes to avoid curly braces expansion with copy and paste to iTerm --- docs/rust-on-xtensa-installation-x86_64-apple-darwin.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md b/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md index 98d754b..d12dd68 100644 --- a/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md @@ -19,17 +19,17 @@ TOOLCHAIN_DESTINATION_DIR="~/.rustup/toolchains/esp" mkdir -p ${TOOLCHAIN_DESTINATION_DIR} -wget https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz +wget "https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz" tar xvf ${RUST_DIST}.tar.xz ./${RUST_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs -wget https://dl.espressif.com/dl/idf-rust/dist/noarch/${RUST_SRC_DIST}.tar.xz +wget "https://dl.espressif.com/dl/idf-rust/dist/noarch/${RUST_SRC_DIST}.tar.xz" tar xvf ${RUST_SRC_DIST}.tar.xz ./${RUST_SRC_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs rustup default esp -wget https://dl.espressif.com/dl/idf-rust/dist/x86_64-apple-darwin/xtensa-esp32-elf-llvm11_0_0-x86_64-apple-darwin.tar.xz +wget "https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/xtensa-esp32-elf-llvm11_0_0-x86_64-apple-darwin.tar.xz" tar xf xtensa-esp32-elf-llvm11_0_0-x86_64-apple-darwin.tar.xz export PATH="`pwd`/xtensa-esp32-elf-clang/bin/:$PATH" From 05df2fbb34bdbac6212526ad964f10fe8fc18052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Fri, 6 Aug 2021 13:52:47 +0200 Subject: [PATCH 06/10] windows: use single bundle of compiler and src --- ...nsa-installation-x86_64-pc-windows-msvc.md | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md b/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md index 1b1cb2f..fa34179 100644 --- a/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md +++ b/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md @@ -18,34 +18,19 @@ rustup toolchain install nightly $Version="1.54.0-dev" $Arch="x86_64-pc-windows-msvc" $RustDist="rust-${VERSION}-${ARCH}" -$RustSrcDist="rust-src-${VERSION}" -$ToolchainDestinationDir="~/.rustup/toolchains/esp" - -mkdir -p ~\.rustup\toolchains\esp - -Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/${Arch}/${RustDist}.tar.xz -OutFile ${RustDist}.tar.xz -7z e .\${RustDist}.tar.xz -7z x .\${RustDist}.tar -pushd ${RustDist} -cp -Recurse .\rustc\bin ~\.rustup\toolchains\esp\ -cp -Recurse .\rustc\lib ~\.rustup\toolchains\esp\ -cp -Recurse .\rustc\share ~\.rustup\toolchains\esp\ -cp -ErrorAction SilentlyContinue -Recurse .\rust-std-${Arch}\lib\* ~\.rustup\toolchains\esp\lib\ -popd -Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/noarch/${RustSrcDist}.tar.xz -OutFile ${RustSrcDist} -7z e .\${RustSrcDist}.tar.xz -7z x .\${RustSrcDist}.tar -pushd ${RustSrcDist} -cp -ErrorAction SilentlyContinue -Recurse .\rust-src\lib\* ~\.rustup\toolchains\esp\lib\ +mkdir -p ~\.rustup\toolchains\ -ErrorAction SilentlyContinue +pushd ~\.rustup\toolchains\ + +Invoke-WebRequest "https://dl.espressif.com/dl/idf-rust/dist/${Arch}/${RustDist}.zip" -OutFile "${RustDist}.zip" +7z x .\${RustDist}.zip popd rustup default esp Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/${Arch}/xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip -OutFile xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip 7z x xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip -$ClangPath=Join-Path -Path (Get-Location) -ChildPath xtensa-esp32-elf-clang\bin -$env:PATH="${ClangPath};$env:PATH" +$env:LIBCLANG_PATH=Join-Path -Path (Get-Location) -ChildPath xtensa-esp32-elf-clang\bin Invoke-WebRequest https://github.com/espressif/rust-esp32-example/archive/refs/heads/main.zip -OutFile rust-esp32-example.zip 7z x rust-esp32-example.zip From 1c00141132274d7493501335f965beb8df0baec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Fri, 6 Aug 2021 14:36:27 +0200 Subject: [PATCH 07/10] windows: modification of PATH is necessary --- docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md b/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md index fa34179..805460e 100644 --- a/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md +++ b/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md @@ -31,6 +31,7 @@ rustup default esp Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/${Arch}/xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip -OutFile xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip 7z x xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip $env:LIBCLANG_PATH=Join-Path -Path (Get-Location) -ChildPath xtensa-esp32-elf-clang\bin +$env:PATH+=";$env:LIBCLANG_PATH" Invoke-WebRequest https://github.com/espressif/rust-esp32-example/archive/refs/heads/main.zip -OutFile rust-esp32-example.zip 7z x rust-esp32-example.zip From 933fbcb900b6192e54233dd620aaad065a10cbfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Mon, 9 Aug 2021 09:01:06 +0200 Subject: [PATCH 08/10] docs: add instructions for selection of the architecture --- ...tensa-installation-aarch64-apple-darwin.md | 34 ++++++++++++++++-- ...xtensa-installation-x86_64-apple-darwin.md | 35 ++++++++++++++++--- ...nsa-installation-x86_64-pc-windows-msvc.md | 35 +++++++++++++++++-- ...a-installation-x86_64-unknown-linux-gnu.md | 35 +++++++++++++++++-- 4 files changed, 126 insertions(+), 13 deletions(-) diff --git a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md index 5e1b14a..5829fa4 100644 --- a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md @@ -1,14 +1,18 @@ # Rust on Xtensa Installation for macOS M1 +Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture. + +Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../rust-esp32-example#esp32-c3). + Tested OS: macOS Big Sur M1 ## Prerequisites - rustup - https://rustup.rs/ -## Commands +## Installation commands -``` +```sh rustup toolchain install nightly VERSION="1.54.0-dev" @@ -36,6 +40,30 @@ export PATH="`pwd`/xtensa-esp32-elf-clang/bin/:$PATH" wget --continue https://github.com/espressif/rust-esp32-example/archive/refs/heads/main.zip unzip main.zip cd rust-esp32-example-main -idf.py build ``` +## Select architecture for the build + +For the ESP32 - default (Xtensa architecture): + +```sh +idf.py set-target esp32 +``` + +For the ESP32-S2 (Xtensa architecture): + +```sh +idf.py set-target esp32s2 +``` + +For the ESP32-S3 (Xtensa architecture): + +```sh +idf.py set-target esp32s3 +``` + +## Build and flash + +```sh +idf.py build flash +``` diff --git a/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md b/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md index d12dd68..60d55fd 100644 --- a/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md @@ -1,14 +1,17 @@ # Rust on Xtensa Installation for macOS x64 -Tested OS: macOS Big Sur x64 +Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture. + +Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../rust-esp32-example#esp32-c3). +Tested OS: macOS Big Sur x64 ## Prerequisites - rustup - installed with nightly toolchain - https://rustup.rs/ -## Commands +## Installation commands -``` +```sh rustup toolchain install nightly VERSION="1.54.0-dev" @@ -36,6 +39,30 @@ export PATH="`pwd`/xtensa-esp32-elf-clang/bin/:$PATH" wget --continue https://github.com/espressif/rust-esp32-example/archive/refs/heads/main.zip unzip main.zip cd rust-esp32-example-main -idf.py build ``` +## Select architecture for the build + +For the ESP32 - default (Xtensa architecture): + +```sh +idf.py set-target esp32 +``` + +For the ESP32-S2 (Xtensa architecture): + +```sh +idf.py set-target esp32s2 +``` + +For the ESP32-S3 (Xtensa architecture): + +```sh +idf.py set-target esp32s3 +``` + +## Build and flash + +```sh +idf.py build flash +``` diff --git a/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md b/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md index 805460e..a61d363 100644 --- a/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md +++ b/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md @@ -1,5 +1,9 @@ # Rust on Xtensa Installation for Windows x64 +Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture. + +Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../rust-esp32-example#esp32-c3). + Tested OS: Windows 10 x64 ## Prerequisites @@ -8,9 +12,9 @@ Tested OS: Windows 10 x64 - rustup - installed with nightly toolchain - https://rustup.rs/ - Chocolatey - https://chocolatey.org/ -## Commands for PowerShell +## Installation commands for PowerShell -``` +```sh choco install 7zip rustup toolchain install nightly @@ -36,5 +40,30 @@ $env:PATH+=";$env:LIBCLANG_PATH" Invoke-WebRequest https://github.com/espressif/rust-esp32-example/archive/refs/heads/main.zip -OutFile rust-esp32-example.zip 7z x rust-esp32-example.zip cd rust-esp32-example-main -idf.py build +``` + +## Select architecture for the build + +For the ESP32 - default (Xtensa architecture): + +```sh +idf.py set-target esp32 +``` + +For the ESP32-S2 (Xtensa architecture): + +```sh +idf.py set-target esp32s2 +``` + +For the ESP32-S3 (Xtensa architecture): + +```sh +idf.py set-target esp32s3 +``` + +## Build and flash + +```sh +idf.py build flash ``` diff --git a/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md b/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md index 8b61049..ae7e54e 100644 --- a/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md +++ b/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md @@ -1,14 +1,18 @@ # Rust on Xtensa Installation for Linux x64 +Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture. + +Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../rust-esp32-example#esp32-c3). + Tested OS: Ubuntu 18 x64, Ubuntu 20 x64, Mint 20 x64, OpenSUSE Thumbleweed ## Prerequisites - rustup - installed with nightly toolchain - https://rustup.rs/ -## Commands +## Installation commands -``` +```sh sudo apt install gcc wget xz-utils rustup toolchain install nightly @@ -38,5 +42,30 @@ export PATH="`pwd`/xtensa-esp32-elf-clang/bin/:$PATH" wget --continue https://github.com/espressif/rust-esp32-example/archive/refs/heads/main.zip unzip main.zip cd rust-esp32-example-main -idf.py build +``` + +## Select architecture for the build + +For the ESP32 - default (Xtensa architecture): + +```sh +idf.py set-target esp32 +``` + +For the ESP32-S2 (Xtensa architecture): + +```sh +idf.py set-target esp32s2 +``` + +For the ESP32-S3 (Xtensa architecture): + +```sh +idf.py set-target esp32s3 +``` + +## Build and flash + +```sh +idf.py build flash ``` From 7e90321880aee165abd1772d3697db5e43cfce90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Mon, 9 Aug 2021 09:05:02 +0200 Subject: [PATCH 09/10] docs: fix reference to parent document --- docs/rust-on-xtensa-installation-aarch64-apple-darwin.md | 2 +- docs/rust-on-xtensa-installation-x86_64-apple-darwin.md | 2 +- docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md | 2 +- .../rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md | 2 +- docs/rust-on-xtensa.md | 6 +++++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md index 5829fa4..e553beb 100644 --- a/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-aarch64-apple-darwin.md @@ -2,7 +2,7 @@ Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture. -Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../rust-esp32-example#esp32-c3). +Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../README.md#esp32-c3). Tested OS: macOS Big Sur M1 diff --git a/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md b/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md index 60d55fd..36880e4 100644 --- a/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md +++ b/docs/rust-on-xtensa-installation-x86_64-apple-darwin.md @@ -2,7 +2,7 @@ Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture. -Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../rust-esp32-example#esp32-c3). +Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../README.md#esp32-c3). Tested OS: macOS Big Sur x64 ## Prerequisites diff --git a/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md b/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md index a61d363..05db651 100644 --- a/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md +++ b/docs/rust-on-xtensa-installation-x86_64-pc-windows-msvc.md @@ -2,7 +2,7 @@ Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture. -Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../rust-esp32-example#esp32-c3). +Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../README.md#esp32-c3). Tested OS: Windows 10 x64 diff --git a/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md b/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md index ae7e54e..a960bce 100644 --- a/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md +++ b/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md @@ -2,7 +2,7 @@ Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture. -Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../rust-esp32-example#esp32-c3). +Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../README.md#esp32-c3). Tested OS: Ubuntu 18 x64, Ubuntu 20 x64, Mint 20 x64, OpenSUSE Thumbleweed diff --git a/docs/rust-on-xtensa.md b/docs/rust-on-xtensa.md index 87e2bcf..acacfc0 100644 --- a/docs/rust-on-xtensa.md +++ b/docs/rust-on-xtensa.md @@ -1,4 +1,8 @@ -# Rust on ESP32 (Xtensa) +# Rust on ESP32 and ESP32-S series (Xtensa) + +Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture. + +Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../README.md#esp32-c3). ## Quick start From 315d5e3fd5fdd954c9a51c16e1af0e6b282ab75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Mon, 9 Aug 2021 12:09:50 +0200 Subject: [PATCH 10/10] docker: publish idf-rust image under Espressif account --- .github/workflows/publish-esp-idf-rust-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-esp-idf-rust-image.yml b/.github/workflows/publish-esp-idf-rust-image.yml index 1e1f63a..a626555 100644 --- a/.github/workflows/publish-esp-idf-rust-image.yml +++ b/.github/workflows/publish-esp-idf-rust-image.yml @@ -19,4 +19,4 @@ jobs: with: context: . push: true - tags: georgikrocks/esp-idf-rust:latest + tags: espressif/idf-rust:latest