I am trying to compile a simple Rust project but it gives an error related to proc_macroSpan. I have a full description at https://github.com/xtuc/svg-to-png-worker/issues/1 . How would you start debugging something like this? For me, it seems like it's coming from wasm-pack itself. I wonder if locking that proc_macro2 dependency somehow would help in resolving.
#How to debug proc_macroSpan related build error?
36 messages · Page 1 of 1 (latest)
Uh, my guess is that there's a feature in syn/quote you need to enable
Or, uh, no. I think you are on an old proc_macro2 version
Please post the output of cargo tree
Okay, that version does have that impl
A region of source code, along with macro expansion information.
ok, that explains the error
can i do something like cargo install [email protected]?
no, it does have it. it doesn't explain it
it actually exists all the way back in 1.0.0
hmm
can you sanity check and see if cargo clean and then compiling again fixes it
sure, i'll try
cargo clean && cargo build completed successfully. now trying npx wrangler dev. that seems to run cargo install -q worker-build && worker-build --release but this is crashing with the same error
i wonder if we were looking at the wrong tree
since this is doing worker-build
also it's interesting that at the error it's pointing to proc-macro-error-1.0.4
i don't see that in tree at all
https://doc.rust-lang.org/stable/proc_macro/struct.Span.html is missing From<proc_macro::Span>
A region of source code, along with macro expansion information.
it feels like the project is trying to pull both proc_macro and proc_macro2 and that's what the error is more or less telling if i'm reading correctly
but looking at the tree doesn't have a single direct reference on proc_macro
that is proc_macro not proc_macro2
note: required for proc_macro::Span to implement Into<proc_macro2::Span> - do you understand the first bit? why is it proc_macro ?
ah, i see
this is interesting, https://docs.rs/proc-macro2/1.0.29/proc_macro2/struct.Span.html#impl-From<Span>
A region of source code, along with macro expansion information.
anyway, maybe the question is why is it even trying to pull both?
another thing i don't understand is why is it trying to compile proc-macro-error even though it's not in tree
ah... i bet it's something in wrangler as it's trying to compile wasm-pack . so i'll try compiling that alone to get better idea. thanks for the pointers
yup, i get the same error specifically when compiling wasm-pack alone. here's cargo tree from that https://gist.github.com/bebraw/a0c9a3cbb833ba8bc8ef2c6e74a95004