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

MSVC 10.0 build failing for ast27/Python/ast.c #121

Closed
vladak opened this issue Jun 6, 2019 · 5 comments
Closed

MSVC 10.0 build failing for ast27/Python/ast.c #121

vladak opened this issue Jun 6, 2019 · 5 comments

Comments

@vladak
Copy link

vladak commented Jun 6, 2019

The MSVC 10.0 compilation of ast27/Python/ast.c seems to have started failing couple of days ago with:

 c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Iast27/Include -IC:\projects\opengrok\opengrok-tools\target\env\include -IC:\Python34\include -IC:\Python34\include /Tcast27/Python/ast.c /Fobuild\temp.win32-3.4\Release\ast27/Python/ast.obj
    ast.c
    ast27/Python/ast.c(303) : error C2275: 'type_ignore_ty' : illegal use of this type as an expression
            ast27/Include\Python-ast.h(36) : see declaration of 'type_ignore_ty'
    ast27/Python/ast.c(303) : error C2146: syntax error : missing ';' before identifier 'ti'
    ast27/Python/ast.c(303) : error C2065: 'ti' : undeclared identifier
    ast27/Python/ast.c(303) : warning C4047: '=' : 'int' differs in levels of indirection from 'type_ignore_ty'
    ast27/Python/ast.c(304) : error C2065: 'ti' : undeclared identifier
    ast27/Python/ast.c(306) : error C2065: 'ti' : undeclared identifier
    ast27/Python/ast.c(306) : warning C4047: '=' : 'void *' differs in levels of indirection from 'int'
    error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

see https://ci.appveyor.com/api/buildjobs/80p1fa1y6lompwt8/log for full log.

I see a change has been made to the file via #116 some 2 days ago: https://github.com/python/typed_ast/blame/master/ast27/Python/ast.c#L300 and it looks like MSVC C compiler does not like variable declarations in the middle of a block. In this case it is the type_ignore_ty ti definition.

There have been some related fixups in the past like #47 so this seems to be just another case.

Sorry about not providing a fix, this is happening in our AppVeyor build; normally I don't have access to Windows.

@ilevkivskyi
Copy link
Member

Python 3.4 is not supported anymore (reached its EoL), is this also relevant for newer versions of Python?

@vladak
Copy link
Author

vladak commented Jun 6, 2019 via email

@emmatyping
Copy link
Member

@vladak Python 3.5+ use the newer VS 14.x compiler, so you probably want to use that.

@ilevkivskyi
Copy link
Member

Python 3.5+ use the newer VS 14.x compiler

OK, let's close this then.

@andy-maier
Copy link

andy-maier commented Jul 24, 2019

We also ran into this issue, e.g. see this Appveyor log

Python 3.4 was retired just in march this year. Many people are still using it and many packages still define Python 3.4 as a minimum Python version.

For example, this article (also from march this year) describes how to install Python 3.3, 3.4, 3.5, 3.6 into CentOS 7. RHEL 7 and CentOS 7 are still widely used.

It may be an easy way out not to fix this issue just because Python 3.4 is retired, but it is not very user friendly.

andy-maier added a commit to andy-maier/python-yagot that referenced this issue Mar 7, 2020
Details:

* Building the wheel for typed-ast fails with an error that was already
  reported to typed-ast as python/typed_ast#121
  but was decided not to be fixed because the error only showed up on
  Python 3.4 (or only with MSVC 10.0 ?).

  This fix pins the version of typed-ast to <1.4.0 on Python 3.4.

* In addition, typed-ast was missing completely so far from the requirements
  anbd constraints files, and was added with a minimum version of 1.3.0.

Signed-off-by: Andreas Maier <[email protected]>
andy-maier added a commit to andy-maier/python-yagot that referenced this issue Mar 7, 2020
Details:

* Building the wheel for typed-ast fails with an error that was already
  reported to typed-ast as python/typed_ast#121
  but was decided not to be fixed because the error only showed up on
  Python 3.4 (or only with MSVC 10.0 ?).

  This fix pins the version of typed-ast to <1.4.0 on Python 3.4.

