On Wed, Feb 05, 2025 at 10:24:08AM -0800, Richard Henderson wrote: > On 2/5/25 07:59, Daniel P. Berrangé wrote: > > + > > +''' > > +Decorator to skip execution of a test on 32-bit targets > > +Example: > > + > > + @skipIf32BitTarget() > > +''' > > +def skipIf32BitTarget(): > > + enoughBits = sys.maxsize > 2**32 > > This will work for true 32-bit hosts, and possibly for containers running > emulation, but it won't work for cross-compilation (x86_64 to i686 or > aarch64 to arm). > > Perhaps "file qemu-system-foo" | grep "ELF 32-bit" ? > I don't know that we've actually selected the executable at this point > though...
The QEMU_TEST_QEMU_BINARY env variable exists at all times, though grepping for ELF format feels a bit icky. We also know the location of the build directory, so was wondering if anything there tells us whether the host target is 64-bit, but it appears not be the case. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
