Neopallium / nixio

System, Networking and I/O library for Lua. This is an unoffical fork of NIXO from: http://luci.subsignal.org/
http://neopallium.github.io/nixio/
Apache License 2.0
58 stars 23 forks source link

Build Fails on Mac OSX Lion #4

Closed andrewstarks closed 12 years ago

andrewstarks commented 12 years ago

Sad panda...

Using luarocks, I get the following build error:

Installing http://luarocks.org/repositories/rocks/nixio-0.3-1.src.rock... Using http://luarocks.org/repositories/rocks/nixio-0.3-1.src.rock... switching to 'build' mode Archive: /private/tmp/luarocks_luarocks-rock-nixio-0.3-1-1647/nixio-0.3-1.src.rock inflating: nixio-0.3-1.rockspec
inflating: nixio-0.3.tar.bz2
mkdir -p dist/usr/local/share/lua/5.1 cp -pR lua/* dist/usr/local/share/lua/5.1 2>/dev/null || true for i in $(find dist -name .svn); do rm -rf $i || true; done export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/nixio.o src/nixio.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/socket.o src/socket.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/sockopt.o src/sockopt.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/bind.o src/bind.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/address.o src/address.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/poll.o src/poll.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/io.o src/io.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/file.o src/file.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/splice.o src/splice.c cc1: warnings being treated as errors src/splice.c: In function ‘nixio_sendfile’: src/splice.c:143: warning: passing argument 4 of ‘sendfile’ makes pointer from integer without a cast src/splice.c:143: warning: passing argument 6 of ‘sendfile’ makes integer from pointer without a cast src/splice.c:143: error: too many arguments to function ‘sendfile’ make: *\ [src/splice.o] Error 1

Error: Build error: Failed building.

If i use the link directly on the from github, I get a different error:

mkdir -p dist/usr/local/share/lua/5.1 cp -pR lua/* dist/usr/local/share/lua/5.1 2>/dev/null || true for i in $(find dist -name .svn); do rm -rf $i || true; done export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/nixio.o src/nixio.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/socket.o src/socket.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/sockopt.o src/sockopt.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/bind.o src/bind.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/address.o src/address.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/poll.o src/poll.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/io.o src/io.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/file.o src/file.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/splice.o src/splice.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/process.o src/process.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/syslog.o src/syslog.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/bit.o src/bit.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/binary.o src/binary.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/fs.o src/fs.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/user.o src/user.c export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 --std=gnu99 -DDARWIN -Wall -Werror -pedantic -O2 -fPIC -I/usr/local/include/luajit-2.0 -fPIC -c -o src/tls-crypto.o src/tls-crypto.c In file included from /usr/include/openssl/ssl.h:173, from src/nixio-tls.h:8, from src/tls-crypto.c:19: /usr/include/AvailabilityMacros.h:109:14: error: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid. make: *\ [src/tls-crypto.o] Error 1

Error: Build error: Failed building.


How can I help?

andrewstarks commented 12 years ago

This has to do with Apple deprecating everything in openssl.

http://ludovicrousseau.blogspot.com/2011/08/mac-os-x-lion-and-openssl.html

I've disabled crypto from the make file. When I'm smarter, I'll replace apple's openssl or figure out how to migrate to their blessed replacement.

Perhaps it'd be better to automatically disable encryption in the rock spec or, better yet, use your bigger brain than mine to make it work... :P

Neopallium commented 12 years ago

The nixio version 0.3 module in luarocks is old and was release by someone else before I created this fork of nixio. I am not sure if the original authors of nixio are still maintaining nixio. It might upset someone if I tried to release a new luarock of nixio. Also I am working on a replacement network IO module lua-llnet, but it doesn't have support for TLS yet. until lua-llnet is ready I will try to maintain this fork of nixio.

For now I have disabled TLS support for Mac OSX. I don't see any easy way to add support for "Common Crypto".

You can install my fork of nixio with luarocks using this command: luarocks install https://raw.github.com/Neopallium/nixio/master/nixio-scm-0.rockspec

jcw commented 12 years ago

Just tried this - maybe Apple broke things again in Mountain Lion (10.8):

luarocks install https://raw.github.com/Neopallium/nixio/master/nixio-scm-0.rockspec
Using https://raw.github.com/Neopallium/nixio/master/nixio-scm-0.rockspec... switching to 'build' mode
Cloning into 'nixio'...
remote: Counting objects: 66, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 66 (delta 3), reused 54 (delta 3)
Receiving objects: 100% (66/66), 76.06 KiB, done.
Resolving deltas: 100% (3/3), done.
mkdir -p dist/usr/local/share/lua/5.1
cp -pR lua/* dist/usr/local/share/lua/5.1 2>/dev/null || true
for i in $(find dist -name .svn); do rm -rf $i || true; done
export MACOSX_DEPLOYMENT_TARGET=10.3; gcc  -O2 --std=gnu99 -D__DARWIN__ -Wall -Werror -pedantic -DNO_TLS -O2 -fPIC -I/usr/local/include -fPIC -c -o src/nixio.o src/nixio.c 
src/nixio.c:105: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘R’
cc1: warnings being treated as errors
src/nixio.c:109: warning: ISO C does not allow extra ‘;’ outside of a function
src/nixio.c: In function ‘luaopen_nixio’:
src/nixio.c:121: warning: implicit declaration of function ‘luaL_register’
src/nixio.c:121: error: ‘R’ undeclared (first use in this function)
src/nixio.c:121: error: (Each undeclared identifier is reported only once
src/nixio.c:121: error: for each function it appears in.)
make: *** [src/nixio.o] Error 1

Error: Build error: Failed building.

No urgency for me, since things work fine on Linux, but thought you might like to know.

Neopallium commented 12 years ago

Ok, I pushed a change that should fix that compile error.

jcw commented 12 years ago

Mea culpa: got another error, which didn't make sense at all. Diving in a bit deeper, I found out that I had a mix of 5.1 Lua binary and 5.2 headers. I've replaced everything with 5.1.5 and now it compiles just fine. Thank you for following up.