* In addition, typed-ast was missing completely so far from the requirements
  and constraints files, and was added with a minimum version of 1.3.0.

* For Python 3.8 and higher, defined typed-ast verion 1.4.0 as the minimum,
  see issue python/typed_ast#126

Signed-off-by: Andreas Maier <[email protected]>
andy-maier added a commit to andy-maier/python-yagot that referenced this issue Mar 7, 2020
Details:

* Building the wheel for typed-ast fails with an error that was already
  reported to typed-ast as python/typed_ast#121
  but was decided not to be fixed because the error only showed up on
  Python 3.4 (or only with MSVC 10.0 ?).

  This fix pins the version of typed-ast to <1.4.0 on Python 3.4.

* In addition, typed-ast was missing completely so far from the requirements
  and constraints files, and was added with a minimum version of 1.3.0.

* For Python 3.8 and higher, defined typed-ast verion 1.4.0 as the minimum,
  see issue python/typed_ast#126

Signed-off-by: Andreas Maier <[email protected]>
andy-maier added a commit to andy-maier/python-yagot that referenced this issue Mar 7, 2020
Details:

* Building the wheel for typed-ast fails with an error that was already
  reported to typed-ast as python/typed_ast#121
  but was decided not to be fixed because the error only showed up on
  Python 3.4 (or only with MSVC 10.0 ?).

  This fix pins the version of typed-ast to <1.4.0 on Python 3.4.

* In addition, typed-ast was missing completely so far from the requirements
  and constraints files, and was added with a minimum version of 1.3.0.

* For Python 3.8 and higher, defined typed-ast verion 1.4.0 as the minimum,
  see issue python/typed_ast#126

Signed-off-by: Andreas Maier <[email protected]>
andy-maier added a commit to andy-maier/cookiecutter-python that referenced this issue Mar 7, 2020
Details:

* Building the wheel for typed-ast fails with an error that was already
  reported to typed-ast as python/typed_ast#121
  but was decided not to be fixed because the error only showed up on
  Python 3.4 (or only with MSVC 10.0 ?).

  This fix pins the version of typed-ast to <1.4.0 on Python 3.4.

* In addition, typed-ast was missing completely so far from the requirements
  and constraints files, and was added with a minimum version of 1.3.0.

* For Python 3.8 and higher, defined typed-ast verion 1.4.0 as the minimum,
  see issue python/typed_ast#126

Signed-off-by: Andreas Maier <[email protected]>
andy-maier added a commit to andy-maier/cookiecutter-python that referenced this issue Mar 7, 2020
Details:

* Building the wheel for typed-ast fails with an error that was already
  reported to typed-ast as python/typed_ast#121
  but was decided not to be fixed because the error only showed up on
  Python 3.4 (or only with MSVC 10.0 ?).

  This fix pins the version of typed-ast to <1.4.0 on Python 3.4.

* In addition, typed-ast was missing completely so far from the requirements
  and constraints files, and was added with a minimum version of 1.3.0.

* For Python 3.8 and higher, defined typed-ast verion 1.4.0 as the minimum,
  see issue python/typed_ast#126

Signed-off-by: Andreas Maier <[email protected]>
andy-maier added a commit to andy-maier/cookiecutter-python-package that referenced this issue Jan 27, 2021
Details:

* Building the wheel for typed-ast fails with an error that was already
  reported to typed-ast as python/typed_ast#121
  but was decided not to be fixed because the error only showed up on
  Python 3.4 (or only with MSVC 10.0 ?).

  This fix pins the version of typed-ast to <1.4.0 on Python 3.4.

* In addition, typed-ast was missing completely so far from the requirements
  and constraints files, and was added with a minimum version of 1.3.0.

* For Python 3.8 and higher, defined typed-ast verion 1.4.0 as the minimum,
  see issue python/typed_ast#126

Signed-off-by: Andreas Maier <[email protected]>
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

4 participants