ratchetdesigns/ts-bindgen

Old version of swc dependency broken by upstream patch

Opened this issue · 7 comments

Prior to swc-project/swc#3606 (released in swc v1.2.142), swc_common relied upon a public API of v1.0.0 of the scoped-tls crate that has since been broken in a patch release (see alexcrichton/scoped-tls#22). Since ts-bindgen-gen depends upon swc crates prior to this, it fails to compile if Cargo is permitted to follow semver updates (can be overridden e.g. with cargo update -p scoped_tls:1.0.1 --precise 1.0.0).

Absent the issue being fixed upstream, perhaps ts-bindgen can update to a newer version of swc that does not rely on the broken API?

d4h0 commented

For context, the installation currently fails with:

$ cargo install ts-bindgen
   [...]
   Compiling swc_common v0.14.7
error[E0308]: mismatched types
  --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_common-0.14.7/src/syntax_pos.rs:92:9
   |
92 |         &FOO
   |         ^^^^ expected `*const ()`, found `usize`
   |
   = note: expected reference `&'static LocalKey<Cell<*const ()>>`
              found reference `&LocalKey<Cell<usize>>`
abrgr commented

Thanks! I will work on getting thsi fixed soon. I really appreciate the detailed report.

Just an FYI that this won't be fixed upstream as swc had been using an unstable/internal public API of the scoped-tls crate who do not consider their update to be a breaking change.

abrgr commented

Thanks. Definitely something we'll need to update on the ts-bindgen side.

sezna commented

Hey abrgr, great tool -- just wondering if there are any plans to fix this, as it seems impossible to install ts-bindgen currently. Alternatively, are there any known workarounds?

eggyal commented

@sezna there's a workaround mentioned in the opening post: cargo update -p scoped_tls:1.0.1 --precise 1.0.0.

abrgr commented