[Pkg-rust-maintainers] strange issue while building cargo on raspbian, logarithms seem to be calculated incorrectly.

plugwash at raspbian.org plugwash at raspbian.org
Sat Mar 2 15:01:12 GMT 2019


cargo 0.33 failed to build in raspbian with duplicate declaration errors.

http://buildd.raspbian.org/status/fetch.php?pkg=cargo&arch=armhf&ver=0.33.0-1&stamp=1551496700

After investigating the generation code it looked like logarithms were 
being calculated incorrectly on the following lines of 
vendor/typenum/build/main.rs ( 
https://sources.debian.org/src/cargo/0.33.0-1/vendor/typenum/build/main.rs/ 
)

let first2: u32 = (highest as f64).log(2.0) as u32 + 1;
let first10: u32 = (highest as f64).log(10.0) as u32 + 1;

 From the results it looked like "first2" was coming out as 0 and 
"first10" was coming out as a large number.

I replaced the code calculating first2 and first10 with hardcoded 
results and was able to build cargo successfully. A debdiff should 
appear soon at https://debdiffs.raspbian.org/main/c/cargo/

I tried to make a standalone testcase using the relavent code from 
main.rs, but unfortunately it did not exibit the bug.




More information about the Pkg-rust-maintainers mailing list