Closed sunfishcode closed 3 months ago
I think we should! - Though I don't know how to use it. It assumes a binary target is available (main.rs
) but I don't know what the signature of the main
function should be? If you write:
pub use wasi::http::types::{IncomingRequest, ResponseOutparam};
fn main(request: IncomingRequest, outparam: ResponseOutparam) { ... }
The program does nothing and you get the following warning:
warning: function `main` is never used
--> src/lib.rs:5:4
|
5 | fn main(request: IncomingRequest, outparam: ResponseOutparam) {
| ^^^^
|
= note: `#[warn(dead_code)]` on by default
I think this might point at a bug in cargo-component
?
@yoshuawuyts I'm struggling to reproduce. I cloned the repo and ran cargo component serve
without issues. What version of cargo-component
are you running? It shouldn't be using a fn main
, as it builds with --lib
.
This is now done in #15!
https://github.com/bytecodealliance/cargo-component/pull/305 adds a
cargo component serve
command. Should use use that here?