Closed mrauhu closed 8 months ago
Hello @orph3usLyre.
I found a bug when building a project with muddy dependency on Windows:
muddy
| 3 | muddy_init!(); | ^^^^^^^^^^^^^ | | | could not find `unix` in `os` | in this macro invocation | ::: ...\muddy_macros-0.2.0\src\lib.rs:88:1 | 88 | pub fn muddy_init(input: TokenStream) -> TokenStream { | ---------------------------------------------------- in this expansion of `muddy_init!` |
The source of bug is an import of std::os::unix::ffi::OsStrExt without config:
std::os::unix::ffi::OsStrExt
https://github.com/orph3usLyre/muddy-waters/blob/5c08d21b6b2e896bbf5fb91b45f5a929983e1525/muddy_macros/src/internal.rs#L73-L77
Possible solution is:
#[cfg(unix)] use std::os::unix::ffi::OsStrExt; #[cfg(wasi)] std::os::wasi::ffi::OsStrExt; #[cfg(windows)] std::os::windows::ffi::OsStrExt;
Please, see the OsStrExt trait implementation: https://doc.rust-lang.org/std/index.html?search=OsStrExt.
OsStrExt
Best wishes, Sergey.
Good catch, thanks! Merged.
Hello @orph3usLyre.
I found a bug when building a project with
muddy
dependency on Windows:The source of bug is an import of
std::os::unix::ffi::OsStrExt
without config:https://github.com/orph3usLyre/muddy-waters/blob/5c08d21b6b2e896bbf5fb91b45f5a929983e1525/muddy_macros/src/internal.rs#L73-L77
Possible solution is:
Please, see the
OsStrExt
trait implementation: https://doc.rust-lang.org/std/index.html?search=OsStrExt.Best wishes, Sergey.