From aa162ea8d7e70b18431fd270b3b8bbfc39b17b0f Mon Sep 17 00:00:00 2001 From: Jesse Braham Date: Fri, 24 Jan 2025 12:11:30 +0100 Subject: [PATCH] Fixes for `esp-config` and `esp-storage` --- esp-config/README.md | 4 ++-- xtask/src/lib.rs | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/esp-config/README.md b/esp-config/README.md index 0d7f43b2f9b..37cdd324003 100644 --- a/esp-config/README.md +++ b/esp-config/README.md @@ -52,8 +52,8 @@ This crate is guaranteed to compile when using the latest stable Rust version at Licensed under either of: -- Apache License, Version 2.0 ([LICENSE-APACHE](../LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) -- MIT license ([LICENSE-MIT](../LICENSE-MIT) or http://opensource.org/licenses/MIT) +- Apache License, Version 2.0 ([LICENSE-APACHE](../LICENSE-APACHE) or ) +- MIT license ([LICENSE-MIT](../LICENSE-MIT) or ) at your option. diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 11e42418759..9b1eb8e5262 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs @@ -212,13 +212,14 @@ pub fn build_documentation( let args = builder.build(); log::debug!("{args:#?}"); + let mut envs = vec![("RUSTDOCFLAGS", "--cfg docsrs --cfg not_really_docsrs")]; + // Special case: `esp-storage` requires the optimization level to be 2 or 3: + if package == Package::EspStorage { + envs.push(("CARGO_PROFILE_DEBUG_OPT_LEVEL", "3")); + } + // Execute `cargo doc` from the package root: - cargo::run_with_env( - &args, - &package_path, - [("RUSTDOCFLAGS", "--cfg docsrs --cfg not_really_docsrs")], - false, - )?; + cargo::run_with_env(&args, &package_path, envs, false)?; // Build up the path at which the built documentation can be found: let mut docs_path = workspace.join(package.to_string()).join("target");