Skip to content

Commit

Permalink
feat: Remove bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Jan 4, 2024
1 parent f5d8a16 commit dd3d426
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 842 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/upload-installer.yaml

This file was deleted.

122 changes: 13 additions & 109 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,28 @@ If you want to know more about the Rust ecosystem on ESP targets, see [The Rust

## Table of Contents

- [rust-build](#rust-build)
- [Table of Contents](#table-of-contents)
- [Xtensa Installation](#xtensa-installation)
- [Xtensa Installation](#xtensa-installation)
- [`espup` installation](#espup-installation)
- [Download installer in Bash](#download-installer-in-bash)
- [Linux and macOS](#linux-and-macos)
- [Prerequisites](#prerequisites)
- [Installation commands](#installation-commands)
- [Set up the environment variables](#set-up-the-environment-variables)
- [Arguments](#arguments)
- [Windows Long path limitation](#windows-long-path-limitation)
- [Windows x86\_64 MSVC](#windows-x86_64-msvc)
- [Prerequisites x86\_64 MSVC](#prerequisites-x86_64-msvc)
- [Windows x86\_64 GNU](#windows-x86_64-gnu)
- [Prerequisites x86\_64 GNU](#prerequisites-x86_64-gnu)
- [Long path limitation](#long-path-limitation)
- [RISC-V Installation](#risc-v-installation)
- [Building projects](#building-projects)
- [Cargo first approach](#cargo-first-approach)
- [Idf first approach](#idf-first-approach)
- [Using Containers](#using-containers)
- [Using Dev Containers](#using-dev-containers)
- [RISC-V Installation](#risc-v-installation)
- [Building projects](#building-projects)
- [Cargo first approach](#cargo-first-approach)
- [Idf first approach](#idf-first-approach)
- [Using Containers](#using-containers)
- [Using Dev Containers](#using-dev-containers)
- [Release process](#release-process)
- [Building release](#building-release)
- [Finalization of release (about 2-3 days later)](#finalization-of-release-about-2-3-days-later)
- [Rollback release](#rollback-release)
- [Uploading new image tags to espressif/idf-rust](#uploading-new-image-tags-to-espressifidf-rust)

## Xtensa Installation

Deployment is done using [`espup`](https://github.com/esp-rs/espup#installation)
## `espup` installation
### `espup` installation
```sh
cargo install espup
espup install # To install Espressif Rust ecosystem
Expand Down Expand Up @@ -89,89 +84,6 @@ Or, downloading the pre-compiled release binaries:

> For Windows MSVC/GNU, Rust environment can also be installed with Universal Online idf-installer: https://dl.espressif.com/dl/esp-idf/

#### Download installer in Bash

**Deprecated method**

```bash
curl -LO https://github.com/esp-rs/rust-build/releases/download/v1.75.0.0/install-rust-toolchain.sh
chmod a+x install-rust-toolchain.sh
```

### Linux and macOS

The following instructions are specific for the ESP32 and ESP32-S series based on Xtensa architecture.

Instructions for ESP-C series based on RISC-V architecture are described in [RISC-V section](#risc-v-installation).

#### Prerequisites

- Linux:
- [Dependencies (command for Ubuntu/Debian)](https://github.com/esp-rs/esp-idf-template/blob/master/cargo/.devcontainer/Dockerfile#L16):
```sh
apt-get install -y git curl gcc clang ninja-build cmake libudev-dev unzip xz-utils \
python3 python3-pip python3-venv libusb-1.0-0 libssl-dev pkg-config libpython2.7
```

No prerequisites are needed for macOS.

#### Installation commands

```sh
git clone https://github.com/esp-rs/rust-build.git
cd rust-build
./install-rust-toolchain.sh
. ./export-esp.sh
```

Run `./install-rust-toolchain.sh --help` for more information about arguments.

Installation of different version of the toolchain:

```
./install-rust-toolchain.sh --toolchain-version 1.75.0.0
. ./export-esp.sh
```
#### Set up the environment variables
We need to update environment variables as some of the installed tools are not
yet added to the PATH environment variable, we also need to add LIBCLANG_PATH
environment variable to avoid conflicts with the system Clang. The environment
variables that we need to update are shown at the end of the install script and
stored in an export file. By default this export file is `export-esp.sh` but can
be modified with the `-f|--export-file` argument.
We must set the environment variables in every terminal session.
> **Note**
> If the export variables are added to the shell startup script, the shell may need to be refreshed.
#### Arguments
- `-b|--build-target`: Comma separated list of targets \[`esp32,esp32s2,esp32s3,esp32c3,all`]. Defaults to: `esp32,esp32s2,esp32s3`
- `-c|--cargo-home`: Cargo path.
- `-d|--toolchain-destination`: Toolchain installation folder. Defaults to: `<rustup_home>/toolchains/esp`
- `-e|--extra-crates`: Extra crates to install. Defaults to: `ldproxy cargo-espflash`
- `-f|--export-file`: Destination of the export file generated. Defaults to: `export-esp.sh`
- `-i|--installation-mode`: Installation mode: \[`install, reinstall, uninstall`]. Defaults to: `install`
- `-k|--minified-llvm`: Use minified LLVM. Possible values: \[`YES, NO`]. Defaults to: `YES`
- `-l|--llvm-version`: LLVM version.
- `-m|--minified-esp-idf`: \[Only applies if using `-s|--esp-idf-version`]. Deletes some idf folders to save space. Possible values \[`YES, NO`]. Defaults to: `NO`
- `-n|--nightly-version`: Nightly Rust toolchain version. Defaults to: `nightly`
- `-r|--rustup-home`: Path to .rustup. Defaults to: `~/.rustup`
- `-s|--esp-idf-version`: [ESP-IDF branch](https://github.com/espressif/esp-idf/branches) to install. When empty, no esp-idf is installed. Default: `""`
- `-t|--toolchain-version`: Xtensa Rust toolchain version
- `-x|--clear-cache`: Removes cached distribution files. Possible values: \[`YES, NO`]. Defaults to: `YES`
#### Windows Long path limitation
Several build tools have problem with long paths on Windows including Git and CMake. We recommend to put project on short path or use command `subst` to map the directory with the project to separate disk letter.
```
subst "R:" "rust-project"
```
### Windows x86_64 MSVC

The following instructions are specific for the ESP32 and ESP32-S series based on Xtensa architecture. If you do not have Visual Studio and Windows 10 SDK installed, consider the alternative option [Windows x86_64 GNU](#windows-x86_64-gnu).
Expand Down Expand Up @@ -237,14 +149,6 @@ Invoke-WebRequest 'https://github.com/esp-rs/espup/releases/latest/download/espu
.\espup.exe install
```

#### Long path limitation

Several build tools have problem with long paths on Windows including Git and CMake. We recommend to put project on short path or use command `subst` to map the directory with the project to separate disk letter.

```
subst "R:" "rust-project"
```

## RISC-V Installation

The following instructions are specific for ESP32-C based on RISC-V architecture.
Expand Down
2 changes: 1 addition & 1 deletion build-template-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ chmod u+x ${HOME}/.cargo/bin/cargo-generate
export USER=esp
source /home/esp/export-esp.sh

# Build esp-idf-template (release/v4.4)
# Build esp-idf-template
cargo generate esp-rs/esp-idf-template cargo --name test-std-$1 --vcs none --silent -d mcu=$1 -d advanced=false
cd test-std-$1
cargo build
Expand Down
Loading

0 comments on commit dd3d426

Please sign in to comment.