Uwsgi: Compile fails on macOS with LLVM version 9.0.0

Created on 28 Sep 2017  路  7Comments  路  Source: unbit/uwsgi

I get compile error on macOS 10.12.6:

uwsgi(master)$ git rev-parse HEAD
10d463797a5a06ac491e3c8fbd508ae76b2b334a
uwsgi(master)$ make
python uwsgiconfig.py --build
using profile: buildconf/default.ini
detected include path: ['/usr/local/include', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks']
detected CPU cores: 4
configured CFLAGS: -O2 -I. -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-format -Wno-format-security -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -mmacosx-version-min=10.5 -DUWSGI_LOCK_USE_OSX_SPINLOCK -DUWSGI_EVENT_USE_KQUEUE -DUWSGI_EVENT_TIMER_USE_KQUEUE -DUWSGI_EVENT_FILEMONITOR_USE_KQUEUE -I/usr/local/Cellar/pcre/8.40/include -DUWSGI_PCRE -DUWSGI_ROUTING -DUWSGI_UUID -DUWSGI_VERSION="\"2.1-dev-10d46379\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="1" -DUWSGI_VERSION_MINOR="0" -DUWSGI_VERSION_REVISION="0" -DUWSGI_VERSION_CUSTOM="\"dev-10d46379\"" -DUWSGI_YAML -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2 -DUWSGI_XML -DUWSGI_XML_LIBXML2 -DUWSGI_PLUGIN_DIR="\".\"" -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(gevent);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(corerouter);UDEP(fastrouter);UDEP(http);UDEP(signal);UDEP(syslog);UDEP(rsyslog);UDEP(logsocket);UDEP(router_uwsgi);UDEP(router_redirect);UDEP(router_basicauth);UDEP(zergpool);UDEP(redislog);UDEP(mongodblog);UDEP(router_rewrite);UDEP(router_http);UDEP(logfile);UDEP(router_cache);UDEP(rawrouter);UDEP(router_static);UDEP(sslrouter);UDEP(spooler);UDEP(cheaper_busyness);UDEP(symcall);UDEP(transformation_tofile);UDEP(transformation_gzip);UDEP(transformation_chunked);UDEP(transformation_offload);UDEP(router_memcached);UDEP(router_redis);UDEP(router_hash);UDEP(router_expires);UDEP(router_metrics);UDEP(transformation_template);UDEP(stats_pusher_socket);UDEP(router_fcgi);" -DUWSGI_LOAD_EMBEDDED_PLUGINS="ULEP(python);ULEP(gevent);ULEP(ping);ULEP(cache);ULEP(nagios);ULEP(rrdtool);ULEP(carbon);ULEP(rpc);ULEP(corerouter);ULEP(fastrouter);ULEP(http);ULEP(signal);ULEP(syslog);ULEP(rsyslog);ULEP(logsocket);ULEP(router_uwsgi);ULEP(router_redirect);ULEP(router_basicauth);ULEP(zergpool);ULEP(redislog);ULEP(mongodblog);ULEP(router_rewrite);ULEP(router_http);ULEP(logfile);ULEP(router_cache);ULEP(rawrouter);ULEP(router_static);ULEP(sslrouter);ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);ULEP(router_fcgi);"
*** uWSGI compiling server core ***
[thread 0][clang] core/utils.o
core/protocol.o is up to date
core/socket.o is up to date
core/logging.o is up to date
core/master.o is up to date
core/master_utils.o is up to date
[thread 2][clang] core/emperor.o
core/notify.o is up to date
[thread 3][clang] core/mule.o
[thread 1][clang] core/subscription.o
core/utils.c:3944:18: error: passing an object that undergoes default argument
      promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
                                va_start(ap, kv_separator);
                                             ^
