Skip to content

Fix race condition in clang_macro_fallback#3369

Open
HKalbasi wants to merge 1 commit intorust-lang:mainfrom
HKalbasi:fix-race-condition
Open

Fix race condition in clang_macro_fallback#3369
HKalbasi wants to merge 1 commit intorust-lang:mainfrom
HKalbasi:fix-race-condition

Conversation

@HKalbasi
Copy link
Copy Markdown
Member

@HKalbasi HKalbasi commented May 5, 2026

Resurrection of #3111
Github does not allow reopening force pushed PRs.

Comment thread bindgen/clang.rs
use crate::ir::context::BindgenContext;
use clang_sys::*;
use std::cmp;
use std::os::unix::ffi::OsStrExt;
Copy link
Copy Markdown
Contributor

@emilio emilio May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs to be #[cfg]d to build on windows right?

View changes since the review

Comment thread bindgen/clang.rs
}

fn path_to_cstring(path: &Path) -> CString {
CString::new(path.as_os_str().as_bytes()).unwrap()
Copy link
Copy Markdown
Contributor

@emilio emilio May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this probably needs something else on windows right?

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would path.to_string_lossy().as_bytes() be fine? tmpfile crate probably generates utf8 paths.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw shouldn't a windows CI be there to catch this?

@HKalbasi HKalbasi force-pushed the fix-race-condition branch from d1bc925 to 8cd1b34 Compare May 5, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants