Compilation fails under GCC 6

Bug #1590459 reported by Calvinh34
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Degu
Fix Released
High
Jason Gerard DeRose

Bug Description

Hi,

when trying to install degu from pypi, the compilation fails with the following stacktrace

$ mkvirtualenv degu
Using base prefix '/usr'
New python executable in /home/goudale/.virtualenvs/degu/bin/python3
Also creating executable in /home/goudale/.virtualenvs/degu/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /home/goudale/.virtualenvs/degu/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/goudale/.virtualenvs/degu/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/goudale/.virtualenvs/degu/bin/preactivate
virtualenvwrapper.user_scripts creating /home/goudale/.virtualenvs/degu/bin/postactivate
virtualenvwrapper.user_scripts creating /home/goudale/.virtualenvs/degu/bin/get_env_details
$ pip install degu
Collecting degu
  Using cached degu-0.16.0.tar.gz
Building wheels for collected packages: degu
  Running setup.py bdist_wheel for degu ... error
  Complete output from command /home/goudale/.virtualenvs/degu/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3bpkw_7u/degu/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpzbzt8c8wpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  creating build/lib.linux-x86_64-3.5/degu
  copying degu/__init__.py -> build/lib.linux-x86_64-3.5/degu
  copying degu/_basepy.py -> build/lib.linux-x86_64-3.5/degu
  copying degu/applib.py -> build/lib.linux-x86_64-3.5/degu
  copying degu/base.py -> build/lib.linux-x86_64-3.5/degu
  copying degu/client.py -> build/lib.linux-x86_64-3.5/degu
  copying degu/misc.py -> build/lib.linux-x86_64-3.5/degu
  copying degu/rgi.py -> build/lib.linux-x86_64-3.5/degu
  copying degu/server.py -> build/lib.linux-x86_64-3.5/degu
  copying degu/sslhelpers.py -> build/lib.linux-x86_64-3.5/degu
  copying degu/tables.py -> build/lib.linux-x86_64-3.5/degu
  copying degu/util.py -> build/lib.linux-x86_64-3.5/degu
  creating build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/__init__.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/helpers.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/run.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/test_applib.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/test_base.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/test_basepy.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/test_client.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/test_misc.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/test_rgi.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/test_server.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/test_sslhelpers.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/test_tables.py -> build/lib.linux-x86_64-3.5/degu/tests
  copying degu/tests/test_util.py -> build/lib.linux-x86_64-3.5/degu/tests
  running build_ext
  building 'degu._base' extension
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/degu
  gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -I/usr/include/python3.5m -c degu/_base.c -o build/temp.linux-x86_64-3.5/degu/_base.o -Werror -Wall -Wsign-compare -Wsign-conversion -Wmissing-field-initializers -Wfatal-errors -std=gnu11 -pedantic-errors -Wpedantic
  In file included from degu/_base.c:24:0:
  degu/_base.c:133:20: erreur : ‘LF’ defined but not used [-Werror=unused-const-variable=]
   _DEGU_SRC_CONSTANT(LF, "\n")
                      ^
  degu/_base.h:136:20: note : in definition of macro ‘_DEGU_SRC_CONSTANT’
       static DeguSrc name = {(uint8_t *)text, sizeof(text) - 1};
                      ^~~~
  compilation terminée en raison de -Wfatal-errors.
  cc1 : les avertissements sont traités comme des erreurs
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for degu
  Running setup.py clean for degu
