num-format icon indicating copy to clipboard operation
num-format copied to clipboard

Multiple issues encountered while fixing package in Debian.

Open plugwash opened this issue 2 years ago • 0 comments

I was recently alerted to the rust-num-format package being broken in Debian, and worked through mulitple issues to get us a usable package. The full set of patches can be found at https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/num-format/debian/patches/dont-fail-build-deprecated.diff, some of them are Debian-specific (for example we remove windows-related dependencies), but others are more generally relavent, I'll describe the more generally relavent ones here.

Firstly the package outright refused to build because it uses std::mem::uninitialised feature of std and is set to deny calls to deprecated functions. I removed the deny to get the package building but ideally the package should switch to maybeuninit. https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/num-format/debian/patches/dont-fail-build-deprecated.diff

Secondly dependencies needed updating for the versions in Debian. I bumped num-bigint to 0.4 and rand to 0.8 with no changes needed beyond the version bump. I bumped itoa to version 1 and needed to remove references to the "i128" and "default" feature flags which no longer exist and no longer seem to be needed. The trickiest dependency was arrayvec, this has changed the way it's generic parameters work, involving a bunch of patching to upgrade to 0.7, a patch can be found at https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/num-format/debian/patches/dont-fail-build-deprecated.diff

Thirdly building with the with-serde, or with-system-locale features fails if the std feature is not also enabled, I made these features depend on std.

Foruthly the testsuite fails if the system happens to have locales installed (e.g. on a debian system if the locales-all package happens to be installed) that are not compatible with num-format, I modified the test to skip known-incompatible locales. https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/num-format/debian/patches/tolerate-unsupported-locales.diff

Finally as already reported in https://github.com/bcmyers/num-format/issues/26 the tests fail on 32-bit architectures, I'll follow up that issue over in that bug.

plugwash avatar Jun 24 '22 21:06 plugwash