rake-compiler / rake-compiler-dock

Easy to use and reliable cross compiler environment for building Windows, Linux, Mac and JRuby binary gems.
MIT License
77 stars 30 forks source link

introduce failing test for some musl-incompatible code #55

Closed flavorjones closed 2 years ago

flavorjones commented 2 years ago

Originally reported as #42, which has more detail. The new test suite allows me to demonstrate the problem!

The summary of this issue is: centos/manylinux preprocesses isnan and isinf into C code that calls

int __isnan(double) __attribute__ ((__const__));

but on musl these calls are preprocessed into code that make no function calls:

#define isnan(x) ( \
    sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) > 0x7f800000 : \
    sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) > 0x7ffULL<<52 : \
    __fpclassifyl(x) == FP_NAN)

I'm not sure what to do about this (in Nokogiri we patch libxml2 to avoid calling isnan or isinf) but I figured the first step is to reproduce the problem in a test.

larskanis commented 2 years ago

Thank you Mike for adding this! That kind of issues are what I made the CI for. Would you mind to add a separate isnan/isinf test with a second ruby method to be called? One that is excluded on JRuby?

flavorjones commented 2 years ago

Done!

larskanis commented 2 years ago

Great! Thank you!

flavorjones commented 2 years ago

Rebased onto current master.