Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Python 3.8 build fails #124

Closed
HarrySky opened this issue Jun 14, 2019 · 12 comments
Closed

Python 3.8 build fails #124

HarrySky opened this issue Jun 14, 2019 · 12 comments

Comments

@HarrySky
Copy link

HarrySky commented Jun 14, 2019

After commit bd75088ea9b03df1618f1e0b8423a496412ae663 (I guess, because it changes _PyObject_FastCall related code) build fails with this message:

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -Iast3/Include -I/usr/local/include/python3.8 -c ast3/Python/ast.c -o build/temp.linux-x86_64-3.8/ast3/Python/ast.o
    ast3/Python/ast.c:22:1: error: conflicting types for '_PyObject_FastCall'
     _PyObject_FastCall(PyObject *func, PyObject *const *args, int nargs)
     ^~~~~~~~~~~~~~~~~~
    In file included from /usr/local/include/python3.8/abstract.h:837,
                     from /usr/local/include/python3.8/Python.h:147,
                     from ast3/Python/ast.c:6:
    /usr/local/include/python3.8/cpython/abstract.h:142:1: note: previous definition of '_PyObject_FastCall' was here
     _PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
     ^~~~~~~~~~~~~~~~~~

Environment: Docker Alpine 3.9 Python 3.8 (3.8-rc-alpine3.9)
Related bug report in Red Hat tracker

@gvanrossum
Copy link
Member

That's odd, since that definition in typed_ast's ast.c (at line 22) should not be used with Python 3.8. It is inside #if PY_MINOR_VERSION < 6.

What's the value of PY_MINOR_VERSION at that point? (Also, what version of Python 3.8 is being used? beta 1, or the head of upstream cpython's 3.8 branch? Though it probably doesn't matter.)

I cannot repro this in my own environment (Mac).

@apalala
Copy link

apalala commented Jun 15, 2019

I can confirm that the build fails with 3.8b1 over pip instally mypy.

@msullivan
Copy link
Collaborator

typed-ast 1.3.5 doesn't build on 3.8 but 1.4.0 does. The latest mypy release still depends on <1.4.0, though

@gvanrossum
Copy link
Member

So there's nothing for us to do here, right? This will right itself with the next mypy release. Until then, Red Hat can choose to patch mypy's setup.py to allow typed_ast 1.4.0.

@msullivan
Copy link
Collaborator

msullivan commented Jun 16, 2019 via email

@soffes
Copy link

soffes commented Feb 5, 2020

I ran into this because the latest brew install pre-commit depends on Python 3.8. Bumping mypy to v0.761 in .pre-commit-config.yaml fixed the problem for me.

@rnegron
Copy link

rnegron commented May 8, 2020

Thanks soffes, your solution worked for me :)

@stephensmithlyft
Copy link

@soffes Had a pre-commit problem, so I searched conflicting types for '_PyObject_FastCall' on Google, and followed the instructions at the first hit. It was an unexpected delight that the solution to my problems was provided by you! Hope you are well!

@cah-david-weirich
Copy link

Thank you @soffes ! This ended two days of headaches for me!

@jcomo
Copy link

jcomo commented Oct 17, 2020

Hello @stephensmithlyft and @soffes 👋 - I'm equally delighted to see both of you in this thread, and thanks Sam for the fix :)

@soffes
Copy link

soffes commented Oct 17, 2020

Haha hi @jcomo 😃

@stephensmithlyft
Copy link

Hi @jcomo and thanks again @soffes -- I had to repeat this fix in a different repository last week.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants