From dfc6d86a5856c87975d0ff74f597804bac29f03c Mon Sep 17 00:00:00 2001 From: Jesse Braham Date: Thu, 11 Apr 2024 13:04:55 +0000 Subject: [PATCH] Warn users when attempting to build `esp-hal` using the `dev` profile (#1420) * Warn users when attempting to build `esp-hal` using the `dev` profile * Update `CHANGELOG.md` --- esp-hal/CHANGELOG.md | 1 + esp-hal/build.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index ff635de5ae0..18fb077da86 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add TWAI support for ESP32-C6 (#1323) - `GpioPin::steal` unsafe API (#1363) - Inherent implementions of GPIO pin `set_low`, `is_low`, etc. +- Warn users when attempting to build using the `dev` profile (#1420) ### Fixed diff --git a/esp-hal/build.rs b/esp-hal/build.rs index 755a774884c..65ecf3607ca 100644 --- a/esp-hal/build.rs +++ b/esp-hal/build.rs @@ -10,6 +10,15 @@ use std::{ use esp_build::assert_unique_used_features; use esp_metadata::{Chip, Config}; +#[cfg(debug_assertions)] +esp_build::warning! {" +WARNING: use --release + We *strongly* recommend using release profile when building esp-hal. + The dev profile can potentially be one or more orders of magnitude + slower than release, and may cause issues with timing-senstive + peripherals and/or devices. +"} + fn main() -> Result<(), Box> { // NOTE: update when adding new device support! // Ensure that exactly one chip has been specified: