-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(rust): use unix/wasi instead of not windows for fd #3304
fix(rust): use unix/wasi instead of not windows for fd #3304
Conversation
What about macos/darwin? |
Darwin is included under Unix for Rust. What I did just realize might cause an issue though is this is essentially undoing #3293 which was a fix for WASI. I wonder if there's a way to have it be for either Unix or WASI but exclude platforms such as wasm32-unknown-unknown? Maybe target_family="unix" combined with target_os="wasi"? |
Yeah I was going to bring that up, but I didn't realize your case was for wasm32-unknown-unknown. You could definitely combine the cfgs for unix + wasi to exclude wasm32 then |
Yeah, the Rust standard library uses this attribute for the #[cfg(any(unix, target_os = "wasi"))] |
60a3ce5
to
6aac5f3
Compare
Just pushed with that change |
run |
not(windows) includes non-wasi web assembly which causes issues when using the rust bindings from non-wasi web assembly. In lib.rs, `AsRawFd` does not exist for wasm so it was causing the build to fail. I also changed ffi.rs `_ts_dup` for consistency even though that does not cause a build issue. This does lead to the situation where if you are not on either of those platforms, print_dot_graphs has no parameter to take a file. While odd, I think that does successfully convey that the current platform is not supported to use that function.
6aac5f3
to
3bd3ce8
Compare
Pushed with formatting fixes |
thanks! |
not(windows)
includes non-wasi web assembly which causes issues when using the rust bindings from web non-wasi assembly.In lib.rs,
AsRawFd
does not exist for wasm so it was causing the build to fail.I also changed ffi.rs
_ts_dup
for consistency even though that does not cause a build issue.This does lead to the situation where if you are not on either of those platforms, print_dot_graphs has no parameter to take a file. While odd, I think that does successfully convey that the current platform is not supported to use that function.