Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.97k stars 11.35k forks source link

uWSGI 1.1.2 - Symbol not found problem #11705

Closed rochacon closed 12 years ago

rochacon commented 12 years ago

Hi. After upgrading the uWSGI to the last version, 1.1.2 I'm receiving this

~ $ uwsgi --version
dyld: Symbol not found: _environ
  Referenced from: /usr/local/lib/libpython2.7.dylib
  Expected in: dynamic lookup

Trace/BPT trap: 5

The build process shows no error:

~ $ brew install uwsgi
==> Downloading http://projects.unbit.it/downloads/uwsgi-1.1.2.tar.gz
Already downloaded: /Users/rochacon/Library/Caches/Homebrew/uwsgi-1.1.2.tar.gz
==> python uwsgiconfig.py --build
/usr/local/Cellar/uwsgi/1.1.2: 5 files, 488K, built in 11 seconds

I'm using the latest Python version: 2.7.3, also installed with Homebrew.

jacknagel commented 12 years ago

@adamv Fink is applying a patch for _environ access in python (it's buried in this huge patchfile):

http://fink.cvs.sourceforge.net/viewvc/fink/dists/10.4/stable/main/finkinfo/languages/python27.patch?revision=1.5&view=markup

adamv commented 12 years ago

If I remember from previous similar cases, the "fix" is to patch uwsgi, not Python, but it has been a while. But I could be wrong. We had been patching around _environ in some cases but stopped having to.

rochacon commented 12 years ago

Using this line:

CFLAGS="-Os -w -pipe -march=core2 -msse4 -arch x86_64" LDFLAGS="-arch x86_64" /usr/local/bin/pip install uwsgi

Compiled and installed uWSGI without any errors. How can I see the flags that Homebrew is using? Do Homebrew really need to patch anything in here?

This is the pip install output:

$ CFLAGS="-Os -w -pipe -march=core2 -msse4 -arch x86_64" LDFLAGS="-arch x86_64" /usr/local/bin/pip install uwsgi
Downloading/unpacking uwsgi
  Downloading uwsgi-1.1.2.tar.gz (497Kb): 497Kb downloaded
  Running setup.py egg_info for package uwsgi

Installing collected packages: uwsgi
  Running setup.py install for uwsgi
    clang: warning: argument unused during compilation: '-rdynamic'
    using profile: buildconf/default.ini
    detected include path: ['/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include', '/usr/local/include', '/usr/include', '/System/Library/Frameworks', '/Library/Frameworks']
    Patching "bin_name" to properly install_scripts dir
    configured CFLAGS: -O2 -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os -w -pipe -march=core2 -msse4 -arch x86_64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_BUILD_DATE="\"17 April 2012 19:58:16\"" -DUWSGI_HAS_IFADDRS -mmacosx-version-min=10.5 -DUWSGI_LOCK_USE_OSX_SPINLOCK -DUWSGI_EVENT_USE_KQUEUE -DUWSGI_EVENT_TIMER_USE_KQUEUE -DUWSGI_EVENT_FILEMONITOR_USE_KQUEUE -DUWSGI_EMBEDDED -DUWSGI_UDP -I/usr/local/Cellar/pcre/8.30/include -DUWSGI_PCRE -DUWSGI_ROUTING -DUWSGI_UUID -DUWSGI_VERSION="\"1.1.2\"" -DUWSGI_VERSION_BASE="1" -DUWSGI_VERSION_MAJOR="1" -DUWSGI_VERSION_MINOR="2" -DUWSGI_VERSION_REVISION="0" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_ASYNC -DUWSGI_MULTICAST -DUWSGI_MINTERPRETERS -DUWSGI_INI -DUWSGI_YAML -DUWSGI_LDAP -DUWSGI_SNMP -DUWSGI_THREADING -DUWSGI_SENDFILE -I/usr/include/libxml2 -DUWSGI_XML -DUWSGI_XML_LIBXML2 -DUWSGI_SQLITE3 -DUWSGI_PLUGIN_DIR=\".\" -DUWSGI_SPOOLER -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(fastrouter);UDEP(http);UDEP(ugreen);UDEP(signal);UDEP(syslog);UDEP(rsyslog);UDEP(logsocket);UDEP(router_uwsgi);UDEP(router_redirect);UDEP(router_basicauth);UDEP(zergpool);" -DUWSGI_LOAD_EMBEDDED_PLUGINS="ULEP(python);ULEP(ping);ULEP(cache);ULEP(nagios);ULEP(rrdtool);ULEP(carbon);ULEP(rpc);ULEP(fastrouter);ULEP(http);ULEP(ugreen);ULEP(signal);ULEP(syslog);ULEP(rsyslog);ULEP(logsocket);ULEP(router_uwsgi);ULEP(router_redirect);ULEP(router_basicauth);ULEP(zergpool);"
    *** uWSGI compiling server core ***
    [/usr/bin/clang] utils.o
    [/usr/bin/clang] protocol.o
    [/usr/bin/clang] socket.o
    [/usr/bin/clang] logging.o
    [/usr/bin/clang] master.o
    [/usr/bin/clang] master_utils.o
    [/usr/bin/clang] emperor.o
    [/usr/bin/clang] notify.o
    [/usr/bin/clang] mule.o
    [/usr/bin/clang] subscription.o
    [/usr/bin/clang] plugins.o
    [/usr/bin/clang] lock.o
    [/usr/bin/clang] cache.o
    [/usr/bin/clang] queue.o
    [/usr/bin/clang] event.o
    [/usr/bin/clang] signal.o
    [/usr/bin/clang] cluster.o
    [/usr/bin/clang] rpc.o
    [/usr/bin/clang] gateway.o
    [/usr/bin/clang] loop.o
    [/usr/bin/clang] lib/rbtree.o
    [/usr/bin/clang] lib/amqp.o
    [/usr/bin/clang] rb_timers.o
    [/usr/bin/clang] main.o
    [/usr/bin/clang] proto/base.o
    [/usr/bin/clang] proto/uwsgi.o
    [/usr/bin/clang] proto/http.o
    [/usr/bin/clang] proto/fastcgi.o
    [/usr/bin/clang] regexp.o
    [/usr/bin/clang] routing.o
    [/usr/bin/clang] async.o
    [/usr/bin/clang] ini.o
    [/usr/bin/clang] yaml.o
    [/usr/bin/clang] ldap.o
    [/usr/bin/clang] snmp.o
    [/usr/bin/clang] sendfile.o
    [/usr/bin/clang] xmlconf.o
    [/usr/bin/clang] sqlite3.o
    [/usr/bin/clang] spooler.o
    *** uWSGI compiling embedded plugins ***
    [/usr/bin/clang] plugins/python/python_plugin.o
    [/usr/bin/clang] plugins/python/pyutils.o
    [/usr/bin/clang] plugins/python/pyloader.o
    [/usr/bin/clang] plugins/python/wsgi_handlers.o
    [/usr/bin/clang] plugins/python/wsgi_headers.o
    [/usr/bin/clang] plugins/python/wsgi_subhandler.o
    [/usr/bin/clang] plugins/python/web3_subhandler.o
    [/usr/bin/clang] plugins/python/pump_subhandler.o
    [/usr/bin/clang] plugins/python/gil.o
    [/usr/bin/clang] plugins/python/uwsgi_pymodule.o
    [/usr/bin/clang] plugins/python/profiler.o
    [/usr/bin/clang] plugins/python/symimporter.o
    [/usr/bin/clang] plugins/ping/ping_plugin.o
    [/usr/bin/clang] plugins/cache/cache.o
    [/usr/bin/clang] plugins/nagios/nagios.o
    [/usr/bin/clang] plugins/rrdtool/rrdtool.o
    [/usr/bin/clang] plugins/carbon/carbon.o
    [/usr/bin/clang] plugins/rpc/rpc_plugin.o
    [/usr/bin/clang] plugins/fastrouter/fr_sctp.o
    [/usr/bin/clang] plugins/fastrouter/fr_map.o
    [/usr/bin/clang] plugins/fastrouter/fastrouter.o
    [/usr/bin/clang] plugins/fastrouter/fr_events.o
    [/usr/bin/clang] plugins/http/http.o
    [/usr/bin/clang] plugins/ugreen/ugreen.o
    [/usr/bin/clang] plugins/signal/signal_plugin.o
    [/usr/bin/clang] plugins/syslog/syslog_plugin.o
    [/usr/bin/clang] plugins/rsyslog/rsyslog_plugin.o
    [/usr/bin/clang] plugins/logsocket/logsocket_plugin.o
    [/usr/bin/clang] plugins/router_uwsgi/router_uwsgi.o
    [/usr/bin/clang] plugins/router_redirect/router_redirect.o
    [/usr/bin/clang] plugins/router_basicauth/router_basicauth.o
    [/usr/bin/clang] plugins/zergpool/zergpool.o
    *** uWSGI linking ***
    /usr/bin/clang -o /usr/local/share/python/uwsgi -arch x86_64 -L/usr/local/Cellar/python/2.7.3/lib utils.o protocol.o socket.o logging.o master.o master_utils.o emperor.o notify.o mule.o subscription.o plugins.o lock.o cache.o queue.o event.o signal.o cluster.o rpc.o gateway.o loop.o lib/rbtree.o lib/amqp.o rb_timers.o main.o proto/base.o proto/uwsgi.o proto/http.o proto/fastcgi.o regexp.o routing.o async.o ini.o yaml.o ldap.o snmp.o sendfile.o xmlconf.o sqlite3.o spooler.o plugins/python/python_plugin.o plugins/python/pyutils.o plugins/python/pyloader.o plugins/python/wsgi_handlers.o plugins/python/wsgi_headers.o plugins/python/wsgi_subhandler.o plugins/python/web3_subhandler.o plugins/python/pump_subhandler.o plugins/python/gil.o plugins/python/uwsgi_pymodule.o plugins/python/profiler.o plugins/python/symimporter.o plugins/ping/ping_plugin.o plugins/cache/cache.o plugins/nagios/nagios.o plugins/rrdtool/rrdtool.o plugins/carbon/carbon.o plugins/rpc/rpc_plugin.o plugins/fastrouter/fr_sctp.o plugins/fastrouter/fr_map.o plugins/fastrouter/fastrouter.o plugins/fastrouter/fr_events.o plugins/http/http.o plugins/ugreen/ugreen.o plugins/signal/signal_plugin.o plugins/syslog/syslog_plugin.o plugins/rsyslog/rsyslog_plugin.o plugins/logsocket/logsocket_plugin.o plugins/router_uwsgi/router_uwsgi.o plugins/router_redirect/router_redirect.o plugins/router_basicauth/router_basicauth.o plugins/zergpool/zergpool.o -lpthread -lm -rdynamic -L/usr/local/Cellar/pcre/8.30/lib -lpcre -lldap -lxml2 -lz -lpthread -licucore -lm -lsqlite3 -ldl -framework CoreFoundation -lpython2.7
    *** uWSGI is ready, launch it with /usr/local/share/python/uwsgi ***

Successfully installed uwsgi
Cleaning up...
$

BTW, I only have installed the Apple Command Line Tools.

jacknagel commented 12 years ago

If it can be easily installed from pip then it should probably be removed from Homebrew anyway.

Though I guess it's not really python software so maybe not.

jacknagel commented 12 years ago

If you can build it from source with the same CFLAGS then it must be a stripping issue.

I'll try with skip_clean and see if it works.

jacknagel commented 12 years ago

Yeah that was it. Fixed in ed5402b

rochacon commented 12 years ago

Cool! Thanks!