Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile errors on ubuntu 16.04 #1262

Closed
scs3jb opened this issue May 24, 2016 · 15 comments
Closed

Compile errors on ubuntu 16.04 #1262

scs3jb opened this issue May 24, 2016 · 15 comments

Comments

@scs3jb
Copy link

scs3jb commented May 24, 2016

Running setup.py bdist_wheel for uwsgi
  Complete output from command /home/xyz/envs/x/bin/python2 -c "import setuptools;__file__='/tmp/pip-build-uj6nbl/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpu3SkMQpip-wheel-:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  copying uwsgidecorators.py -> build/lib.linux-x86_64-2.7
  installing to build/bdist.linux-x86_64/wheel
  running install
  In file included from /usr/include/fcntl.h:289:0,
                   from /usr/include/x86_64-linux-gnu/sys/file.h:24,
                   from ./uwsgi.h:263,
                   from core/utils.c:1:
  In function ‘open’,
      inlined from ‘uwsgi_tmpfd’ at core/utils.c:3495:5:
  /usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
      __open_missing_mode ();
      ^

  ----------------------------------------
  Failed building wheel for uwsgi
Failed to build uwsgi
Installing collected packages: uwsgi, ConcurrentLogHandler, MySQL-python, django-mailer-mod, django-databrowse, django-piston-mod, djangorestframework, PyYAML, django-rest-swagger, django-filter, drf-extensions, Pygments, docutils, MarkupSafe, Jinja2, Sphinx, drf-cache-keys, decrypterlib, python-memcached, markdown, requests, django-picklefield
  Running setup.py install for uwsgi
    Complete output from command /home/xyz/envs/x/bin/python2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-uj6nbl/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Cx6lOC-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/xyz/envs/x/include/site/python2.7/uwsgi:
    running install
    In file included from /usr/include/fcntl.h:289:0,
                     from /usr/include/x86_64-linux-gnu/sys/file.h:24,
                     from ./uwsgi.h:263,
                     from core/utils.c:1:
    In function ‘open’,
        inlined from ‘uwsgi_tmpfd’ at core/utils.c:3495:5:
    /usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
        __open_missing_mode ();
        ^

    ----------------------------------------
Command "/home/xyz/envs/x/bin/python2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-uj6nbl/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Cx6lOC-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/xyz/envs/x/include/site/python2.7/uwsgi" failed with error code 1 in /tmp/pip-build-uj6nbl/uwsgi

Looks like an issue with gcc?

@xrmx
Copy link
Collaborator

xrmx commented May 24, 2016

Thanks for reporting. Could you please tell us what version of uwsgi are you building?

@scs3jb
Copy link
Author

scs3jb commented May 24, 2016

This was 2.0.13, but it is the same error all the way back to 1.9.20.

Python 2.7.11+
 python2.7                                                            2.7.11-7ubuntu1                                     amd64
ii  gcc                                                                  4:5.3.1-1ubuntu1                                    amd64        GNU C compiler
ii  gcc-5                                                                5.3.1-14ubuntu2                                     amd64        GNU C compiler
ii  gcc-5-base:amd64                                                     5.3.1-14ubuntu2                                     amd64        GCC, the GNU Compiler Collection (base package)
ii  gcc-5-base:i386                                                      5.3.1-14ubuntu2                                     i386         GCC, the GNU Compiler Collection (base package)
ii  gcc-6-base:amd64                                                     6.0.1-0ubuntu1                                      amd64        GCC, the GNU Compiler Collection (base package)
ii  gcc-6-base:i386                                                      6.0.1-0ubuntu1                                      i386         GCC, the GNU Compiler Collection (base package)
ii  libcaca0:amd64                                                       0.99.beta19-2build2~gcc5.2                          amd64        colour ASCII art library
ii  libgcc-5-dev:amd64                                                   5.3.1-14ubuntu2                                     amd64        GCC support library (development files)
ii  libgcc1:amd64                                                        1:6.0.1-0ubuntu1                                    amd64        GCC support library
ii  libgcc1:i386                                                         1:6.0.1-0ubuntu1                                    i386         GCC support library

@xrmx
Copy link
Collaborator

xrmx commented May 24, 2016

@scs3jb open() call in uwsgi_tmpfd has the correct third argument here so looks like something bogus elsewhere.

@patroqueeet
Copy link

patroqueeet commented Jun 12, 2016

same here with ubuntu 16.04, virtualenv2.7 and plain pip install uwsgi

@patroqueeet
Copy link

my resolution was: remove pinned version 2.0.8 to latest stable

@b0ses
Copy link

b0ses commented Aug 23, 2016

