Open Bug 1810540 Opened 2 years ago Updated 2 years ago

`./mach lint --fix` fails to install the needed dependencies (black)

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(Not tracked)

People

(Reporter: farre, Unassigned)

References

(Blocks 1 open bug)

Details

./mach lint --fix
warning: linting the entire repo takes a long time, using --outgoing and --workdir instead. If you want to lint the entire repo, run ./mach lint .
Collecting black==21.11b1
Using cached black-21.11b1-py3-none-any.whl (155 kB)
Collecting click==8.0.3
Using cached click-8.0.3-py3-none-any.whl (97 kB)
Collecting dataclasses==0.6
Using cached dataclasses-0.6-py3-none-any.whl (14 kB)
Requirement already satisfied: mypy-extensions==0.4.3 in ./obj-linux-release/_virtualenvs/lint/lib/python3.11/site-packages (from -r /home/farre/src/work/tools/lint/python/black_requirements.txt (line 19)) (0.4.3)
Requirement already satisfied: pathspec==0.9.0 in ./third_party/python/pathspec (from -r /home/farre/src/work/tools/lint/python/black_requirements.txt (line 23)) (0.9.0)
Collecting platformdirs==2.4.0
Using cached platformdirs-2.4.0-py3-none-any.whl (14 kB)
Requirement already satisfied: regex==2021.11.10 in ./obj-linux-release/_virtualenvs/lint/lib/python3.11/site-packages (from -r /home/farre/src/work/tools/lint/python/black_requirements.txt (line 31)) (2021.11.10)
Requirement already satisfied: tomli==1.2.2 in ./obj-linux-release/_virtualenvs/lint/lib/python3.11/site-packages (from -r /home/farre/src/work/tools/lint/python/black_requirements.txt (line 82)) (1.2.2)
Collecting typed-ast==1.5.2
Using cached typed_ast-1.5.2.tar.gz (252 kB)
Collecting typing-extensions==3.10.0.2
Using cached typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Building wheels for collected packages: typed-ast
Building wheel for typed-ast (setup.py): started
Building wheel for typed-ast (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /home/farre/src/work/obj-linux-release/_virtualenvs/lint/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r6ehkbwc/typed-ast_a4fc201ae0c1446dba6a806d696c33f0/setup.py'"'"'; file='"'"'/tmp/pip-install-r6ehkbwc/typed-ast_a4fc201ae0c1446dba6a806d696c33f0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ygrltowb
cwd: /tmp/pip-install-r6ehkbwc/typed-ast_a4fc201ae0c1446dba6a806d696c33f0/
Complete output (27 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.11
creating build/lib.linux-x86_64-3.11/typed_ast
copying typed_ast/conversions.py -> build/lib.linux-x86_64-3.11/typed_ast
copying typed_ast/ast3.py -> build/lib.linux-x86_64-3.11/typed_ast
copying typed_ast/ast27.py -> build/lib.linux-x86_64-3.11/typed_ast
copying typed_ast/init.py -> build/lib.linux-x86_64-3.11/typed_ast
package init file 'ast3/tests/init.py' not found (or not a regular file)
creating build/lib.linux-x86_64-3.11/typed_ast/tests
copying ast3/tests/test_basics.py -> build/lib.linux-x86_64-3.11/typed_ast/tests
running build_ext
building '_ast27' extension
creating build/temp.linux-x86_64-3.11
creating build/temp.linux-x86_64-3.11/ast27
creating build/temp.linux-x86_64-3.11/ast27/Custom
creating build/temp.linux-x86_64-3.11/ast27/Parser
creating build/temp.linux-x86_64-3.11/ast27/Python
gcc -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Iast27/Include -I/home/farre/src/work/obj-linux-release/_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/lib64/ccache/gcc' failed with exit code 1

ERROR: Failed building wheel for typed-ast
Running setup.py clean for typed-ast
Failed to build typed-ast
Installing collected packages: typing-extensions, platformdirs, click, typed-ast, dataclasses, black
Attempting uninstall: typing-extensions
Found existing installation: typing-extensions 3.10.0.0
Not uninstalling typing-extensions at /home/farre/src/work/third_party/python/typing_extensions, outside environment /home/farre/src/work/obj-linux-release/_virtualenvs/lint
Can't uninstall 'typing-extensions'. No files were found to uninstall.
Attempting uninstall: platformdirs
Found existing installation: platformdirs 2.6.0
Uninstalling platformdirs-2.6.0:
Successfully uninstalled platformdirs-2.6.0
Attempting uninstall: click
Found existing installation: click 7.1.2
Not uninstalling click at /home/farre/src/work/third_party/python/click, outside environment /home/farre/src/work/obj-linux-release/_virtualenvs/lint
Can't uninstall 'click'. No files were found to uninstall.
Running setup.py install for typed-ast: started
Running setup.py install for typed-ast: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /home/farre/src/work/obj-linux-release/_virtualenvs/lint/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r6ehkbwc/typed-ast_a4fc201ae0c1446dba6a806d696c33f0/setup.py'"'"'; file='"'"'/tmp/pip-install-r6ehkbwc/typed-ast_a4fc201ae0c1446dba6a806d696c33f0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-hgu6jis6/install-record.txt --single-version-externally-managed --compile --install-headers /home/farre/src/work/obj-linux-release/_virtualenvs/lint/include/site/python3.11/typed-ast
cwd: /tmp/pip-install-r6ehkbwc/typed-ast_a4fc201ae0c1446dba6a806d696c33f0/
Complete output (27 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.11
creating build/lib.linux-x86_64-3.11/typed_ast
copying typed_ast/conversions.py -> build/lib.linux-x86_64-3.11/typed_ast
copying typed_ast/ast3.py -> build/lib.linux-x86_64-3.11/typed_ast
copying typed_ast/ast27.py -> build/lib.linux-x86_64-3.11/typed_ast
copying typed_ast/init.py -> build/lib.linux-x86_64-3.11/typed_ast
package init file 'ast3/tests/init.py' not found (or not a regular file)
creating build/lib.linux-x86_64-3.11/typed_ast/tests
copying ast3/tests/test_basics.py -> build/lib.linux-x86_64-3.11/typed_ast/tests
running build_ext
building '_ast27' extension
creating build/temp.linux-x86_64-3.11
creating build/temp.linux-x86_64-3.11/ast27
creating build/temp.linux-x86_64-3.11/ast27/Custom
creating build/temp.linux-x86_64-3.11/ast27/Parser
creating build/temp.linux-x86_64-3.11/ast27/Python
gcc -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Iast27/Include -I/home/farre/src/work/obj-linux-release/_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/lib64/ccache/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/farre/src/work/obj-linux-release/_virtualenvs/lint/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r6ehkbwc/typed-ast_a4fc201ae0c1446dba6a806d696c33f0/setup.py'"'"'; file='"'"'/tmp/pip-install-r6ehkbwc/typed-ast_a4fc201ae0c1446dba6a806d696c33f0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-hgu6jis6/install-record.txt --single-version-externally-managed --compile --install-headers /home/farre/src/work/obj-linux-release/_virtualenvs/lint/include/site/python3.11/typed-ast Check the logs for full command output.

Traceback (most recent call last):
File "/home/farre/src/work/python/mozlint/mozlint/roller.py", line 233, in setup
res = findobject(linter["setup"])(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/farre/src/work/tools/lint/python/black.py", line 142, in setup
virtualenv_manager.install_pip_requirements(BLACK_REQUIREMENTS_PATH, quiet=True)
File "/home/farre/src/work/python/mach/mach/site.py", line 654, in install_pip_requirements
raise InstallPipRequirementsException(
mach.site.InstallPipRequirementsException: Failed to install "/home/farre/src/work/tools/lint/python/black_requirements.txt" into the "lint" site.
error: problem with lint setup, skipping android-api-lint, android-checkstyle, android-format, android-javadoc, android-lint, android-test, black

Summary: `./mach lint --fix` fails to install the needed dependencies. → `./mach lint --fix` fails to install the needed dependencies (black)
You need to log in before you can comment on or make changes to this bug.