Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,117 +13,142 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

### Removed
- Add XDG path support (#489)

### Removed

## [0.14.1] - 2025-03-04

### Added

- Add support for LLVM esp-19.1.2_20250225 (#477, #479)

### Fixed

- Return an error if GET request fails (#471)
- Fix RISC-V installation error (#480)

## [0.14.0] - 2024-12-17

### Added

- Smoother large file download&proxy support (#463)
- Add GitHub API errors to clarify what failed (#464)

### Fixed

- When queriying GitHub for the list of releases, retrieve more items (#462)

### Changed

- `espup` now prints why an install step failed (#461)

## [0.13.0] - 2024-10-30

### Changed

- Update GCC version to 14.2.0 (#442)
- Update LLVM version to esp-18.1.2_20240912 (#452)

## [0.12.2] - 2024-07-18

### Fixed

- Fix extended LLVM mode regression for LLVM versions < 17 introduced by #432. (#437)

## [0.12.1] - 2024-07-15

### Fixed

- Make both `libclang.so` available again when installing the extended LLVM for LLVM versions >= 17 (#432)

## [0.12.0] - 2024-06-12

### Added

- Added support for SOCKS5 proxy (#423)

### Changed

- Update LLVM version to `esp-17.0.1_20240419` (#427)
- Update dependencies (#429)

## [0.11.0] - 2024-02-02

### Added

- Added support for specifying the location of the export file via `ESPUP_EXPORT_FILE` (#403)
- Added support for ESP32-P4 (#408)

### Fixed

- [Windows]: Avoid duplicating system environment variables into user environment variables (#411)

## [0.10.0]

### Fixed

- `skip-version-parse` argument should require `toolchain-version` (#396)
- If there is a minified LLVM installation, `--extended-llvm` now installs the full LLVM (#400)

### Changed

- Update LLVM version to `esp-16.0.4-20231113` (#398)

## [0.9.0] - 2023-11-10

### Added

- Added new `--esp-riscv-gcc` flag to install esp-riscv-gcc toolchain instead of the system one (#391)

### Changed

- New Default behavior: install esp-riscv-gcc only if the user explicitly uses the `--esp-riscv-gcc` flag (#391)

## [0.8.0] - 2023-11-02

### Added

- Add symlink to LLVM in Unix systems (#380)

### Changed

- Reduce logs verbosity, add docstrings, and use async methods (#384)
- Change how Windows environment is configured (#389)

## [0.7.0] - 2023-10-18

### Changed

- Update GCC version to 13.2 (#373)
- Update logging format and log messages (#375, #376)

## [0.6.1] - 2023-10-04

### Changed

- Remove unnecessary CI jobs (#369)

### Fixed

- Create $RUSTUP_HOME/tmp if needed (#365)
- Complete Xtensa Rust versions when provided one is incomplete (#366)

## [0.6.0] - 2023-10-02

### Added

- Add a flag to skip Xtensa Rust version parsing (#352)
- Add warn message when failed to detect Xtensa Rust (#357)

### Changed

- Update dependencies
- Use `RUSTUP_HOME` tmp folder (#348)
- Improve `remove_dir_all` errors (#346)

### Fixed

- Fix temorary folders/files cleanup (#344)
- Fix Clippy lint (#335)

Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
[![Security audit](https://github.com/esp-rs/espup/actions/workflows/audit.yaml/badge.svg)](https://github.com/esp-rs/espup/actions/workflows/audit.yaml)
[![Matrix](https://img.shields.io/matrix/esp-rs:matrix.org?label=join%20matrix&color=BEC5C9&labelColor=1C2C2E&logo=matrix&style=flat-square)](https://matrix.to/#/#esp-rs:matrix.org)


> `rustup` for [esp-rs](https://github.com/esp-rs/)

`espup` is a tool for installing and maintaining the required toolchains for developing applications in Rust for Espressif SoC's.
Expand All @@ -18,6 +17,7 @@ To better understand what `espup` installs, see [the installation chapter of `Th
Before running or installing `espup`, make sure that [`rustup`](https://rustup.rs/) is installed.

Linux systems also require the following packages:

- Ubuntu/Debian
```sh
sudo apt-get install -y gcc build-essential curl pkg-config
Expand Down Expand Up @@ -78,7 +78,7 @@ See [Usage](#usage) section for more details.
```sh
espup install
# Unix
. $HOME/export-esp.sh
. $XDG_DATA_HOME/export-esp.sh
# Windows does not require sourcing any file
```

Expand All @@ -101,6 +101,7 @@ Options:
-h, --help Print help
-V, --version Print version
```

### Completions Subcommand

For detailed instructions on how to enable tab completion, see [Enable tab completion for Bash, Fish, Zsh, or PowerShell](#enable-tab-completion-for-bash-fish-zsh-or-powershell) section.
Expand All @@ -119,12 +120,16 @@ Options:
### Install Subcommand

> [!NOTE]
>
> #### Xtensa Rust destination path
> Installation paths can be modified by setting the environment variables [`CARGO_HOME`](https://doc.rust-lang.org/cargo/reference/environment-variables.html) and [`RUSTUP_HOME`](https://rust-lang.github.io/rustup/environment-variables.html) before running the `install` command. By default, toolchains will be installed under `<rustup_home>/toolchains/esp`, although this can be changed using the `-a/--name` option.
>
> Installation paths can be modified by setting the environment variables [`CARGO_HOME`](https://doc.rust-lang.org/cargo/reference/environment-variables.html) and [`RUSTUP_HOME`](https://rust-lang.github.io/rustup/environment-variables.html) before running the `install` command. By default, toolchains will be installed under `<rustup_home>/toolchains/esp`, although this can be changed using the `-a/--name` option.

> [!NOTE]
>
> #### GitHub API
> During the installation process, several GitHub queries are made, [which are subject to certain limits](https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting). Our number of queries should not hit the limit unless you are running `espup install` command numerous times in a short span of time. We recommend setting the [`GITHUB_TOKEN` environment variable](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret) when using `espup` in CI, if you want to use `espup` on CI, recommend using it via the [`xtensa-toolchain` action](https://github.com/esp-rs/xtensa-toolchain/), and making sure `GITHUB_TOKEN` is not set when using it on a host machine. See https://github.com/esp-rs/xtensa-toolchain/issues/15 for more details on this.
>
> During the installation process, several GitHub queries are made, [which are subject to certain limits](https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting). Our number of queries should not hit the limit unless you are running `espup install` command numerous times in a short span of time. We recommend setting the [`GITHUB_TOKEN` environment variable](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret) when using `espup` in CI, if you want to use `espup` on CI, recommend using it via the [`xtensa-toolchain` action](https://github.com/esp-rs/xtensa-toolchain/), and making sure `GITHUB_TOKEN` is not set when using it on a host machine. See https://github.com/esp-rs/xtensa-toolchain/issues/15 for more details on this.

```
Usage: espup install [OPTIONS]
Expand All @@ -141,7 +146,7 @@ Options:
Only install this if you don't want to use the systems RISC-V toolchain

-f, --export-file <EXPORT_FILE>
Relative or full path for the export file that will be generated. If no path is provided, the file will be generated under home directory (https://docs.rs/dirs/latest/dirs/fn.home_dir.html)
Relative or full path for the export file that will be generated. If no path is provided, the file will be generated under the data directory (https://docs.rs/dirs/latest/dirs/fn.data_dir.html)

[env: ESPUP_EXPORT_FILE=]

Expand Down Expand Up @@ -209,7 +214,7 @@ Options:
[possible values: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-pc-windows-msvc, x86_64-pc-windows-gnu, x86_64-apple-darwin, aarch64-apple-darwin]

-f, --export-file <EXPORT_FILE>
Relative or full path for the export file that will be generated. If no path is provided, the file will be generated under home directory (https://docs.rs/dirs/latest/dirs/fn.home_dir.html)
Relative or full path for the export file that will be generated. If no path is provided, the file will be generated under the data directory (https://docs.rs/dirs/latest/dirs/fn.data_dir.html)

[env: ESPUP_EXPORT_FILE=]

Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct InstallOpts {
/// Only install this if you don't want to use the systems RISC-V toolchain
#[arg(short = 'r', long)]
pub esp_riscv_gcc: bool,
/// Relative or full path for the export file that will be generated. If no path is provided, the file will be generated under home directory (https://docs.rs/dirs/latest/dirs/fn.home_dir.html).
/// Relative or full path for the export file that will be generated. If no path is provided, the file will be generated under the data directory (https://docs.rs/dirs/latest/dirs/fn.data_dir.html).
#[arg(short = 'f', long, env = "ESPUP_EXPORT_FILE")]
pub export_file: Option<PathBuf>,
/// Extends the LLVM installation.
Expand Down
9 changes: 5 additions & 4 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ pub fn get_export_file(export_file: Option<PathBuf>) -> Result<PathBuf, Error> {
} else {
Ok(BaseDirs::new()
.unwrap()
.home_dir()
.data_dir()
.join("espup")
.join(DEFAULT_EXPORT_FILE))
}
}
Expand Down Expand Up @@ -195,8 +196,8 @@ mod tests {
#[allow(unused_variables)]
fn test_get_export_file() {
// No arg provided
let home_dir = BaseDirs::new().unwrap().home_dir().to_path_buf();
let export_file = home_dir.join(DEFAULT_EXPORT_FILE);
let data_dir = BaseDirs::new().unwrap().data_dir().join("espup");
let export_file = data_dir.join(DEFAULT_EXPORT_FILE);
assert!(matches!(get_export_file(None), Ok(export_file)));
// Relative path
let current_dir = current_dir().unwrap();
Expand All @@ -212,7 +213,7 @@ mod tests {
Ok(export_file)
));
// Path is a directory instead of a file
assert!(get_export_file(Some(home_dir)).is_err());
assert!(get_export_file(Some(data_dir)).is_err());
}

#[test]
Expand Down
6 changes: 4 additions & 2 deletions src/toolchain/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ impl Llvm {
.map_err(|_| Error::RemoveDirectory(llvm_path.display().to_string()))?;
#[cfg(unix)]
if cfg!(unix) {
let espup_dir = BaseDirs::new().unwrap().home_dir().join(".espup");
let espup_dir = BaseDirs::new().unwrap().data_dir().join("espup");

if espup_dir.exists() {
remove_dir_all(espup_dir.display().to_string())
Expand Down Expand Up @@ -341,7 +341,9 @@ impl Installable for Llvm {
#[cfg(unix)]
if cfg!(unix) {
exports.push(format!("export LIBCLANG_PATH=\"{}\"", self.get_lib_path()));
let espup_dir = BaseDirs::new().unwrap().home_dir().join(".espup");
// Use the directories crate to get the XDG data home directory
let base_dirs = BaseDirs::new().unwrap();
let espup_dir = base_dirs.data_dir().join("espup");

if !espup_dir.exists() {
create_dir_all(espup_dir.display().to_string())
Expand Down
Loading