#How to debug proc_macroSpan related build error?

36 messages · Page 1 of 1 (latest)

fluid mason
#

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.

GitHub

I'm trying to run your example (MacOS Ventura, Intel) using npx wrangler dev and it's giving the following error: ... Compiling semver v0.9.0 error[E0277]: the trait bound `proc_mac...

pulsar jackal
#

Uh, my guess is that there's a feature in syn/quote you need to enable

fluid mason
#

ah, interesting

#

what's the general procedure for enabling features like that?

pulsar jackal
#

Or, uh, no. I think you are on an old proc_macro2 version

#

Please post the output of cargo tree

fluid mason
#

ok, let me try

#

proc-macro2 v1.0.29 (*)

pulsar jackal
#

Okay, that version does have that impl

fluid mason
#

latest seems to be 1.0.49

#

can we lock it to that somehow?

pulsar jackal
fluid mason
#

ok, that explains the error

pulsar jackal
#

no, it does have it. it doesn't explain it

#

it actually exists all the way back in 1.0.0

fluid mason
#

hmm

pulsar jackal
#

can you sanity check and see if cargo clean and then compiling again fixes it

fluid mason
#

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

#

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

pulsar jackal
fluid mason
#

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

#

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