If this helps anyone, the issue persisted in versions >=2.0 for me. 1.9 has installed successfully (the same setting as patroqueeet: ubuntu 16.04, virtualenv2.7)

@xrmx
Copy link
Collaborator

xrmx commented Aug 24, 2016

@b0ses what does gcc -v says? Have you tried creating a new virtualenv with python2.7? If you have another python version installed can you try with that one too?

@b0ses
Copy link

b0ses commented Aug 24, 2016

@xrmx
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1
16.04.2' --with-bugurl=file:///user/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id -libexecdir=/usr/lib --without-included-gettext -enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gjc-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i386 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x84_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2)

I am able to make a new virtual environment but I get the same error with 'sudo pip install uwsgi'. Python3 results in the same as well.

@b0ses
Copy link

b0ses commented Aug 30, 2016

As an update, I was able to install uwsgi 2.0.12 in mostly the same environment (virtualenv, ubuntu server 16, python 2.7) with the main differences being I had updated my pypi mirrors (working offline) and was on Ubuntu 16.04.1 instead of the previous 16.04.02.

@tkaah
Copy link

tkaah commented Oct 17, 2016

I'm getting the same error.

Environment:

  • Python 2.7.12+
  • Ubuntu 16.10
  • uwsgi 2.0.14
  • GCC 6.2.0

Any idea?

@xrmx
Copy link
Collaborator

xrmx commented Oct 17, 2016

@tkaah nope, works perfectly fine on debian sid with the same software:

rm@rieux:~/src$ virtualenv foo
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/rm/src/foo/bin/python2
Also creating executable in /home/rm/src/foo/bin/python
Installing setuptools, pkg_resources, pip, wheel....done.
rm@rieux:~/src$ ./foo/bin/pip install uwsgi
Collecting uwsgi
  Downloading uwsgi-2.0.14.tar.gz (788kB)
    100% |████████████████████████████████| 798kB 106kB/s 
Building wheels for collected packages: uwsgi
  Running setup.py bdist_wheel for uwsgi ... done
  Stored in directory: /home/rm/.cache/pip/wheels/c4/ad/56/f70a70b63fa4b0f2c0518db6f41381c9d33cd5cc5ac9a9494b
Successfully built uwsgi
Installing collected packages: uwsgi
Successfully installed uwsgi-2.0.14
rm@rieux:~/src$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.2.0-6' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.2.0 20161010 (Debian 6.2.0-6) 
rm@rieux:~/src$ python
Python 2.7.12+ (default, Sep  1 2016, 20:27:38) 
[GCC 6.2.0 20160927] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

@neilsh
Copy link

neilsh commented Nov 28, 2016

Using the Dockerfile below I was able to reproduce the compilation issue in versions up to uwsgi 2.0.10, although it succeeds in versions 2.0.11 and later.

FROM ubuntu:16.04  # also fails in 16.10, but succeeds with ubuntu:14.04

RUN apt-get update
RUN apt-get install -y -o APT::Install-Suggests=false python-pip gcc python-dev
RUN gcc -v
# RUN pip install pip==1.5.6  # fails/succeeds independent of pip version
RUN pip install uwsgi==2.0.10 # fails
# RUN pip install uwsgi==2.0.11 # succeeds

Looking at the 2.0.11 changelog, this fixed bug looks like a potential culprit, since 16.04 defaults to gcc-5 while 14.04 uses gcc-4.8:

https://github.com/unbit/uwsgi-docs/blob/master/Changelog-2.0.11.rst#bugfixes

fixed detection for gcc 5 (jimfunk)

Another potential culprit, since the issues are related to a function inlined from uwsgi_tmpfd:

fixed TMPFILE permissions

In any case, using a version >= 2.0.11 should resolve the problem.

@c-nichols
Copy link

Using clang was a successful workaround for me:

CC=`which clang` pip install -r requirements.txt

ssalonen pushed a commit to ssalonen/pywb-webrecorder that referenced this issue Apr 2, 2017
bogdanr added a commit to bogdanr/ansible-nginx-uwsgi-supervisor that referenced this issue May 15, 2017
It is necessary to specify version 2.0.15 for uwsgi to overcome a bug:
unbit/uwsgi#1262
@jnozsc
Copy link

jnozsc commented Feb 16, 2018

I can verify that @neilsh 's solution works.
do we want to close this ticket?
thank @neilsh

@xrmx
Copy link
Collaborator

xrmx commented Feb 16, 2018

@jnozsc yes we want!

@xrmx xrmx closed this as completed Feb 16, 2018
edulix added a commit to sequentech/election-orchestra that referenced this issue Oct 17, 2019
edulix added a commit to sequentech/frestq that referenced this issue Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants