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

Add workaround for frequent Travis build failures during Cython compilation. #216

Merged
merged 1 commit into from
Dec 16, 2014

Conversation

mdickinson
Copy link
Member

We're seeing frequent Travis failures due to Cython build problems. An example is below (from this build).

This PR works around this problem in the manner suggested by Nathaniel Smith.

gcc -pthread -shared -L/opt/python/3.2.5/lib -Wl,-rpath=/opt/python/3.2.5/lib build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Plex/Scanners.o -L/opt/python/3.2.5/lib -lpython3.2mu -o build/lib.linux-x86_64-3.2/Cython/Plex/Scanners.cpython-32mu.so

skipping '/home/travis/virtualenv/python3.2.5/build/cython/Cython/Plex/Actions.c' Cython extension (up-to-date)

building 'Cython.Plex.Actions' extension

gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -I/opt/python/3.2.5/include/python3.2mu -c /home/travis/virtualenv/python3.2.5/build/cython/Cython/Plex/Actions.c -o build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Plex/Actions.o

gcc -pthread -shared -L/opt/python/3.2.5/lib -Wl,-rpath=/opt/python/3.2.5/lib build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Plex/Actions.o -L/opt/python/3.2.5/lib -lpython3.2mu -o build/lib.linux-x86_64-3.2/Cython/Plex/Actions.cpython-32mu.so

skipping '/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Lexicon.c' Cython extension (up-to-date)

building 'Cython.Compiler.Lexicon' extension

creating build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler

gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -I/opt/python/3.2.5/include/python3.2mu -c /home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Lexicon.c -o build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Lexicon.o

gcc -pthread -shared -L/opt/python/3.2.5/lib -Wl,-rpath=/opt/python/3.2.5/lib build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Lexicon.o -L/opt/python/3.2.5/lib -lpython3.2mu -o build/lib.linux-x86_64-3.2/Cython/Compiler/Lexicon.cpython-32mu.so

skipping '/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Scanning.c' Cython extension (up-to-date)

building 'Cython.Compiler.Scanning' extension

gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -I/opt/python/3.2.5/include/python3.2mu -c /home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Scanning.c -o build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Scanning.o

gcc -pthread -shared -L/opt/python/3.2.5/lib -Wl,-rpath=/opt/python/3.2.5/lib build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Scanning.o -L/opt/python/3.2.5/lib -lpython3.2mu -o build/lib.linux-x86_64-3.2/Cython/Compiler/Scanning.cpython-32mu.so

skipping '/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Parsing.c' Cython extension (up-to-date)

building 'Cython.Compiler.Parsing' extension

gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -I/opt/python/3.2.5/include/python3.2mu -c /home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Parsing.c -o build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Parsing.o

gcc -pthread -shared -L/opt/python/3.2.5/lib -Wl,-rpath=/opt/python/3.2.5/lib build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Parsing.o -L/opt/python/3.2.5/lib -lpython3.2mu -o build/lib.linux-x86_64-3.2/Cython/Compiler/Parsing.cpython-32mu.so

skipping '/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Visitor.c' Cython extension (up-to-date)

building 'Cython.Compiler.Visitor' extension

gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -I/opt/python/3.2.5/include/python3.2mu -c /home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Visitor.c -o build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Visitor.o

gcc -pthread -shared -L/opt/python/3.2.5/lib -Wl,-rpath=/opt/python/3.2.5/lib build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Visitor.o -L/opt/python/3.2.5/lib -lpython3.2mu -o build/lib.linux-x86_64-3.2/Cython/Compiler/Visitor.cpython-32mu.so

skipping '/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/FlowControl.c' Cython extension (up-to-date)

building 'Cython.Compiler.FlowControl' extension

gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -I/opt/python/3.2.5/include/python3.2mu -c /home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/FlowControl.c -o build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/FlowControl.o

gcc -pthread -shared -L/opt/python/3.2.5/lib -Wl,-rpath=/opt/python/3.2.5/lib build/temp.linux-x86_64-3.2/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/FlowControl.o -L/opt/python/3.2.5/lib -lpython3.2mu -o build/lib.linux-x86_64-3.2/Cython/Compiler/FlowControl.cpython-32mu.so

