Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In the generator, we have ```rust pub fn smallest_index(n: usize) -> usize { for &x in [8, 16, 32].iter() { if n < (1 << x) { return x / 8; } } 64 } ``` where `x` is inferred to be `usize`. When the host architecture is 32-bits, `(1 << x)` overflows. For release build, this doesn't crash but leads to strange invalid generated.rs which contain an undefined `u512` type (https://github.com/astral-sh/ruff/actions/runs/6500014395/job/17659540717). Note that the crash only happens on i686 hosts (i used the quay.io/pypa/manylinux2014_i686 docker container), if you're cross compiling build scripts are compiled to the host architecture and the build works fine. This change fixes this by instead pinning types to 4 bytes max, which seems sufficient. I only changed this specific `usize` that unbreaks the build, but there are more `usize` usages in the generator that might be problematic that i haven't checked.
- Loading branch information