So, how does one actually go about updating a rust package? How do you find out what breaks with the update?
Do we always provide a compat package, or do we try to update the deps? Go for it in a side tag and make a compat package if we can't update the deps?
For example, looking at updating miniz_oxide to 0.5.3, if I try to install on my devel machine that is loading with rust packages I get:
Error: Problem 1: problem with installed package rust-tiff-devel-0.6.1-5.fc37.noarch - package rust-tiff-devel-0.6.1-5.fc37.noarch requires (crate(miniz_oxide/default) >= 0.4.1 with crate(miniz_oxide/default) < 0.5.0~), but none of the providers can be installed - cannot install both rust-miniz_oxide+default-devel-0.5.3-1.fc37.noarch and rust-miniz_oxide+default-devel-0.4.4-4.fc37.noarch - conflicting requests Problem 2: problem with installed package rust-flate2+miniz_oxide-devel-1.0.22-3.fc37.noarch - package rust-flate2+miniz_oxide-devel-1.0.22-3.fc37.noarch requires (crate(miniz_oxide) >= 0.4.0 with crate(miniz_oxide) < 0.5.0~), but none of the providers can be installed - cannot install both rust-miniz_oxide-devel-0.5.3-1.fc37.noarch and rust-miniz_oxide-devel-0.4.4-4.fc37.noarch - conflicting requests Problem 3: problem with installed package rust-png-devel-0.17.2-2.fc37.noarch - package rust-png-devel-0.17.2-2.fc37.noarch requires (crate(miniz_oxide/no_extern_crate_alloc) >= 0.4.1 with crate(miniz_oxide/no_extern_crate_alloc) < 0.5.0~), but none of the providers can be installed - cannot install both rust-miniz_oxide+no_extern_crate_alloc-devel-0.5.3-1.fc37.noarch and rust-miniz_oxide+no_extern_crate_alloc-devel-0.4.4-4.fc37.noarch - conflicting requests
But I don't know how to construct a repoquery that would test for that.
On Tue, Aug 9, 2022 at 5:04 AM Orion Poplawski orion@nwra.com wrote:
So, how does one actually go about updating a rust package? How do you find out what breaks with the update?
Rust uses semantic versioning (with one small difference from the upstream spec). So updating a crate from version 1.x to 1.y should always be fine. Updating a crate from version 0.1.x to 0.1.y is also fine. But updates from 1.x to 2.y, or updates from 0.x to 0.y, are problematic, because dependent packages will usually depend on them like BuildRequires: (crate(foo) >= 0.1.0 with crate(foo) < 0.2.0).
As a rule of thumb: For post-1.0 releases, updating a version 1.x to 1.y (or 2.x -> 2.y, etc.) is fine. For pre-1.0 releases, updating a version 0.1.x to 0.1.y (or 0.2.x -> 0.2.y, etc.) is fine, since those release branches claim to only include backwards compatible changes.
Do we always provide a compat package, or do we try to update the deps? Go for it in a side tag and make a compat package if we can't update the deps?
It depends on three factors: - how many packages depend on the old crate version, - how big are API changes between the versions, - how much time I have to deal with the situation
For example, looking at updating miniz_oxide to 0.5.3, if I try to install on my devel machine that is loading with rust packages I get:
Please, don't do that. Rust packages are not designed to be installed outside temporary mock chroots. Build with mock instead, if at all possible. For example, we don't set up any Obsoletes for removed subpackages, and there is no guaranteed upgrade path, especially when we need to create compat packages. So *if* you install rust-*-devel packages on your host machine, you will pretty regularly get upgrade issues. You'll also need to continuously refresh BuildRequires with those generated by the crates that you want to build, which is a huge hassle if you can't let mock handle this automatically for you.
But I don't know how to construct a repoquery that would test for that.
You can use this bash script to check for impact when pushing breaking versions: https://github.com/decathorpe/miscripts/blob/master/cratedeps
Like this:
$ cratedeps miniz_oxide
And it will list all source and binary packages that depend on the current version of miniz_oxide:
rust-backtrace-0:0.3.64-2.fc37.src rust-backtrace-devel-0:0.3.64-2.fc37.noarch rust-flate2-0:1.0.22-3.fc37.src rust-flate2+miniz_oxide-devel-0:1.0.22-3.fc37.noarch rust-miniz_oxide+default-devel-0:0.4.4-4.fc37.noarch rust-miniz_oxide+no_extern_crate_alloc-devel-0:0.4.4-4.fc37.noarch rust-png-0:0.17.2-2.fc37.src rust-png-devel-0:0.17.2-2.fc37.noarch rust-tiff-0:0.6.1-5.fc37.src rust-tiff-devel-0:0.6.1-5.fc37.noarch
This means:
- rust-backtrace depends on miniz_oxide v0.4 at build- and at install-time (though a pending update already requires miniz_oxide 0.5) - rust-flate2 depends on miniz_oxide v0.4 at build- and at install-time (though a pending update already requires miniz_oxide 0.5) - rust-png depends on miniz_oxide v0.4 at build- and at install-time (though a pending update already requires miniz_oxide 0.5) - rust-tiff depends on miniz_oxide v0.4 at build- and at install-time (the pending update to v0.7 drops the dependency on miniz_oxide, but we still need v0.6)
The updates for the "backtrace" crate are always a bit tedious, because it requires a coordinated update of backtrace, addr2line, object, and other crates. I will tackle that in the near future.
Looking at the changelog for miniz_oxide, it doesn't seem that there were badly breaking API changes with 0.5: https://github.com/Frommi/miniz_oxide/blob/master/CHANGELOG.md
So it might be possible to port current users of miniz_oxide to version 0.5 without too much work, but I'd like to avoid pushing two updates for backtrace, so I'd rather include it in the update, as well. So, taking all this into account, this is what I will probably do:
- update miniz_oxide to v0.5 - update backtrace to the latest version (including addr2line, object, etc.) - update flate2 to latest version - update png to latest version - attempt to port tiff v0.6 to miniz_oxide 0.7 - add a compat package for miniz_oxide 0.4 if porting tiff to v0.5 fails
Fabio
On 8/9/22 02:41, Fabio Valentini wrote:
You can use this bash script to check for impact when pushing breaking versions: https://github.com/decathorpe/miscripts/blob/master/cratedeps
Thanks. Is this script mentioned in the Fedora docs anywhere? Could be useful.
Like this:
$ cratedeps miniz_oxide
And it will list all source and binary packages that depend on the current version of miniz_oxide:
rust-backtrace-0:0.3.64-2.fc37.src rust-backtrace-devel-0:0.3.64-2.fc37.noarch rust-flate2-0:1.0.22-3.fc37.src rust-flate2+miniz_oxide-devel-0:1.0.22-3.fc37.noarch rust-miniz_oxide+default-devel-0:0.4.4-4.fc37.noarch rust-miniz_oxide+no_extern_crate_alloc-devel-0:0.4.4-4.fc37.noarch rust-png-0:0.17.2-2.fc37.src rust-png-devel-0:0.17.2-2.fc37.noarch rust-tiff-0:0.6.1-5.fc37.src rust-tiff-devel-0:0.6.1-5.fc37.noarch
This means:
- rust-backtrace depends on miniz_oxide v0.4 at build- and at install-time (though a pending update already requires miniz_oxide 0.5)
- rust-flate2 depends on miniz_oxide v0.4 at build- and at install-time (though a pending update already requires miniz_oxide 0.5)
- rust-png depends on miniz_oxide v0.4 at build- and at install-time (though a pending update already requires miniz_oxide 0.5)
- rust-tiff depends on miniz_oxide v0.4 at build- and at install-time (the pending update to v0.7 drops the dependency on miniz_oxide, but
we still need v0.6)
The updates for the "backtrace" crate are always a bit tedious, because it requires a coordinated update of backtrace, addr2line, object, and other crates. I will tackle that in the near future.
Looking at the changelog for miniz_oxide, it doesn't seem that there were badly breaking API changes with 0.5: https://github.com/Frommi/miniz_oxide/blob/master/CHANGELOG.md
So it might be possible to port current users of miniz_oxide to version 0.5 without too much work, but I'd like to avoid pushing two updates for backtrace, so I'd rather include it in the update, as well. So, taking all this into account, this is what I will probably do:
- update miniz_oxide to v0.5
- update backtrace to the latest version (including addr2line, object, etc.)
- update flate2 to latest version
- update png to latest version
- attempt to port tiff v0.6 to miniz_oxide 0.7
- add a compat package for miniz_oxide 0.4 if porting tiff to v0.5 fails
Thanks for the info. Other updates I'm looking at:
* clamav needs image 0.24 (currently at 0.23). Depending on it appears to be: rust-notify-rust rust-palette rust-plotters rust-qrcode rust-rav1e rust-smithay-client rust-winit zola
Definitely a number of changes mentioned in https://github.com/image-rs/image/blob/master/CHANGES.md
* image 0.24 needs: rust-exr rust-jpeg-decoder 0.2.1 rust-tiff 0.7.1
* exr needs: deflate 1.0 some other new packages I've submitted for review plus resurrecting flume
* deflate dependents: png
* tiff depependents: image
* jpeg-decoder dependents: image tiff
Any suggestions for how to tackle this? At least most of the deps seem related. But I'm guessing that adding a compat package for image would require adding compat packages for crates it depends on?
On Tue, Aug 9, 2022 at 4:16 PM Orion Poplawski orion@nwra.com wrote:
On 8/9/22 02:41, Fabio Valentini wrote:
You can use this bash script to check for impact when pushing breaking versions: https://github.com/decathorpe/miscripts/blob/master/cratedeps
Thanks. Is this script mentioned in the Fedora docs anywhere? Could be useful.
It's not yet, but I can suggest adding it to the Rust Packaging Guidelines (or to the package that contains /usr/bin/rust2rpm?).
Thanks for the info. Other updates I'm looking at:
- clamav needs image 0.24 (currently at 0.23). Depending on it appears
to be: rust-notify-rust rust-palette rust-plotters rust-qrcode rust-rav1e rust-smithay-client rust-winit zola
OK, clamav seems to be the first crate we have that requires image v0.23. And the API changes are pretty big, so we'll probably need a compat package for v0.23.
Definitely a number of changes mentioned in https://github.com/image-rs/image/blob/master/CHANGES.md
- image 0.24 needs: rust-exr rust-jpeg-decoder 0.2.1 rust-tiff 0.7.1
So we will probably also need compat packages for jpeg-decoder v0.1 and tiff v0.6 until we can drop image v0.23.
- exr needs: deflate 1.0 some other new packages I've submitted for review plus resurrecting flume
I'm building the update for miniz_oxide right now, which also includes deflate 1.0.0 and the png update that updated deflate from v0.9 to v1.
deflate dependents: png
tiff depependents: image
jpeg-decoder dependents: image tiff
Any suggestions for how to tackle this? At least most of the deps seem related. But I'm guessing that adding a compat package for image would require adding compat packages for crates it depends on?
One step at a time:
1. I'm building updates for miniz_oxide, flate2, deflate, png, etc. right now. 2. tiff v0.6 -> v0.7 update + addition of tiff v0.6 compat package 3. jpeg-decoder v0.1 -> v0.2 update + addition of jpeg-decoder v0.1 compat package 4. image v0.23 -> v0.24 update + addition of image v0.23 compat package
Step 1 is already happening in koji as we speak. Steps 2 and 3 are independent of 1 and each other, so I could start working on that ~tomorrow. Step 4 depends on 1,2,3, so has to happen last.
Fabio
On Tue, Aug 9, 2022 at 4:37 PM Fabio Valentini decathorpe@gmail.com wrote:
- I'm building updates for miniz_oxide, flate2, deflate, png, etc. right now.
- tiff v0.6 -> v0.7 update + addition of tiff v0.6 compat package
- jpeg-decoder v0.1 -> v0.2 update + addition of jpeg-decoder v0.1
compat package 4. image v0.23 -> v0.24 update + addition of image v0.23 compat package
Step 1 is already happening in koji as we speak. Steps 2 and 3 are independent of 1 and each other, so I could start working on that ~tomorrow. Step 4 depends on 1,2,3, so has to happen last.
Step 1 is done, miniz_oxide, png, etc. are updated.
Can you mark the bugs for tiff 0.7, jpeg-decoder 0.2, and image 0.24 as blocking whatever you're working on, so I don't forget about this when I do my next round of crate updates?
Thanks, Fabio