Skip to content

Commit 1c39c17

Browse files
Fix CI error from linux case insensitive path (#59624) (cherry-pick to preview) (#59717)
Cherry-pick of #59624 to preview ---- CI failed to build Linux because of my recent FS watcher fix, so I commented out the libc code and defaulted to false. In a follow up PR I will fix this ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
1 parent 6e4a871 commit 1c39c17

1 file changed

Lines changed: 22 additions & 21 deletions

File tree

crates/fs/src/fs_watcher.rs

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -369,27 +369,28 @@ fn case_insensitive_path(path: &Path) -> bool {
369369
}
370370

371371
#[cfg(target_os = "linux")]
372-
fn case_insensitive_path(path: &Path) -> bool {
373-
use std::os::unix::ffi::OsStrExt as _;
374-
375-
// Only ext4/f2fs casefold (`+F`) dirs are insensitive, reported by `statx` via
376-
// STATX_ATTR_CASEFOLD; any failure (e.g. pre-4.11 ENOSYS) means case-sensitive.
377-
const STATX_ATTR_CASEFOLD: u64 = 0x0000_2000;
378-
let Ok(c_path) = std::ffi::CString::new(path.as_os_str().as_bytes()) else {
379-
return false;
380-
};
381-
let mut buf = std::mem::MaybeUninit::<libc::statx>::zeroed();
382-
383-
// SAFETY: c_path is still valid, buffer has been zeroed
384-
if unsafe { libc::statx(libc::AT_FDCWD, c_path.as_ptr(), 0, 0, buf.as_mut_ptr()) } != 0 {
385-
return false;
386-
}
387-
388-
// SAFETY: libc statx initialized this buffer, otherwise we would've returned on a error
389-
// in that function call
390-
let buf = unsafe { buf.assume_init() };
391-
buf.stx_attributes_mask & STATX_ATTR_CASEFOLD != 0
392-
&& buf.stx_attributes & STATX_ATTR_CASEFOLD != 0
372+
fn case_insensitive_path(_path: &Path) -> bool {
373+
// use std::os::unix::ffi::OsStrExt as _;
374+
375+
// // Only ext4/f2fs casefold (`+F`) dirs are insensitive, reported by `statx` via
376+
// // STATX_ATTR_CASEFOLD; any failure (e.g. pre-4.11 ENOSYS) means case-sensitive.
377+
// const STATX_ATTR_CASEFOLD: u64 = 0x0000_2000;
378+
// let Ok(c_path) = std::ffi::CString::new(path.as_os_str().as_bytes()) else {
379+
// return false;
380+
// };
381+
// let mut buf = std::mem::MaybeUninit::<libc::statx>::zeroed();
382+
383+
// // SAFETY: c_path is still valid, buffer has been zeroed
384+
// if unsafe { libc::statx(libc::AT_FDCWD, c_path.as_ptr(), 0, 0, buf.as_mut_ptr()) } != 0 {
385+
// return false;
386+
// }
387+
388+
// // SAFETY: libc statx initialized this buffer, otherwise we would've returned on a error
389+
// // in that function call
390+
// let buf = unsafe { buf.assume_init() };
391+
// buf.stx_attributes_mask & STATX_ATTR_CASEFOLD != 0
392+
// && buf.stx_attributes & STATX_ATTR_CASEFOLD != 0
393+
false
393394
}
394395

395396
#[cfg(target_os = "windows")]

0 commit comments

Comments
 (0)