comptime-rs icon indicating copy to clipboard operation
comptime-rs copied to clipboard

comptime doens't work when compiling to non-executable targets

Open juntyr opened this issue 1 year ago • 0 comments

Thank you for this useful crate!

I'm trying to use comptime in a crate that's being compiled for the wasm32-wasi target. Since a wasm file is not runnable (and has a different extension than a system executable), comptime fails to run the produced binary and therefore cannot evaluate the invocation.

Sorting out the --target TARGET and --target=TARGET arguments for rustc would build the binary for the host platform (with the downside that any platform-dependent behaviour would not be different between a runtime and comptime evaluation), but also require that all extern crates are already built for the host platform already (on that note, would it be possible to generate a crate or a cargo script so that dependencies are compiled when needed).

juntyr avatar Aug 28 '24 12:08 juntyr