Skip to content

Commit

Permalink
New release
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Oct 27, 2023
1 parent dd452d6 commit 31d27d7
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.33.5] - 2023-10-28
* Support for latest ESP IDF 5.2 dev (master)

## [0.33.4] - 2023-10-27
* The `MCU` environment variable was failing the `pio` build if the MCU was not uppercased
* Better error message for the `native` build in case the MCU was not recognized
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "esp-idf-sys"
version = "0.33.4"
version = "0.33.5"
authors = ["Alexey Arbuzov <aarbuzov@termt.com>", "sapir <yasapir@gmail.com>", "Ivan Markov <ivan.markov@gmail.com>", "Dominik Gschwind <dominik.gschwind99@gmail.com>"]
edition = "2021"
resolver = "2"
Expand Down
14 changes: 11 additions & 3 deletions build/native/cargo_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub fn build() -> Result<EspIdfBuildOutput> {
);

let mut tools = vec![];
let mut subtools = vec![chip.gcc_toolchain()];
let mut subtools = vec![chip.gcc_toolchain(version.as_ref().ok())];

// Use custom cmake for esp-idf<4.4, because we need at least cmake-3.20
match version.as_ref().map(|v| (v.major, v.minor, v.patch)) {
Expand Down Expand Up @@ -219,6 +219,8 @@ pub fn build() -> Result<EspIdfBuildOutput> {
}
};

let version = idf.version.as_ref().ok().cloned();

let custom_linker = if !gcc12 && !chip.is_xtensa() {
// Another, even more annoying issue with the riscv targets is that since Rust nightly-2023-08-08
// and the introduction of LLVM-17, rustc (and LLVM) claim to support RISCV ISA 2.1 spec
Expand All @@ -242,13 +244,19 @@ pub fn build() -> Result<EspIdfBuildOutput> {
// [`crate::config::DEFAULT_TOOLS_INSTALL_DIR`] if unset.
let (linker_install_dir, _) = config.esp_idf_tools_install_dir()?;

let version_for_installer = version.clone();

let installer = espidf::Installer::new(linker_origin)
.install_dir(linker_install_dir.path().map(Into::into))
.with_tools(move |_, _| Ok(vec![espidf::Tools::new(vec![chip.gcc_toolchain()])]))
.with_tools(move |_, _| {
Ok(vec![espidf::Tools::new(vec![
chip.gcc_toolchain(version_for_installer.as_ref())
])])
})
.install()
.context("Could not install GCC linker")?;

let linker_name = format!("{}-gcc", chip.gcc_toolchain());
let linker_name = format!("{}-gcc", chip.gcc_toolchain(version.as_ref()));

let linker =
which::which_in_global(linker_name.clone(), Some(installer.exported_path.clone()))?
Expand Down
30 changes: 26 additions & 4 deletions build/native/cargo_driver/chip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,33 @@ impl Chip {
}

/// The name of the gcc toolchain (to compile the `esp-idf`) for `idf_tools.py`.
pub fn gcc_toolchain(&self) -> &'static str {
pub fn gcc_toolchain(&self, version: Option<&EspIdfVersion>) -> &'static str {
let new = version
.map(|version| version.major > 5 || version.major == 5 && version.minor > 1)
.unwrap_or(true);

match self {
Self::ESP32 => "xtensa-esp32-elf",
Self::ESP32S2 => "xtensa-esp32s2-elf",
Self::ESP32S3 => "xtensa-esp32s3-elf",
Self::ESP32 => {
if new {
"xtensa-esp-elf"
} else {
"xtensa-esp32-elf"
}
}
Self::ESP32S2 => {
if new {
"xtensa-esp-elf"
} else {
"xtensa-esp32s2-elf"
}
}
Self::ESP32S3 => {
if new {
"xtensa-esp-elf"
} else {
"xtensa-esp32s3-elf"
}
}
Self::ESP32C2
| Self::ESP32C3
| Self::ESP32H2
Expand Down

0 comments on commit 31d27d7

Please sign in to comment.