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

Building wheel in python 3.10a7 fail during installation #159

Closed
Pierre-Sassoulas opened this issue Apr 11, 2021 · 3 comments
Closed

Building wheel in python 3.10a7 fail during installation #159

Pierre-Sassoulas opened this issue Apr 11, 2021 · 3 comments

Comments

@Pierre-Sassoulas
Copy link

The error seems to be coming from: error: unknown type name ‘PyArena’

Here's the full output in pylint CI:

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iast27/Include -I/home/runner/work/pylint/pylint/venv/include -I/opt/hostedtoolcache/Python/3.10.0-alpha.7/x64/include/python3.10 -c ast27/Custom/typed_ast.c -o build/temp.linux-x86_64-3.10/ast27/Custom/typed_ast.o
  In file included from ast27/Custom/../Include/Python-ast.h:3,
                   from ast27/Custom/typed_ast.c:2:
  ast27/Custom/../Include/../Include/asdl.h:32:41: error: unknown type name ‘PyArena’
     32 | asdl_seq *asdl_seq_new(Py_ssize_t size, PyArena *arena);
        |                                         ^~~~~~~
  ast27/Custom/../Include/../Include/asdl.h:33:49: error: unknown type name ‘PyArena’
     33 | asdl_int_seq *asdl_int_seq_new(Py_ssize_t size, PyArena *arena);
        |                                                 ^~~~~~~
  In file included from ast27/Custom/typed_ast.c:2:
  ast27/Custom/../Include/Python-ast.h:398:63: error: unknown type name ‘PyArena’
    398 | mod_ty _Ta27_Module(asdl_seq * body, asdl_seq * type_ignores, PyArena *arena);
        |                                                               ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:400:43: error: unknown type name ‘PyArena’
    400 | mod_ty _Ta27_Interactive(asdl_seq * body, PyArena *arena);
        |                                           ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:402:39: error: unknown type name ‘PyArena’
    402 | mod_ty _Ta27_Expression(expr_ty body, PyArena *arena);
        |                                       ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:404:65: error: unknown type name ‘PyArena’
    404 | mod_ty _Ta27_FunctionType(asdl_seq * argtypes, expr_ty returns, PyArena *arena);
        |                                                                 ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:406:37: error: unknown type name ‘PyArena’
    406 | mod_ty _Ta27_Suite(asdl_seq * body, PyArena *arena);
        |                                     ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:409:92: error: unknown type name ‘PyArena’
    409 |                           decorator_list, string type_comment, int lineno, int col_offset, PyArena
        |                                                                                            ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:413:68: error: unknown type name ‘PyArena’
    413 |                        decorator_list, int lineno, int col_offset, PyArena *arena);
        |                                                                    ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:415:65: error: unknown type name ‘PyArena’
    415 | stmt_ty _Ta27_Return(expr_ty value, int lineno, int col_offset, PyArena *arena);
        |                                                                 ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:417:70: error: unknown type name ‘PyArena’
    417 | stmt_ty _Ta27_Delete(asdl_seq * targets, int lineno, int col_offset, PyArena *arena);
        |                                                                      ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:420:34: error: unknown type name ‘PyArena’
    420 |                      col_offset, PyArena *arena);
        |                                  ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:423:25: error: unknown type name ‘PyArena’
    423 |                         PyArena *arena);
        |                         ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:425:91: error: unknown type name ‘PyArena’
    425 | stmt_ty _Ta27_Print(expr_ty dest, asdl_seq * values, bool nl, int lineno, int col_offset, PyArena
        |                                                                                           ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:429:61: error: unknown type name ‘PyArena’
    429 |                   type_comment, int lineno, int col_offset, PyArena *arena);
        |                                                             ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:432:21: error: unknown type name ‘PyArena’
    432 |                     PyArena *arena);
        |                     ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:435:18: error: unknown type name ‘PyArena’
    435 |                  PyArena *arena);
        |                  ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:438:62: error: unknown type name ‘PyArena’
    438 |                    type_comment, int lineno, int col_offset, PyArena *arena);
        |                                                              ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:440:92: error: unknown type name ‘PyArena’
    440 | stmt_ty _Ta27_Raise(expr_ty type, expr_ty inst, expr_ty tback, int lineno, int col_offset, PyArena
        |                                                                                            ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:444:37: error: unknown type name ‘PyArena’
    444 |                         col_offset, PyArena *arena);
        |                                     ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:446:93: error: unknown type name ‘PyArena’
    446 | stmt_ty _Ta27_TryFinally(asdl_seq * body, asdl_seq * finalbody, int lineno, int col_offset, PyArena
        |                                                                                             ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:449:77: error: unknown type name ‘PyArena’
    449 | stmt_ty _Ta27_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, PyArena *arena);
        |                                                                             ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:451:68: error: unknown type name ‘PyArena’
    451 | stmt_ty _Ta27_Import(asdl_seq * names, int lineno, int col_offset, PyArena *arena);
        |                                                                    ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:454:38: error: unknown type name ‘PyArena’
    454 |                          col_offset, PyArena *arena);
        |                                      ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:457:20: error: unknown type name ‘PyArena’
    457 |                    PyArena *arena);
        |                    ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:459:68: error: unknown type name ‘PyArena’
    459 | stmt_ty _Ta27_Global(asdl_seq * names, int lineno, int col_offset, PyArena *arena);
        |                                                                    ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:461:63: error: unknown type name ‘PyArena’
    461 | stmt_ty _Ta27_Expr(expr_ty value, int lineno, int col_offset, PyArena *arena);
        |                                                               ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:463:48: error: unknown type name ‘PyArena’
    463 | stmt_ty _Ta27_Pass(int lineno, int col_offset, PyArena *arena);
        |                                                ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:465:49: error: unknown type name ‘PyArena’
    465 | stmt_ty _Ta27_Break(int lineno, int col_offset, PyArena *arena);
        |                                                 ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:467:52: error: unknown type name ‘PyArena’
    467 | stmt_ty _Ta27_Continue(int lineno, int col_offset, PyArena *arena);
        |                                                    ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:469:83: error: unknown type name ‘PyArena’
    469 | expr_ty _Ta27_BoolOp(boolop_ty op, asdl_seq * values, int lineno, int col_offset, PyArena *arena);
        |                                                                                   ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:472:21: error: unknown type name ‘PyArena’
    472 |                     PyArena *arena);
        |                     ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:474:83: error: unknown type name ‘PyArena’
    474 | expr_ty _Ta27_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, PyArena *arena);
        |                                                                                   ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:476:83: error: unknown type name ‘PyArena’
    476 | expr_ty _Ta27_Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, PyArena *arena);
        |                                                                                   ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:478:93: error: unknown type name ‘PyArena’
    478 | expr_ty _Ta27_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int col_offset, PyArena
        |                                                                                             ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:481:84: error: unknown type name ‘PyArena’
    481 | expr_ty _Ta27_Dict(asdl_seq * keys, asdl_seq * values, int lineno, int col_offset, PyArena *arena);
        |                                                                                    ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:483:64: error: unknown type name ‘PyArena’
    483 | expr_ty _Ta27_Set(asdl_seq * elts, int lineno, int col_offset, PyArena *arena);
        |                                                                ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:485:88: error: unknown type name ‘PyArena’
    485 | expr_ty _Ta27_ListComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, PyArena
        |                                                                                        ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:488:87: error: unknown type name ‘PyArena’
    488 | expr_ty _Ta27_SetComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, PyArena
        |                                                                                       ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:492:36: error: unknown type name ‘PyArena’
    492 |                        col_offset, PyArena *arena);
        |                                    ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:494:92: error: unknown type name ‘PyArena’
    494 | expr_ty _Ta27_GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, PyArena
        |                                                                                            ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:497:64: error: unknown type name ‘PyArena’
    497 | expr_ty _Ta27_Yield(expr_ty value, int lineno, int col_offset, PyArena *arena);
        |                                                                ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:500:35: error: unknown type name ‘PyArena’
    500 |                       col_offset, PyArena *arena);
        |                                   ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:503:56: error: unknown type name ‘PyArena’
    503 |                    kwargs, int lineno, int col_offset, PyArena *arena);
        |                                                        ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:505:63: error: unknown type name ‘PyArena’
    505 | expr_ty _Ta27_Repr(expr_ty value, int lineno, int col_offset, PyArena *arena);
        |                                                               ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:507:57: error: unknown type name ‘PyArena’
    507 | expr_ty _Ta27_Num(object n, int lineno, int col_offset, PyArena *arena);
        |                                                         ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:509:70: error: unknown type name ‘PyArena’
    509 | expr_ty _Ta27_Str(string s, string kind, int lineno, int col_offset, PyArena *arena);
        |                                                                      ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:512:37: error: unknown type name ‘PyArena’
    512 |                         col_offset, PyArena *arena);
        |                                     ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:515:37: error: unknown type name ‘PyArena’
    515 |                         col_offset, PyArena *arena);
        |                                     ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:517:84: error: unknown type name ‘PyArena’
    517 | expr_ty _Ta27_Name(identifier id, expr_context_ty ctx, int lineno, int col_offset, PyArena *arena);
        |                                                                                    ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:519:86: error: unknown type name ‘PyArena’
    519 | expr_ty _Ta27_List(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset, PyArena
        |                                                                                      ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:522:87: error: unknown type name ‘PyArena’
    522 | expr_ty _Ta27_Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset, PyArena
        |                                                                                       ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:525:25: error: unknown type name ‘PyArena’
    525 | slice_ty _Ta27_Ellipsis(PyArena *arena);
        |                         ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:527:66: error: unknown type name ‘PyArena’
    527 | slice_ty _Ta27_Slice(expr_ty lower, expr_ty upper, expr_ty step, PyArena *arena);
        |                                                                  ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:529:42: error: unknown type name ‘PyArena’
    529 | slice_ty _Ta27_ExtSlice(asdl_seq * dims, PyArena *arena);
        |                                          ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:531:37: error: unknown type name ‘PyArena’
    531 | slice_ty _Ta27_Index(expr_ty value, PyArena *arena);
        |                                     ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:533:84: error: unknown type name ‘PyArena’
    533 | comprehension_ty _Ta27_comprehension(expr_ty target, expr_ty iter, asdl_seq * ifs, PyArena *arena);
        |                                                                                    ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:536:50: error: unknown type name ‘PyArena’
    536 |                                      col_offset, PyArena *arena);
        |                                                  ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:539:66: error: unknown type name ‘PyArena’
    539 |                              defaults, asdl_seq * type_comments, PyArena *arena);
        |                                                                  ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:541:57: error: unknown type name ‘PyArena’
    541 | keyword_ty _Ta27_keyword(identifier arg, expr_ty value, PyArena *arena);
        |                                                         ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:543:58: error: unknown type name ‘PyArena’
    543 | alias_ty _Ta27_alias(identifier name, identifier asname, PyArena *arena);
        |                                                          ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:545:57: error: unknown type name ‘PyArena’
    545 | type_ignore_ty _Ta27_TypeIgnore(int lineno, string tag, PyArena *arena);
        |                                                         ^~~~~~~
  ast27/Custom/../Include/Python-ast.h:548:39: error: unknown type name ‘PyArena’
    548 | mod_ty Ta27AST_obj2mod(PyObject* ast, PyArena* arena, int mode);
        |                                       ^~~~~~~
  In file included from ast27/Custom/typed_ast.c:7:
  ast27/Custom/../Include/ast.h:8:21: error: unknown type name ‘PyArena’
      8 |       const char *, PyArena *);
        |                     ^~~~~~~
  ast27/Custom/typed_ast.c:210:54: error: unknown type name ‘PyArena’
    210 |                              PyCompilerFlags *flags, PyArena *arena)
        |                                                      ^~~~~~~
  ast27/Custom/typed_ast.c: In function ‘string_object_to_py_ast’:
  ast27/Custom/typed_ast.c:244:5: error: unknown type name ‘PyArena’
    244 |     PyArena *arena = PyArena_New();
        |     ^~~~~~~
  ast27/Custom/typed_ast.c:244:22: warning: implicit declaration of function ‘PyArena_New’; did you mean ‘PyGen_New’? [-Wimplicit-function-declaration]
    244 |     PyArena *arena = PyArena_New();
        |                      ^~~~~~~~~~~
        |                      PyGen_New
  ast27/Custom/typed_ast.c:244:22: warning: initialization of ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  ast27/Custom/typed_ast.c:248:11: warning: implicit declaration of function ‘string_object_to_c_ast’; did you mean ‘string_object_to_py_ast’? [-Wimplicit-function-declaration]
    248 |     mod = string_object_to_c_ast(str, filename, start, flags, arena);
        |           ^~~~~~~~~~~~~~~~~~~~~~
        |           string_object_to_py_ast
  ast27/Custom/typed_ast.c:248:9: warning: assignment to ‘mod_ty’ {aka ‘struct _mod *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
    248 |     mod = string_object_to_c_ast(str, filename, start, flags, arena);
        |         ^
  ast27/Custom/typed_ast.c:250:9: warning: implicit declaration of function ‘PyArena_Free’; did you mean ‘PyMem_Free’? [-Wimplicit-function-declaration]
    250 |         PyArena_Free(arena);
        |         ^~~~~~~~~~~~
        |         PyMem_Free
  At top level:
  ast27/Custom/typed_ast.c:201:1: warning: ‘err_free’ defined but not used [-Wunused-function]
    201 | err_free(perrdetail *err)
        | ^~~~~~~~
  ast27/Custom/typed_ast.c:81:1: warning: ‘err_input’ defined but not used [-Wunused-function]
     81 | err_input(perrdetail *err)
        | ^~~~~~~~~
  ast27/Custom/typed_ast.c:66:12: warning: ‘PARSER_FLAGS’ defined but not used [-Wunused-function]
     66 | static int PARSER_FLAGS(PyCompilerFlags *flags)
        |            ^~~~~~~~~~~~
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for typed-ast

@JelleZijlstra
Copy link
Member

#158 should have fixed this; do you still get this on typed-ast master?

@hauntsaninja
Copy link
Collaborator

I released 1.4.3 that includes #158, let me know if you still see problems

@Pierre-Sassoulas
Copy link
Author

1.4.3 install without problem, thank you !

@notogawa notogawa mentioned this issue Nov 16, 2021
1 task
JPTIZ added a commit to caravelahc/pico-bot that referenced this issue Mar 17, 2022
Previous typed-ast version fails to build in newer versions of Python
(3.10+) with "unknown type PyArena".

For more details, see: python/typed_ast#159.
JPTIZ added a commit to caravelahc/pico-bot that referenced this issue May 27, 2022
Previous typed-ast version fails to build in newer versions of Python
(3.10+) with "unknown type PyArena".

For more details, see: python/typed_ast#159.
abesto added a commit to abesto/ghstack that referenced this issue Aug 9, 2022
To get the fix for python/typed_ast#159; With
1.4.2 `typed_ast` can't be installed on recent Pythons. Note that this
 new version is still compatible with the version specifications in
`pyproject.toml`; this is "just" a `poetry update typed_ast`.

Side note: `typed_ast` is going away next July: python/typed_ast#179
ezyang pushed a commit to ezyang/ghstack that referenced this issue Aug 9, 2022
To get the fix for python/typed_ast#159; With
1.4.2 `typed_ast` can't be installed on recent Pythons. Note that this
 new version is still compatible with the version specifications in
`pyproject.toml`; this is "just" a `poetry update typed_ast`.

Side note: `typed_ast` is going away next July: python/typed_ast#179
LarsMichelsen pushed a commit to Checkmk/checkmk that referenced this issue Aug 17, 2022
* regarding typed-ast see: python/typed_ast#159 (comment)
* regarding mypy see: python/mypy#9916
* further: ignore "error: Unpacking a string is disallowed" -> credentials may also be a string...

Change-Id: I57daada9f8340075bf92be308310ec341a3f3d5d
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

3 participants