RazrFalcon / rustybuzz

A complete harfbuzz's shaping algorithm port to Rust
MIT License
544 stars 34 forks source link

Rustybuzz 0.5.2 breaks compatibility with 0.5.1 #59

Closed tronical closed 1 year ago

tronical commented 1 year ago

Version 0.5.2 includes commit https://github.com/RazrFalcon/rustybuzz/commit/9e65c89c4dad60aa896ec3ed293773ce2a79d448 that bumps the ttf-parser dependency to a new major. Since ttf_parser::Face is publicly re-exported via the Deref impl for rustybyzz::Face, this results in build issues in downstream dependencies.

I understand that this conceptual problem and that the added module re-export is an attempt at solving this so that applications don't have to depend on ttf-parser with a version and rusty buzz with a possibly incompatible version anymore.

But meanwhile for any apps that use rustybuzz = "0.5" for example in their Cargo.toml and they end up using any ttf-parser functions, their build likely breaks as they also have ttf-parser = "0.15" in their Cargo.toml and that's now incompatible with 0.17 as per the above linked commit.

I'd be happy to elaborate on the concrete build issue, in case that's unclear. In terms of remedy I suggest to release 0.5.3 with ttf-parser downgraded again and release 0.6 of rustbyzz with the newer ttf-parser - in case you agree that this was a breaking release.

RazrFalcon commented 1 year ago

I have published 0.5.3. Please check if it works fine now. And if so, I will publish 0.6 later.

Ideally we would have to yank 0.5.2, but it's already used by resvg and I assume it would break it.

tronical commented 1 year ago

Thank you! I can confirm that 0.5.3 fixes it.

tronical commented 1 year ago

As a side-note, a new usvg release might also be needed, since 0.5.3 removes the re-export again that usvg 0.24 depends on:

error[E0432]: unresolved import `rustybuzz::ttf_parser`
 --> /Users/simon/.cargo/registry/src/github.com-1ecc6299db9ec823/usvg-0.24.0/src/text/fontdb_ext.rs:8:5
  |
8 | use rustybuzz::ttf_parser;
  |     ^^^^^^^^^^^----------
  |     |          |
  |     |          help: a similar name exists in the module: `text_parser`
  |     no `ttf_parser` in the root

error[E0432]: unresolved import `rustybuzz::ttf_parser`
 --> /Users/simon/.cargo/registry/src/github.com-1ecc6299db9ec823/usvg-0.24.0/src/text/shaper.rs:6:16
  |
6 | use rustybuzz::ttf_parser::GlyphId;
  |                ^^^^^^^^^^ could not find `ttf_parser` in `rustybuzz`

For more information about this error, try `rustc --explain E0432`.
RazrFalcon commented 1 year ago

Yes, only resvg uses Cargo.lock. I wasn't planned a new release...