Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove note about fixed cargo bug #3105

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
40 changes: 0 additions & 40 deletions esp-config/src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ pub fn generate_config_internal<W: Write>(
// other file changed.
writeln!(stdout, "cargo:rerun-if-changed=build.rs").ok();

#[cfg(not(test))]
env_change_work_around(stdout);

let mut doc_table = String::from(DOC_TABLE_HEADER);
let mut selected_config = String::from(SELECTED_TABLE_HEADER);

Expand Down Expand Up @@ -371,43 +368,6 @@ pub fn generate_config_internal<W: Write>(
configs
}

// A work-around for https://github.com/rust-lang/cargo/issues/10358
// This can be removed when https://github.com/rust-lang/cargo/pull/14058 is merged.
// Unlikely to work on projects in workspaces
#[cfg(not(test))]
fn env_change_work_around<W: Write>(stdout: &mut W) {
let mut out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());

// We clean out_dir by removing all trailing directories, until it ends with
// target
while !out_dir.ends_with("target") {
if !out_dir.pop() {
return; // We ran out of directories...
}
}
out_dir.pop();

let dotcargo = out_dir.join(".cargo/");
if dotcargo.exists() {
if dotcargo.join("config.toml").exists() {
writeln!(
stdout,
"cargo:rerun-if-changed={}",
dotcargo.join("config.toml").display()
)
.ok();
}
if dotcargo.join("config").exists() {
writeln!(
stdout,
"cargo:rerun-if-changed={}",
dotcargo.join("config").display()
)
.ok();
}
}
}

fn create_config<W: Write>(
stdout: &mut W,
prefix: &str,
Expand Down
4 changes: 0 additions & 4 deletions esp-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@
#![doc = ""]
#![doc = include_str!(concat!(env!("OUT_DIR"), "/esp_hal_config_table.md"))]
#![doc = ""]
//! It's important to note that due to a [bug in cargo](https://github.com/rust-lang/cargo/issues/10358),
//! any modifications to the environment, local or otherwise will only get
//! picked up on a full clean build of the project.
//!
//! ## `Peripheral` Pattern
//!
//! Drivers take pins and peripherals as [peripheral::Peripheral] in most
Expand Down
5 changes: 0 additions & 5 deletions esp-wifi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@
//! for this crate:
#![doc = ""]
#![doc = include_str!(concat!(env!("OUT_DIR"), "/esp_wifi_config_table.md"))]
#![doc = ""]
//! It's important to note that due to a [bug in cargo](https://github.com/rust-lang/cargo/issues/10358),
//! any modifications to the environment, local or otherwise will only get
//! picked up on a full clean build of the project.

#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/46717278")]
#![no_std]
#![cfg_attr(xtensa, feature(asm_experimental_arch))]
Expand Down