SteveSandersonMS / dotnet-wasi-sdk

Packages for building .NET projects as standalone WASI-compliant modules
518 stars 36 forks source link

Get host OS information #45

Open Beyley opened 2 years ago

Beyley commented 2 years ago

Is it possible to get host OS information? Specifically to be able to get this check to work properly https://github.com/dotnet/Silk.NET/blob/23f9bd4d67ad21c69fbd69cc38a62fb2c0ec3927/src/Core/Silk.NET.Core/Loader/SearchPathContainer.cs#L20 (also is it possible to get specifically whether this is running under a non-browser but still WASM? RuntimeInformation.OSDescription returns "Browser" even under wasmtime or wasmer)

Eagle3386 commented 2 years ago

Given #22's closing comment, you might be able to access host information via reflection.

Though, given #26's closing comment, I suspect that requires your own custom host in order to access information outside WASI's "virtual host world"…