{"id":"d02c9cbc89b3c829","repo":"BurntSushi/ripgrep","slug":"unsupported-platform","errorCode":null,"errorMessage":"unsupported platform","messagePattern":"unsupported platform","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ignore/src/walk.rs","lineNumber":382,"sourceCode":"\n        Ok(DirEntryRaw {\n            path: ent.path(),\n            ty,\n            follow_link: false,\n            depth,\n            ino: ent.ino(),\n        })\n    }\n\n    // Placeholder implementation to allow compiling on non-standard platforms\n    // (e.g. wasm32).\n    #[cfg(not(any(windows, unix)))]\n    fn from_entry_os(\n        depth: usize,\n        ent: &fs::DirEntry,\n        ty: fs::FileType,\n    ) -> Result<DirEntryRaw, Error> {\n        Err(Error::Io(io::Error::new(\n            io::ErrorKind::Other,\n            \"unsupported platform\",\n        )))\n    }\n\n    #[cfg(windows)]\n    fn from_path(\n        depth: usize,\n        pb: PathBuf,\n        link: bool,\n    ) -> Result<DirEntryRaw, Error> {\n        let md = fs::metadata(&pb)\n            .map_err(|err| Error::Io(err).with_depth(depth).with_path(&pb))?;\n        Ok(DirEntryRaw {\n            path: pb,\n            ty: md.file_type(),\n            follow_link: link,\n            depth,","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/ignore/src/walk.rs#L364-L400","documentation":"DirEntryRaw::from_entry_os is gated #[cfg(not(any(windows, unix)))] and unconditionally returns Err('unsupported platform'). It is a stub so the ignore crate compiles on tier-3 targets, but building a directory entry from an fs::DirEntry is not implemented there, so it always fails at runtime.","triggerScenarios":"Running a directory walk (WalkBuilder) that yields entries via from_entry_os on a target that is neither windows nor unix (e.g. wasm32), causing every encountered fs::DirEntry to error.","commonSituations":"Cross-compiling a ripgrep-based tool to wasm/wasi and attempting a real filesystem walk; running grep ignore logic on an unsupported embedded target.","solutions":["Target a supported platform (windows or unix) for filesystem walking.","On the unsupported platform, supply entries manually via WalkBuilder::add / build_parallel with pre-built paths instead of relying on from_entry_os.","Avoid invoking directory-walk features on unsupported targets; search explicit file lists only."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const WALK_SUPPORTED: bool = cfg!(any(windows, unix));","typeGuard":null,"tryCatchPattern":"if !cfg!(any(windows, unix)) {\n    eprintln!(\"directory walk unsupported on this platform\");\n    return;\n}","preventionTips":["Do not enable real directory walks on non-windows/non-unix targets.","Feature-gate walk features behind cfg(any(windows, unix)).","On unsupported targets, search explicit file lists only."],"tags":["walk","platform","wasm","ignore"],"analyzedSha":"3fce3b5bb0236da2df6d99672afb8a719642eca7","analyzedAt":"2026-08-06T01:39:05.073Z","schemaVersion":2}