./mach lint fails on Python 3.11 with typed_ast compilation errors
Categories
(Developer Infrastructure :: Lint and Formatting, defect)
Tracking
(firefox113 fixed)
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: az, Assigned: az)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Attempting to run ./mach lint
on a Debian install running Python 3.11 fails with the following error message:
creating build/temp.linux-x86_64-3.11/ast27/Python
x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iast27/Include -I/home/az/git/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/lint/include -I/usr/include/python3.11 -c ast27/Custom/typed_ast.c -o build/temp.linux-x86_64-3.11/ast27/Custom/typed_ast.o
In file included from ast27/Custom/typed_ast.c:3:
ast27/Custom/../Include/compile.h:5:10: fatal error: code.h: No such file or directory
5 | #include "code.h"
| ^~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
The reason for this failure is that the code.h
header file was removed from Python, so typed_ast
is no longer able to compile. Newer versions of ast no longer include the removed header file and ./mach lint
works again.
I'm not familiar with typed_ast
and there may be other ramifications to this upgrade. I have a patch I'll attach shortly for review by those more knowledgeable in this area.
Comment 2•2 years ago
|
||
The severity field is not set for this bug.
:andi, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•2 years ago
|
Comment 3•2 years ago
|
||
Note that this also affects MacOS, specifically when installing python using homebrew. This is due to python 3.11 being a (homebrew) dependency for mercurial, which then overrides the system default python.
Updated•2 years ago
|
Comment 5•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Description
•