Closed arctic-hen7 closed 1 year ago
Due to the lack of a #[cfg(target = "wasm32-unknown-unknown")]
-style conditional compilation predicate (to my knowledge), this is very possibly going to become quite grotesque, and it is used a lot in the codebase. If anyone has a particularly elegant way of doing this, that would be greatly appreciated! (My attention is with the capsules right now.)
Due to the lack of a
#[cfg(target = "wasm32-unknown-unknown")]
-style conditional compilation predicate (to my knowledge), this is very possibly going to become quite grotesque, and it is used a lot in the codebase. If anyone has a particularly elegant way of doing this, that would be greatly appreciated! (My attention is with the capsules right now.)
Even if that were possible, I don't think that would be a good solution. Instead, maybe have the perseus CLI set a custom cfg
flag via the command line and use #[cfg(ssr)]
which is nice and short.
This is exactly what I was thinking, but perhaps a build script would be cleaner?
This is exactly what I was thinking, but perhaps a build script would be cleaner?
The problem with build-scripts is that they only affect the current crate that is being compiled, whereas setting a flag from the CLI will affect all the crates being compiled. You probably want the latter because these feature gates would also be used in perseus and other dependencies.
Ah I hadn't understood that. Thanks!
This is fixed in the latest commit, but I haven't explicitly tested support for compiling the engine to Wasi or the like. Since this issue pertains to the target gates themselves, I'll close this.
Pretty sure actually compiling Perseus to Wasi is blocked by https://github.com/rust-lang/socket2/issues/268.
This issue is reporting a bug in the code of Perseus. Details of the scope will be available in issue labels. The author described their issue as follows:
The steps to reproduce this issue are as follows:
A minimum reproducible example is available at <>.
Tribble internal data
dHJpYmJsZS1yZXBvcnRlZCxDLWJ1ZyxhdXRob3Itd2lsbGluZy10by1pbXBs