wahern / cqueues

Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua on Unix.
http://25thandclement.com/~william/projects/cqueues.html
MIT License
244 stars 37 forks source link

Luarocks install fails on arm64 mac #246

Closed sharpobject closed 3 years ago

sharpobject commented 3 years ago
$ luarocks install cqueues CRYPTO_DIR=/opt/homebrew/opt/openssl OPENSSL_DIR=/opt/homebrew/opt/openssl
Installing https://luarocks.org/cqueues-20200726.51-0.src.rock

cqueues 20200726.51-0 depends on lua 5.1 (5.1-1 provided by VM)
Warning: unmatched variable LUA_LIBDIR
enabling Lua 5.1
cp /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/config.h.guess /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/config.h
cp /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/config.h /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/config.h
mkdir -p /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1
env MACOSX_DEPLOYMENT_TARGET=10.1 gcc -O2 -std=gnu99 -fPIC -g -Wall -Wextra -Wno-missing-field-initializers -Wno-initializer-overrides -Wno-unused -Wno-dollar-in-identifier-extension -Wno-deprecated-declarations -O2 -fPIC -DLUA_COMPAT_APIINTCASTS -I/Users/sharpobject/luas/luajit/include -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -I"/opt/homebrew/opt/openssl/include" -I"/opt/homebrew/opt/openssl/include" -DCOMPAT53_PREFIX=cqueues -DCQUEUES_VENDOR='"quae@daurnimator.com"' -DCQUEUES_VERSION=20200726L  -c -o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1/cqueues.o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/cqueues.c
mkdir -p /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1
env MACOSX_DEPLOYMENT_TARGET=10.1 gcc -O2 -std=gnu99 -fPIC -g -Wall -Wextra -Wno-missing-field-initializers -Wno-initializer-overrides -Wno-unused -Wno-dollar-in-identifier-extension -Wno-deprecated-declarations -O2 -fPIC -DLUA_COMPAT_APIINTCASTS -I/Users/sharpobject/luas/luajit/include -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -I"/opt/homebrew/opt/openssl/include" -I"/opt/homebrew/opt/openssl/include" -DCOMPAT53_PREFIX=cqueues -DCQUEUES_VENDOR='"quae@daurnimator.com"' -DCQUEUES_VERSION=20200726L  -c -o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1/socket.o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/socket.c
cd /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src && m4 /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/errno.c.m4 >| /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/errno.c.tmp
mv /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/errno.c.tmp /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/errno.c
mkdir -p /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1
env MACOSX_DEPLOYMENT_TARGET=10.1 gcc -O2 -std=gnu99 -fPIC -g -Wall -Wextra -Wno-missing-field-initializers -Wno-initializer-overrides -Wno-unused -Wno-dollar-in-identifier-extension -Wno-deprecated-declarations -O2 -fPIC -DLUA_COMPAT_APIINTCASTS -I/Users/sharpobject/luas/luajit/include -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -I"/opt/homebrew/opt/openssl/include" -I"/opt/homebrew/opt/openssl/include" -DCOMPAT53_PREFIX=cqueues -DCQUEUES_VENDOR='"quae@daurnimator.com"' -DCQUEUES_VERSION=20200726L  -c -o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1/errno.o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/errno.c
mkdir -p /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1
env MACOSX_DEPLOYMENT_TARGET=10.1 gcc -O2 -std=gnu99 -fPIC -g -Wall -Wextra -Wno-missing-field-initializers -Wno-initializer-overrides -Wno-unused -Wno-dollar-in-identifier-extension -Wno-deprecated-declarations -O2 -fPIC -DLUA_COMPAT_APIINTCASTS -I/Users/sharpobject/luas/luajit/include -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -I"/opt/homebrew/opt/openssl/include" -I"/opt/homebrew/opt/openssl/include" -DCOMPAT53_PREFIX=cqueues -DCQUEUES_VENDOR='"quae@daurnimator.com"' -DCQUEUES_VERSION=20200726L  -c -o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1/signal.o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/signal.c
mkdir -p /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1
env MACOSX_DEPLOYMENT_TARGET=10.1 gcc -O2 -std=gnu99 -fPIC -g -Wall -Wextra -Wno-missing-field-initializers -Wno-initializer-overrides -Wno-unused -Wno-dollar-in-identifier-extension -Wno-deprecated-declarations -O2 -fPIC -DLUA_COMPAT_APIINTCASTS -I/Users/sharpobject/luas/luajit/include -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -I"/opt/homebrew/opt/openssl/include" -I"/opt/homebrew/opt/openssl/include" -DCOMPAT53_PREFIX=cqueues -DCQUEUES_VENDOR='"quae@daurnimator.com"' -DCQUEUES_VERSION=20200726L  -c -o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1/thread.o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/thread.c
mkdir -p /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1
env MACOSX_DEPLOYMENT_TARGET=10.1 gcc -O2 -std=gnu99 -fPIC -g -Wall -Wextra -Wno-missing-field-initializers -Wno-initializer-overrides -Wno-unused -Wno-dollar-in-identifier-extension -Wno-deprecated-declarations -O2 -fPIC -DLUA_COMPAT_APIINTCASTS -I/Users/sharpobject/luas/luajit/include -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -I"/opt/homebrew/opt/openssl/include" -I"/opt/homebrew/opt/openssl/include" -DCOMPAT53_PREFIX=cqueues -DCQUEUES_VENDOR='"quae@daurnimator.com"' -DCQUEUES_VERSION=20200726L  -c -o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1/notify.o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/notify.c
mkdir -p /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1
env MACOSX_DEPLOYMENT_TARGET=10.1 gcc -O2 -std=gnu99 -fPIC -g -Wall -Wextra -Wno-missing-field-initializers -Wno-initializer-overrides -Wno-unused -Wno-dollar-in-identifier-extension -Wno-deprecated-declarations -O2 -fPIC -DLUA_COMPAT_APIINTCASTS -I/Users/sharpobject/luas/luajit/include -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -I"/opt/homebrew/opt/openssl/include" -I"/opt/homebrew/opt/openssl/include" -DCOMPAT53_PREFIX=cqueues -DCQUEUES_VENDOR='"quae@daurnimator.com"' -DCQUEUES_VERSION=20200726L  -c -o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/5.1/dns.o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/dns.c
cp /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/config.h /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/lib/config.h
env MACOSX_DEPLOYMENT_TARGET=10.1 gcc -O2 -std=gnu99 -fPIC -g -Wall -Wextra -Wno-missing-field-initializers -Wno-initializer-overrides -Wno-unused -Wno-dollar-in-identifier-extension -Wno-deprecated-declarations -O2 -fPIC -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -I"/opt/homebrew/opt/openssl/include" -I"/opt/homebrew/opt/openssl/include" -DSOCKET_DEBUG -DHAVE_CONFIG_H -DDNS_RANDOM=arc4random -c -o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/lib/socket.o /private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/lib/socket.c
/private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/lib/socket.c:498:10: error:
      thread-local storage is not supported for the current target
                static __thread char sslstr[256];
                       ^
