kiss-community / community

Officially unofficial KISS community repository, mirror of https://codeberg.org/kiss-community/community

Home Page:https://kisscommunity.org

Repository from Github https://github.comkiss-community/communityRepository from Github https://github.comkiss-community/community

Chromium fails to build due to Python 3.10 changes

davidgarland opened this issue · comments

The section of the log from when the build failed:

[4107/48830] CXX obj/third_party/vulkan-deps/glslang/src/glslang_lib_sources/PpScanner.o
ninja: job failed: python3 ../../v8/third_party/inspector_protocol/code_generator.py --jinja_dir ../../third_party/ --output_base gen/v8/src/inspector --config ../../v8/src/inspector/inspector_protocol_config.json --inspector_protocol_dir //v8//third_party/inspector_protocol
Traceback (most recent call last):
  File "/home/david/.cache/kiss/proc/6273/build/chromium/out/Release/../../v8/third_party/inspector_protocol/code_generator.py", line 702, in <module>
    main()
  File "/home/david/.cache/kiss/proc/6273/build/chromium/out/Release/../../v8/third_party/inspector_protocol/code_generator.py", line 584, in main
    jinja_env = initialize_jinja_env(jinja_dir, config.protocol.output, config)
  File "/home/david/.cache/kiss/proc/6273/build/chromium/out/Release/../../v8/third_party/inspector_protocol/code_generator.py", line 190, in initialize_jinja_env
    import jinja2
  File "/home/david/.cache/kiss/proc/6273/build/chromium/third_party/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "/home/david/.cache/kiss/proc/6273/build/chromium/third_party/jinja2/environment.py", line 16, in <module>
    from jinja2.defaults import BLOCK_START_STRING, \
  File "/home/david/.cache/kiss/proc/6273/build/chromium/third_party/jinja2/defaults.py", line 32, in <module>
    from jinja2.tests import TESTS as DEFAULT_TESTS
  File "/home/david/.cache/kiss/proc/6273/build/chromium/third_party/jinja2/tests.py", line 13, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
ninja: subcommand failed
-> chromium Build failed
-> chromium Log stored to /home/david/.cache/kiss/logs/2021-10-16/chromium-2021-10-16-09:22-6273
Terminated

Looking it up, it seems that Python 3.10 changed where Mapping lives from collections to collections.abc.
I'm unsure if it would be simpler to bundle in an older version of python or to look for and patch all such errors in chromium (or if a newer version may have fixed this issue?)

I took the "I'm lazy and don't want to investigate this" route with sed -i 's/from collections/from collections.abc/' third_party/jinja2/tests.py. Builds fine, Seems to Work.

Closed by #750