Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BLD: Enable Werror=undef in travis #17791

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

Merged
merged 1 commit into from
Dec 2, 2020
Merged

Conversation

seiko2plus
Copy link
Member

Enable Werror=undef in travis

The build didn't break in #17587 after moving a mediatory #definition into a separate pull-request.

Comment on lines +49 to +54
# activates '-Werror=undef' when DEBUG isn't enabled since _cffi_backend'
# extension breaks the build due to the following error:
#
# error: "HAVE_FFI_PREP_CIF_VAR" is not defined, evaluates to 0 [-Werror=undef]
# #if !HAVE_FFI_PREP_CIF_VAR && defined(__arm64__) && defined(__APPLE__)
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix this upstream? Where is this code coming from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. from PIP.

Build log
020-11-17T10:02:50.4635209Z Building wheels for collected packages: pickle5, cffi, coverage
2020-11-17T10:02:50.4639748Z   Building wheel for pickle5 (setup.py): started
2020-11-17T10:02:52.3399489Z   Building wheel for pickle5 (setup.py): finished with status 'done'
2020-11-17T10:02:52.3430515Z   Created wheel for pickle5: filename=pickle5-0.0.11-cp36-cp36dm-linux_x86_64.whl size=238491 sha256=12d4ffecfd50f38265f849b1b9de8d7689b99bae242da58a3b0445dc6f9cc99c
2020-11-17T10:02:52.3432447Z   Stored in directory: /home/runner/.cache/pip/wheels/f9/b7/be/bf9768ab0daa28fa4b386f3ad1bac5dd4d9c349c60e83b24e3
2020-11-17T10:02:52.3443881Z   Building wheel for cffi (setup.py): started
2020-11-17T10:02:54.1987594Z   Building wheel for cffi (setup.py): finished with status 'error'
2020-11-17T10:02:54.2000450Z   ERROR: Command errored out with exit status 1:
2020-11-17T10:02:54.2000814Z   Running setup.py clean for cffi
2020-11-17T10:02:54.2002803Z    command: /home/runner/work/numpy/numpy/builds/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eckmduhf/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eckmduhf/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-k9xhaw2w
2020-11-17T10:02:54.2004316Z        cwd: /tmp/pip-install-eckmduhf/cffi/
2020-11-17T10:02:54.2004802Z   Complete output (40 lines):
2020-11-17T10:02:54.2005203Z   running bdist_wheel
2020-11-17T10:02:54.2005765Z   running build
2020-11-17T10:02:54.2006106Z   running build_py
2020-11-17T10:02:54.2007022Z   creating build
2020-11-17T10:02:54.2008497Z   creating build/lib.linux-x86_64-3.6-pydebug
2020-11-17T10:02:54.2009644Z   creating build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2010867Z   copying cffi/api.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2012164Z   copying cffi/__init__.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2013467Z   copying cffi/verifier.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2014874Z   copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2016310Z   copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2017675Z   copying cffi/error.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2019049Z   copying cffi/commontypes.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2020487Z   copying cffi/recompiler.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2021874Z   copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2023228Z   copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2024535Z   copying cffi/lock.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2025851Z   copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2027147Z   copying cffi/model.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2029019Z   copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2030538Z   copying cffi/cparser.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2031214Z   copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2031897Z   copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2032862Z   copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2033524Z   copying cffi/_embedding.h -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2034188Z   copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:54.2034576Z   running build_ext
2020-11-17T10:02:54.2035008Z   building '_cffi_backend' extension
2020-11-17T10:02:54.2035505Z   creating build/temp.linux-x86_64-3.6-pydebug
2020-11-17T10:02:54.2036141Z   creating build/temp.linux-x86_64-3.6-pydebug/c
2020-11-17T10:02:54.2038915Z   x86_64-linux-gnu-gcc -pthread -g -Og -Wall -Wno-unused-result -Wsign-compare -g -Og -Wall -g -Og -fstack-protector-strong -Wformat -Werror=format-security -g -Og -fstack-protector-strong -Wformat -Werror=format-security -Werror=vla -Werror=nonnull -Werror=pointer-arith -Werror=implicit-function-declaration -Werror=undef -Wlogical-op -Wno-sign-compare -Wno-maybe-uninitialized -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/home/runner/work/numpy/numpy/builds/venv/include -I/usr/include/python3.6dm -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.6-pydebug/c/_cffi_backend.o
2020-11-17T10:02:54.2041263Z   c/_cffi_backend.c: In function ‘fb_prepare_cif’:
2020-11-17T10:02:54.2041941Z   c/_cffi_backend.c:5846:5: error: "HAVE_FFI_PREP_CIF_VAR" is not defined, evaluates to 0 [-Werror=undef]
2020-11-17T10:02:54.2042371Z    #if HAVE_FFI_PREP_CIF_VAR
2020-11-17T10:02:54.2042614Z        ^~~~~~~~~~~~~~~~~~~~~
2020-11-17T10:02:54.2043184Z   c/_cffi_backend.c:5853:6: error: "HAVE_FFI_PREP_CIF_VAR" is not defined, evaluates to 0 [-Werror=undef]
2020-11-17T10:02:54.2043698Z    #if !HAVE_FFI_PREP_CIF_VAR && defined(__arm64__) && defined(__APPLE__)
2020-11-17T10:02:54.2044004Z         ^~~~~~~~~~~~~~~~~~~~~
2020-11-17T10:02:54.2044285Z   cc1: some warnings being treated as errors
2020-11-17T10:02:54.2044856Z   error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
2020-11-17T10:02:54.2045311Z   ----------------------------------------
2020-11-17T10:02:54.2045711Z   ERROR: Failed building wheel for cffi
2020-11-17T10:02:54.6126794Z   Building wheel for coverage (setup.py): started
2020-11-17T10:02:55.3035313Z   Building wheel for coverage (setup.py): finished with status 'done'
2020-11-17T10:02:55.3074665Z   Created wheel for coverage: filename=coverage-5.3-py3-none-any.whl size=198277 sha256=858ccb99f75c86dc1551937130a359763f58af357d1d854fe5fe1e1f526751f4
2020-11-17T10:02:55.3076356Z   Stored in directory: /home/runner/.cache/pip/wheels/8f/13/79/fc07c17c9c60f93002139854095de6a2e49ccbbc4858b2004d
2020-11-17T10:02:55.3081333Z Successfully built pickle5 coverage
2020-11-17T10:02:55.3082756Z Failed to build cffi
2020-11-17T10:02:55.5410706Z Installing collected packages: sortedcontainers, attrs, hypothesis, zipp, importlib-metadata, pluggy, toml, py, more-itertools, iniconfig, six, pyparsing, packaging, pytest, pytz, coverage, pytest-cov, pickle5, pycparser, cffi, typing-extensions
2020-11-17T10:02:57.3873541Z     Running setup.py install for cffi: started
2020-11-17T10:02:59.2400337Z     Running setup.py install for cffi: finished with status 'error'
2020-11-17T10:02:59.2402994Z     ERROR: Command errored out with exit status 1:
2020-11-17T10:02:59.2408281Z      command: /home/runner/work/numpy/numpy/builds/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eckmduhf/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eckmduhf/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9c28po83/install-record.txt --single-version-externally-managed --compile --install-headers /home/runner/work/numpy/numpy/builds/venv/include/site/python3.6/cffi
2020-11-17T10:02:59.2411355Z          cwd: /tmp/pip-install-eckmduhf/cffi/
2020-11-17T10:02:59.2411918Z     Complete output (40 lines):
2020-11-17T10:02:59.2412332Z     running install
2020-11-17T10:02:59.2413011Z     running build
2020-11-17T10:02:59.2413373Z     running build_py
2020-11-17T10:02:59.2413739Z     creating build
2020-11-17T10:02:59.2414467Z     creating build/lib.linux-x86_64-3.6-pydebug
2020-11-17T10:02:59.2415276Z     creating build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2416171Z     copying cffi/api.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2417106Z     copying cffi/__init__.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2418223Z     copying cffi/verifier.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2419275Z     copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2420333Z     copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2421340Z     copying cffi/error.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2422349Z     copying cffi/commontypes.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2423409Z     copying cffi/recompiler.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2424429Z     copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2425427Z     copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2426375Z     copying cffi/lock.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2427348Z     copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2428329Z     copying cffi/model.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2429326Z     copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2430329Z     copying cffi/cparser.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2431341Z     copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2432361Z     copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2433362Z     copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2434357Z     copying cffi/_embedding.h -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2435340Z     copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.6-pydebug/cffi
2020-11-17T10:02:59.2435906Z     running build_ext
2020-11-17T10:02:59.2436555Z     building '_cffi_backend' extension
2020-11-17T10:02:59.2437335Z     creating build/temp.linux-x86_64-3.6-pydebug
2020-11-17T10:02:59.2438174Z     creating build/temp.linux-x86_64-3.6-pydebug/c
2020-11-17T10:02:59.2440855Z     x86_64-linux-gnu-gcc -pthread -g -Og -Wall -Wno-unused-result -Wsign-compare -g -Og -Wall -g -Og -fstack-protector-strong -Wformat -Werror=format-security -g -Og -fstack-protector-strong -Wformat -Werror=format-security -Werror=vla -Werror=nonnull -Werror=pointer-arith -Werror=implicit-function-declaration -Werror=undef -Wlogical-op -Wno-sign-compare -Wno-maybe-uninitialized -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/home/runner/work/numpy/numpy/builds/venv/include -I/usr/include/python3.6dm -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.6-pydebug/c/_cffi_backend.o
2020-11-17T10:02:59.2442872Z     c/_cffi_backend.c: In function ‘fb_prepare_cif’:
2020-11-17T10:02:59.2443478Z     c/_cffi_backend.c:5846:5: error: "HAVE_FFI_PREP_CIF_VAR" is not defined, evaluates to 0 [-Werror=undef]
2020-11-17T10:02:59.2443866Z      #if HAVE_FFI_PREP_CIF_VAR
2020-11-17T10:02:59.2444084Z          ^~~~~~~~~~~~~~~~~~~~~
2020-11-17T10:02:59.2444597Z     c/_cffi_backend.c:5853:6: error: "HAVE_FFI_PREP_CIF_VAR" is not defined, evaluates to 0 [-Werror=undef]
2020-11-17T10:02:59.2445046Z      #if !HAVE_FFI_PREP_CIF_VAR && defined(__arm64__) && defined(__APPLE__)
2020-11-17T10:02:59.2445318Z           ^~~~~~~~~~~~~~~~~~~~~
2020-11-17T10:02:59.2446552Z     cc1: some warnings being treated as errors
2020-11-17T10:02:59.2447093Z     error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
2020-11-17T10:02:59.2447622Z     ----------------------------------------
2020-11-17T10:02:59.2449936Z ERROR: Command errored out with exit status 1: /home/runner/work/numpy/numpy/builds/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eckmduhf/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eckmduhf/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9c28po83/install-record.txt --single-version-externally-managed --compile --install-headers /home/runner/work/numpy/numpy/builds/venv/include/site/python3.6/cffi Check the logs for full command output.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is part of cffi 1.14.3. It has been changed on HEAD.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused - is this line even building cffi? It looks like we're exporting something that we should maybe just be setting for a single command.

Copy link
Member

@eric-wieser eric-wieser Nov 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we're messing with the warnings used to install all our test packages on this line:

PYTHONOPTIMIZE="" $PIP install -r test_requirements.txt

We shouldn't be doing that, it just makes our CI fail if unrelated projects have compiler warnings.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This last comment seems unrelated to the PR, and PYTHONOPTIMIZE="" seems necessary? I don't have a problem with it - can always split out the pip install into more granular installs here is some new failure appears.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and seems like it caught quite a few errors. Thanks @seiko2plus

#endif
#ifndef NPY_RELAXED_STRIDES_DEBUG
#define NPY_RELAXED_STRIDES_DEBUG 0
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added NPY_USE_NEW_CASTINGIMPL in the meantime. We could probably also include it in numpy/core/setup.py so that it is all in one place (although it doesn't matter, easy enough to figure out if CI fails).

@mattip mattip merged commit c310f75 into numpy:master Dec 2, 2020
@mattip
Copy link
Member

mattip commented Dec 2, 2020

Thanks @seiko2plus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
36 - Build Build related PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants