Hi!
While rebuilding the python related packages against the Python 3.15rc1
version we found that tinyarray fails to build from source on arm64 [1].
This also fails on Debian's buildds [2].
It fails in arm64 with: Failed: DID NOT RAISE OverflowError
When converting floats to integer, `std::numeric_limits<long>::max()`
(2^63 - 1) rounds up to 2^63 in float/double, causing `*ptr > max()` to
be false for 2^63. The subsequent check on the cast integer relied on
architecture-specific overflow behavior that does not hold on ARM64
(where out-of-range floats saturate to positive INT64_MAX instead of
negative values).
So, to fix it, check bounds against exact power-of-two limits before
casting to detect overflow portably across architectures.
I applied the fix in the sandbox [3] to be able to build the packages
that depend on tinyarray, please consider applying the patch to support
the upcoming 3.15 version.
Happy hacking,
[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4316397/
[2]: https://buildd.debian.org/status/fetch.php?pkg=tinyarray&arch=arm64&ver=1.2.5-1&stamp=1766523038&raw=0
[3]: https://debusine.debian.net/debian/r-python-python3.15/