Failed to build degu
Installing collected packages: degu
  Running setup.py install for degu ... error
    Complete output from command /home/goudale/.virtualenvs/degu/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3bpkw_7u/degu/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-axtvf_62-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/goudale/.virtualenvs/degu/include/site/python3.5/degu:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/degu
    copying degu/__init__.py -> build/lib.linux-x86_64-3.5/degu
    copying degu/_basepy.py -> build/lib.linux-x86_64-3.5/degu
    copying degu/applib.py -> build/lib.linux-x86_64-3.5/degu
    copying degu/base.py -> build/lib.linux-x86_64-3.5/degu
    copying degu/client.py -> build/lib.linux-x86_64-3.5/degu
    copying degu/misc.py -> build/lib.linux-x86_64-3.5/degu
    copying degu/rgi.py -> build/lib.linux-x86_64-3.5/degu
    copying degu/server.py -> build/lib.linux-x86_64-3.5/degu
    copying degu/sslhelpers.py -> build/lib.linux-x86_64-3.5/degu
    copying degu/tables.py -> build/lib.linux-x86_64-3.5/degu
    copying degu/util.py -> build/lib.linux-x86_64-3.5/degu
    creating build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/__init__.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/helpers.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/run.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/test_applib.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/test_base.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/test_basepy.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/test_client.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/test_misc.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/test_rgi.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/test_server.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/test_sslhelpers.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/test_tables.py -> build/lib.linux-x86_64-3.5/degu/tests
    copying degu/tests/test_util.py -> build/lib.linux-x86_64-3.5/degu/tests
    running build_ext
    building 'degu._base' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/degu
    gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -I/usr/include/python3.5m -c degu/_base.c -o build/temp.linux-x86_64-3.5/degu/_base.o -Werror -Wall -Wsign-compare -Wsign-conversion -Wmissing-field-initializers -Wfatal-errors -std=gnu11 -pedantic-errors -Wpedantic
    In file included from degu/_base.c:24:0:
    degu/_base.c:133:20: erreur : ‘LF’ defined but not used [-Werror=unused-const-variable=]
     _DEGU_SRC_CONSTANT(LF, "\n")
                        ^
    degu/_base.h:136:20: note : in definition of macro ‘_DEGU_SRC_CONSTANT’
         static DeguSrc name = {(uint8_t *)text, sizeof(text) - 1};
                        ^~~~
    compilation terminée en raison de -Wfatal-errors.
    cc1 : les avertissements sont traités comme des erreurs
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/goudale/.virtualenvs/degu/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3bpkw_7u/degu/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-axtvf_62-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/goudale/.virtualenvs/degu/include/site/python3.5/degu" failed with error code 1 in /tmp/pip-build-3bpkw_7u/degu/

Please tell me if I can provide any extra information.
Arthur

Revision history for this message
Calvinh34 (calvinh34) wrote :

Anybody here ?

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

@Calvinh34 - deepest apologizes that I missed this bug! I guess I must have not noticed the email.

You're the first person to file a bug against Degu, which is quite exciting for me! So thank you very much for taking an interest in Degu!

Can you provide some more information about the Linux distro and version you're using, and in particular what GCC version?

Looking at the error you included, my guess is you're trying to compile Degu under GCC 6, which is stricter about unused globals, so the compilation fails. (If you look at setup.py, I use very strict compilation options, so all warnings are treated as fatal errors.)

If GCC 6 is the problem, I've fixed this in commit 431, which will be included in the yet-to-be-released Degu 0.17.

If you're up for trying it, I'm attaching a Degu 0.17 snapshot tarball. I'm pretty sure it will fix your compilation problem. If you try it out, I'd be grateful to hear your results either way.

Also, I should be releasing Degu 0.17 sometime next month (October). I really wanted to release it this month, but I've been too busy at work.

Apologies again that I missed this report for over 3 months! For what it's worth, the fact that you filed a bug report totally made my day :D

Changed in degu:
status: New → Incomplete
Revision history for this message
Calvinh34 (calvinh34) wrote :

Hi !

Yep, this patch fixed the installation. Thanks !

Linux tradescantia 4.7.2-1-ARCH #1 SMP PREEMPT Sat Aug 20 23:02:56 CEST 2016 x86_64 GNU/Linux

gcc (GCC) 6.2.1 20160830

(I wrpte a longer answer with full detailled shell trace, but lost it in the intertubes. Now I'm too lazy to do it again :) )

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Thank you very much for confirming the fix!

Considering more and more people will probably be trying Degu with GCC 6, I'll try to get Degu 0.17 out this month.

Thanks again!

Changed in degu:
assignee: nobody → Jason Gerard DeRose (jderose)
milestone: none → 0.17
status: Incomplete → Fix Committed
importance: Undecided → High
summary: - Compilation fails
+ Compilation fails under GCC 6
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Okay, I wrapped up the remaining work on Degu 0.17 and got it released!

It's already on PyPI - https://pypi.python.org/pypi/degu

Thanks again for the bug report!

Changed in degu:
status: Fix Committed → Fix Released
Revision history for this message
Calvinh34 (calvinh34) wrote :

Thanks for the update. I'll test the new release in my projects in the next few days.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

@Calvinh34 - FYI, I just released Degu 0.18:
https://pypi.python.org/pypi/degu/0.18.0

This release just focused on cleanup in the C extension and should have no breaking API changes.

I bring it up because I'd love to learn more about how you're using Degu. I'm not sure if using Degu has been more of a passing experiment for you or whether you're starting to truly depend on it... but my goal is certainly to make Degu something you can depend on :)

If you're serious about using Degu in your own projects, I'd love to use you as a sounding board for future Degu releases that might have breaking API changes. Also, if you have any ideas for improvements to Degu (whether or not they are API-breaking changes), I'd love to hear your thoughts.

Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.