core/utils.c:3901:73: note: parameter of type 'char' is declared here
  ...*src, size_t len, char list_separator, char kv_separator, ...) {
                                                 ^
1 error generated.
make: *** [all] Error 1

Environment:

$ which clang
/usr/bin/clang
$ clang --version
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Thanks,

Most helpful comment

I was having problems building 2.0.13.1, however uwsgi 2.0.15 builds fine with xcode9.

If you need to stay on 2.0.13.1, you can try building with CFLAGS="-Wno-error=varargs"

All 7 comments

I am also having this issue. I'm on macOS 10.12.6, with the same version of clang. Here is the error output:

  Running setup.py install for uwsgi ... error
    Complete output from command /Users/patrick/venv/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/k1/9vzfl55x32q9txsckgs4jpmc0000gn/T/pip-build-Rm8c_w/uwsgi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/k1/9vzfl55x32q9txsckgs4jpmc0000gn/T/pip-VUg18V-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/patrick/venv/include/site/python2.7/uwsgi:
    running install
    using profile: buildconf/default.ini
    detected include path: ['/usr/local/include', '/Library/Developer/CommandLineTools/usr/lib/clang/9.0.0/include', '/Library/Developer/CommandLineTools/usr/include', '/usr/include', '/System/Library/Frameworks', '/Library/Frameworks']
    Patching "bin_name" to properly install_scripts dir
    detected CPU cores: 4
    configured CFLAGS: -O2 -I. -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-format -Wno-format-security -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -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_UUID -DUWSGI_VERSION="\"2.0.11.2\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="11" -DUWSGI_VERSION_REVISION="2" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -I/usr/include/libxml2 -DUWSGI_XML -DUWSGI_XML_LIBXML2 -DUWSGI_PLUGIN_DIR="\".\"" -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(gevent);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(corerouter);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);UDEP(redislog);UDEP(mongodblog);UDEP(router_rewrite);UDEP(router_http);UDEP(logfile);UDEP(router_cache);UDEP(rawrouter);UDEP(router_static);UDEP(sslrouter);UDEP(spooler);UDEP(cheaper_busyness);UDEP(symcall);UDEP(transformation_tofile);UDEP(transformation_gzip);UDEP(transformation_chunked);UDEP(transformation_offload);UDEP(router_memcached);UDEP(router_redis);UDEP(router_hash);UDEP(router_expires);UDEP(router_metrics);UDEP(transformation_template);UDEP(stats_pusher_socket);" -DUWSGI_LOAD_EMBEDDED_PLUGINS="ULEP(python);ULEP(gevent);ULEP(ping);ULEP(cache);ULEP(nagios);ULEP(rrdtool);ULEP(carbon);ULEP(rpc);ULEP(corerouter);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);ULEP(redislog);ULEP(mongodblog);ULEP(router_rewrite);ULEP(router_http);ULEP(logfile);ULEP(router_cache);ULEP(rawrouter);ULEP(router_static);ULEP(sslrouter);ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);"
    *** uWSGI compiling server core ***
    [thread 1][cc] core/utils.o
    [thread 2][cc] core/protocol.o
    [thread 3][cc] core/socket.o
    [thread 0][cc] core/logging.o
    core/utils.c:3866:18: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
                                    va_start(ap, kv_separator);
                                                 ^
    core/utils.c:3823:73: note: parameter of type 'char' is declared here
    int uwsgi_kvlist_parse(char *src, size_t len, char list_separator, char kv_separator, ...) {
                                                                            ^
    1 error generated.

I downgraded Xcode to 8.3.3, as outlined here.

I also had to uninstall the command line tools, as outlined here and install manually an older version as outlined here.

After this, clang --version reports Apple LLVM version 8.1.0 (clang-802.0.38). With this version of clang, uwsgi 2.0.11.2 was able to be installed.

I'm also running into this problem. Same error, same version of clang. Going to try downgrading Xcode.

I ran into this problem as well. After downgrading to Xcode 8.3.3 I was able to install uwsgi 2.0.13.1.

I was able to get it to work by leaving the current version of Xcode installed and just installing Command Line Tools for Xcode 8.3.2 (found here). After installing, I updated my PATH with export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH. Afterward, uwsgi installed successfully.

I was having problems building 2.0.13.1, however uwsgi 2.0.15 builds fine with xcode9.

If you need to stay on 2.0.13.1, you can try building with CFLAGS="-Wno-error=varargs"

Can confirm. I was trying to install version 2.0.12 and it did not work. Running the most up-to-date version at the moment (2.0.17) worked well.

I'm using High Sierra (10.13.3), Xcode v9.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ercwyne picture ercwyne  路  4Comments

cancan101 picture cancan101  路  4Comments

dennylab picture dennylab  路  6Comments

diwu1989 picture diwu1989  路  7Comments

bhaskarsai picture bhaskarsai  路  4Comments