Yes, I think you misunderstood. Your patch, as it is, will *always* build code for i386 when cross compiling, because the `cfg` check in build.rs applies to the build machine and the empty main function (via #[cfg(not(target_arch = "x86"))]) will always be compiled instead of the top one. CI succeeding is the expected behavior because the patch doesn't do anything when cross compiling.
The issue is the opposite: nothing will prevent from building unsound code when cross compiling (the default for i386 on Debian infra) because the topmost main function, which in your intentions would make i386 optimized builds fail, is never compiled during cross builds (again, #[cfg(target_arch = "x86")] is checked for the build machine, which in Debian's case is "x86_64", and not for the target machine.