linebender / druid

A data-first Rust-native UI design toolkit.
https://linebender.org/druid/
Apache License 2.0
9.45k stars 569 forks source link

Update Piet to v0.6.1. #2345

Closed xStrom closed 1 year ago

xStrom commented 1 year ago

Piet v0.6.1 comes with lots of documentation fixes, which is good for us because we embed it in the Druid docs.

Interestingly this revealed a bad actor in our dependency graph. The resvg crate pins png to =0.17.6. The way cargo works, this means that no other crate that Druid uses, or even any project that uses Druid can use any other semver compatible png version.

error: failed to select a version for `png`.
    ... required by package `piet-common v0.6.1`
    ... which satisfies dependency `piet-common = "^0.6.1"` of package `druid v0.7.0`
    ... which satisfies path dependency `druid` (locked to 0.7.0) of package `book_examples v0.1.0`
versions that meet the requirements `^0.17.7` are: 0.17.7

all possible versions conflict with previously selected packages.

  previously selected package `png v0.17.6`
    ... which satisfies dependency `png = "=0.17.6"` of package `resvg v0.28.0`
    ... which satisfies dependency `resvg = "^0.28.0"` of package `druid v0.7.0`
    ... which satisfies path dependency `druid` (locked to 0.7.0) of package `book_examples v0.1.0`

failed to select a version for `png` which could resolve this conflict

Thus I think the solution here is to revert back to resvg v0.25 which is just a few months older, but has a much saner png dependency of ^0.17. This issue has been brought to the attention of resvg in resvg#571 where they confirm their intention to change this in the future. For now I don't think we should propagate that pin to all projects depending on Druid. No bug fixes to png (e.g. v0.17.8) would reach apps using druid that way.