1 error generated.
make: *** [/private/var/folders/r6/qxrghn851t10cky46nrj7c7m0000gn/T/luarocks_cqueues-20200726.51-0-3477989/cqueues-rel-20200726/src/lib/socket.o] Error 1

Error: Build error: Failed building.
daurnimator commented 3 years ago

env MACOSX_DEPLOYMENT_TARGET=10.1

this is ancient. use a more recent osx target. i haven't checked lately but i think we need >10.8? but something like 10.13 is the minimum you should use in 2020.

sharpobject commented 3 years ago

I didn't attempt to configure that.

sharpobject commented 3 years ago

Ok, it looks like the issue is actually that Luarocks thinks that all versions of Mac OS will be 10.x: https://github.com/luarocks/luarocks/blob/d2c3b57b324f06d17cd2c594e26b143dfe3a8133/src/luarocks/core/cfg.lua#L459

So while this issue could be fixed in the cqueues rockfile (fixing only cqueues on 11.x), it should actually be fixed in luarocks (fixing all affected c rocks on 11.x).

Thanks for the help!

daurnimator commented 3 years ago

Yes that appears to be a luarocks bug https://github.com/luarocks/luarocks/issues/1238 You might be able to work around it on OSX with the magic env variable SYSTEM_VERSION_COMPAT=1