From fc7d7026e9971c06e5eac87ee46a458a657385cc Mon Sep 17 00:00:00 2001 From: Juraj Michalek Date: Tue, 12 Oct 2021 15:34:53 +0200 Subject: [PATCH] container: build of container and rust moved to esp-rs/rust-build --- .../publish-idf-rust-examples-image.yml | 22 -------- .github/workflows/publish-idf-rust-image.yml | 22 -------- support/README.md | 19 ------- support/esptool/Flash-Chip.ps1 | 16 ------ support/idf-rust-examples/entrypoint.sh | 7 --- support/idf-rust-examples/motd | 20 ------- support/idf-rust/Dockerfile | 33 ----------- support/llvm-project/Dockerfile | 11 ---- .../caches/DistributionEspressif-stage2.cmake | 37 ------------- .../cmake/caches/DistributionEspressif.cmake | 55 ------------------- support/rust/Dockerfile | 10 ---- 11 files changed, 252 deletions(-) delete mode 100644 .github/workflows/publish-idf-rust-examples-image.yml delete mode 100644 .github/workflows/publish-idf-rust-image.yml delete mode 100644 support/README.md delete mode 100644 support/esptool/Flash-Chip.ps1 delete mode 100755 support/idf-rust-examples/entrypoint.sh delete mode 100644 support/idf-rust-examples/motd delete mode 100644 support/idf-rust/Dockerfile delete mode 100644 support/llvm-project/Dockerfile delete mode 100644 support/llvm-project/cmake/caches/DistributionEspressif-stage2.cmake delete mode 100644 support/llvm-project/cmake/caches/DistributionEspressif.cmake delete mode 100644 support/rust/Dockerfile diff --git a/.github/workflows/publish-idf-rust-examples-image.yml b/.github/workflows/publish-idf-rust-examples-image.yml deleted file mode 100644 index 474f95c..0000000 --- a/.github/workflows/publish-idf-rust-examples-image.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Publish idf-rust-examples image on DockerHub - -on: workflow_dispatch - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v2 - - name: Log in to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - name: Push to Docker Hub - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: espressif/idf-rust-examples:latest diff --git a/.github/workflows/publish-idf-rust-image.yml b/.github/workflows/publish-idf-rust-image.yml deleted file mode 100644 index 8b3fa9f..0000000 --- a/.github/workflows/publish-idf-rust-image.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Publish idf-rust image on DockerHub - -on: workflow_dispatch - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v2 - - name: Log in to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - name: Push to Docker Hub - uses: docker/build-push-action@v2 - with: - context: support/idf-rust - push: true - tags: espressif/idf-rust:latest diff --git a/support/README.md b/support/README.md deleted file mode 100644 index c9ab6e9..0000000 --- a/support/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Support files - -## Rust - -The directory `rust` contains Dockerfile to build custom version of rust compiler with enabled Xtensa support. - -### Usage - -Building and starting container: -``` -cd support/rust -docker build -t rust-xtensa:bionic -f Dockerfile . -docker run --rm --name rust-xtensa -it rust-xtensa:bionic /bin/bash -``` - -Copy Rust dist file from running container: -``` -docker cp rust-xtensa /opt/rust/build/dist/rust-dev-1.50.0-dev-x86_64-unknown-linux-gnu.tar.xz rust-1.50.0-dev-x86_64-unknown-linux-gnu-bionic.tar.xz -``` diff --git a/support/esptool/Flash-Chip.ps1 b/support/esptool/Flash-Chip.ps1 deleted file mode 100644 index 782c911..0000000 --- a/support/esptool/Flash-Chip.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -$Command = "esptool.exe" -if (Test-Path -Path ".\esptool-v3.1-win64\esptool-v3.1-win64\esptool.exe" -PathType Leaf) { - $Command = ".\esptool-v3.1-win64\esptool-v3.1-win64\esptool.exe" -} -$OldPreference = $ErrorActionPreference -$ErrorActionPreference = 'stop' -try {if(Get-Command $Command){"$Command exists"}} -Catch { - "$Command not found. Downloading" - Invoke-WebRequest https://github.com/espressif/esptool/releases/download/v3.1/esptool-v3.1-win64.zip -OutFile esptool-v3.1-win64.zip - Expand-Archive -Path esptool-v3.1-win64.zip - $Command = ".\esptool-v3.1-win64\esptool-v3.1-win64\esptool.exe" - $ErrorActionPreference=$OldPreference -} - -&$Command -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 bootloader.bin 0x8000 partition-table.bin 0x10000 esp32-hello-rust.bin diff --git a/support/idf-rust-examples/entrypoint.sh b/support/idf-rust-examples/entrypoint.sh deleted file mode 100755 index 025ec90..0000000 --- a/support/idf-rust-examples/entrypoint.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -set -e - -. $IDF_PATH/export.sh -cat /etc/motd - -exec "$@" diff --git a/support/idf-rust-examples/motd b/support/idf-rust-examples/motd deleted file mode 100644 index a39dcde..0000000 --- a/support/idf-rust-examples/motd +++ /dev/null @@ -1,20 +0,0 @@ -============================================================================== -= Docker image with ESP-IDF, Rust compiler and examples = -= https://github.com/espressif/rust-esp32-example = -============================================================================== - -Available examples: - -* "cargo-first" approach - ```sh - cd /opt/rust-esp32-std-hello - cargo build --release - espflash /dev/ttyUSB0 target/xtensa-esp32-espidf/release/rust-esp32-std-hello - cargo pio espidf monitor -e release /dev/ttyUSB0 - ``` - -* "idf.py-first" approach - integration via CMake files - ```sh - cd /opt/rust-esp32-example - idf.py build - ``` diff --git a/support/idf-rust/Dockerfile b/support/idf-rust/Dockerfile deleted file mode 100644 index 3486fd1..0000000 --- a/support/idf-rust/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM espressif/idf -ENV LC_ALL=C.UTF-8 -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/${ARCH}/${RUST_DIST}.tar.xz \ -RUN wget -q https://github.com/georgik/idf-rust-build/releases/download/v${VERSION}/${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_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/${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/support/llvm-project/Dockerfile b/support/llvm-project/Dockerfile deleted file mode 100644 index 7560f1f..0000000 --- a/support/llvm-project/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:bionic -WORKDIR /opt -RUN apt update \ - && apt install -y gcc cmake ccache ninja-build git python3 curl g++ pkg-config libssl-dev - -RUN git clone https://github.com/espressif/llvm-project.git -ADD cmake/caches /opt/cmake/caches -RUN mkdir -p llvm-project/build \ - && cd llvm-project/build \ - && cmake -C /opt/cmake/caches/DistributionEspressif.cmake ../llvm -G "Ninja" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="Xtensa" -DCMAKE_BUILD_TYPE=Release \ - && ninja stage2-distribution || echo "Build failed - silencing error to persist current build artifacts" diff --git a/support/llvm-project/cmake/caches/DistributionEspressif-stage2.cmake b/support/llvm-project/cmake/caches/DistributionEspressif-stage2.cmake deleted file mode 100644 index e08b36d..0000000 --- a/support/llvm-project/cmake/caches/DistributionEspressif-stage2.cmake +++ /dev/null @@ -1,37 +0,0 @@ -# This file sets up a CMakeCache for the second stage of a simple distribution -# bootstrap build. - -#set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "") -set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "") -set(LLVM_ENABLE_RUNTIMES "" CACHE STRING "") -#set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "") -#set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "") - -set(LLVM_TARGETS_TO_BUILD X86;AArch64 CACHE STRING "") -#set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64 CACHE STRING "") - -set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "") -set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") - -# setup toolchain -set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "") -set(LLVM_TOOLCHAIN_TOOLS - #dsymutil - #llvm-cov - #llvm-dwarfdump - #llvm-profdata - #llvm-objdump - #llvm-nm - #llvm-size - CACHE STRING "") - -set(LLVM_DISTRIBUTION_COMPONENTS - clang - #LTO - #clang-format - #clang-resource-headers - #builtins - #runtimes - ${LLVM_TOOLCHAIN_TOOLS} - CACHE STRING "") \ No newline at end of file diff --git a/support/llvm-project/cmake/caches/DistributionEspressif.cmake b/support/llvm-project/cmake/caches/DistributionEspressif.cmake deleted file mode 100644 index 4b42de5..0000000 --- a/support/llvm-project/cmake/caches/DistributionEspressif.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# This file sets up a CMakeCache for a simple distribution bootstrap build. - -#Enable LLVM projects and runtimes -#set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "") -set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "") -set(LLVM_ENABLE_RUNTIMES "compiler-rt" CACHE STRING "") -#set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "") -#set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "") - -# Only build the native target in stage1 since it is a throwaway build. -set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "") - -# Optimize the stage1 compiler, but don't LTO it because that wastes time. -set(CMAKE_BUILD_TYPE Release CACHE STRING "") - -# Setup vendor-specific settings. -set(PACKAGE_VENDOR LLVM.org CACHE STRING "") - -# Setting up the stage2 LTO option needs to be done on the stage1 build so that -# the proper LTO library dependencies can be connected. -set(BOOTSTRAP_LLVM_ENABLE_LTO OFF CACHE BOOL "") -#set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "") - -if (NOT APPLE) - # Since LLVM_ENABLE_LTO is ON we need a LTO capable linker - #set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "") - set(BOOTSTRAP_LLVM_ENABLE_LLD OFF CACHE BOOL "") -endif() - -# Expose stage2 targets through the stage1 build configuration. -set(CLANG_BOOTSTRAP_TARGETS - check-all - check-llvm - check-clang - llvm-config - test-suite - test-depends - llvm-test-depends - clang-test-depends - distribution - install-distribution - clang CACHE STRING "") - -# Setup the bootstrap build. -set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") - -if(STAGE2_CACHE_FILE) - set(CLANG_BOOTSTRAP_CMAKE_ARGS - -C ${STAGE2_CACHE_FILE} - CACHE STRING "") -else() - set(CLANG_BOOTSTRAP_CMAKE_ARGS - -C ${CMAKE_CURRENT_LIST_DIR}/DistributionEspressif-stage2.cmake - CACHE STRING "") -endif() diff --git a/support/rust/Dockerfile b/support/rust/Dockerfile deleted file mode 100644 index f1665d9..0000000 --- a/support/rust/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ubuntu:bionic -WORKDIR /opt -RUN apt update \ - && apt install -y gcc cmake ccache ninja-build git python3 curl g++ pkg-config libssl-dev - -RUN git clone https://github.com/esp-rs/rust.git \ - && cd rust \ - && ./configure --experimental-targets=Xtensa --enable-extended --tools=rustfmt \ - && python3 x.py dist --stage 2 || echo "Build failed - silencing error to persist current build artifacts" -