cythoning /home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Code.py to /home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Code.c

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/home/travis/virtualenv/python3.2.5/build/cython/setup.py", line 337, in <module>

    **setup_args

  File "/opt/python/3.2.5/lib/python3.2/distutils/core.py", line 148, in setup

    dist.run_commands()

  File "/opt/python/3.2.5/lib/python3.2/distutils/dist.py", line 917, in run_commands

    self.run_command(cmd)

  File "/opt/python/3.2.5/lib/python3.2/distutils/dist.py", line 936, in run_command

    cmd_obj.run()

  File "/home/travis/virtualenv/python3.2.5/lib/python3.2/site-packages/setuptools/command/install.py", line 54, in run

    return _install.run(self)

  File "/opt/python/3.2.5/lib/python3.2/distutils/command/install.py", line 569, in run

    self.run_command('build')

  File "/opt/python/3.2.5/lib/python3.2/distutils/cmd.py", line 313, in run_command

    self.distribution.run_command(command)

  File "/opt/python/3.2.5/lib/python3.2/distutils/dist.py", line 936, in run_command

    cmd_obj.run()

  File "/opt/python/3.2.5/lib/python3.2/distutils/command/build.py", line 126, in run

    self.run_command(cmd_name)

  File "/opt/python/3.2.5/lib/python3.2/distutils/cmd.py", line 313, in run_command

    self.distribution.run_command(command)

  File "/opt/python/3.2.5/lib/python3.2/distutils/dist.py", line 936, in run_command

    cmd_obj.run()

  File "Cython/Distutils/build_ext.py", line 163, in run

    _build_ext.build_ext.run(self)

  File "/opt/python/3.2.5/lib/python3.2/distutils/command/build_ext.py", line 344, in run

    self.build_extensions()

  File "/home/travis/virtualenv/python3.2.5/build/cython/setup.py", line 169, in build_extensions

    build_ext_orig.build_extensions(self)

  File "Cython/Distutils/build_ext.py", line 170, in build_extensions

    ext.sources = self.cython_sources(ext.sources, ext)

  File "Cython/Distutils/build_ext.py", line 319, in cython_sources

    full_module_name=module_name)

  File "/home/travis/virtualenv/python3.2.5/build/cython/build/lib.linux-x86_64-3.2/Cython/Compiler/Main.py", line 627, in compile

    return compile_single(source, options, full_module_name)

  File "/home/travis/virtualenv/python3.2.5/build/cython/build/lib.linux-x86_64-3.2/Cython/Compiler/Main.py", line 580, in compile_single

    return run_pipeline(source, options, full_module_name)

  File "/home/travis/virtualenv/python3.2.5/build/cython/build/lib.linux-x86_64-3.2/Cython/Compiler/Main.py", line 406, in run_pipeline

    context = options.create_context()

  File "/home/travis/virtualenv/python3.2.5/build/cython/build/lib.linux-x86_64-3.2/Cython/Compiler/Main.py", line 527, in create_context

    self.cplus, self.language_level, options=self)

  File "/home/travis/virtualenv/python3.2.5/build/cython/build/lib.linux-x86_64-3.2/Cython/Compiler/Main.py", line 69, in __init__

    from . import Builtin, CythonScope

  File "/home/travis/virtualenv/python3.2.5/build/cython/build/lib.linux-x86_64-3.2/Cython/Compiler/CythonScope.py", line 5, in <module>

    from .UtilityCode import CythonUtilityCode

  File "/home/travis/virtualenv/python3.2.5/build/cython/build/lib.linux-x86_64-3.2/Cython/Compiler/UtilityCode.py", line 3, in <module>

    from .TreeFragment import parse_from_strings, StringParseContext

  File "/home/travis/virtualenv/python3.2.5/build/cython/build/lib.linux-x86_64-3.2/Cython/Compiler/TreeFragment.py", line 20, in <module>

    from . import Parsing

  File "Cython/Plex/Actions.pxd", line 2, in init Cython.Compiler.Parsing (/home/travis/virtualenv/python3.2.5/build/cython/Cython/Compiler/Parsing.c:55686)

    cdef class Action:

ValueError: Cython.Plex.Actions.Action has the wrong size, try recompiling

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling d98ba5c on fix/travis-cython-failures into 676a69c on master.

@mdickinson
Copy link
Member Author

Looks like this change also halved our Travis CI runtimes! Most of the recent runs have taken longer than 20 minutes; this one took less than 10.

@corranwebster
Copy link
Contributor

We're trusting that the pure Python version of Cython produced output identical to the behaviour of the compiled version (when it doesn't crash!), which makes me a little bit twitchy, since we will almost always be using .c produced by the compiled version in production.

But from a practical standpoint, this seems like the right thing to do at the moment.

corranwebster added a commit that referenced this pull request Dec 16, 2014
Add workaround for frequent Travis build failures during Cython compilation.
@corranwebster corranwebster merged commit 1996d8c into master Dec 16, 2014
@corranwebster corranwebster deleted the fix/travis-cython-failures branch December 16, 2014 09:50
@mdickinson
Copy link
Member Author

Agreed; it's a workaround, and should probably be reverted once the underlying Cython bug (or whatever it turns out to be) is fixed. Though it'll be hard to give up the 100% faster Travis CI runs...

corranwebster added a commit to enthought/chaco that referenced this pull request Dec 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants