OpenXR-SDK-Source icon indicating copy to clipboard operation
OpenXR-SDK-Source copied to clipboard

Linux build error if python-markupsafe but not python-jinja installed

Open ChristophHaag opened this issue 11 months ago • 2 comments

The SDK contains both external/python/jinja2 and external/python/markupsafe, which is used when both python-markupsafe and python-jinja are not installed.

If for example on archlinux python-markupsafe 2.1.3 is installed, but not python-jinja. Then the vendored jinja2 is taken, but apparently it is incompatible with the system's markupsafe:

Traceback (most recent call last):
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/include/openxr/../../specification/scripts/genxr.py", line 560, in <module>
Traceback (most recent call last):
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/include/openxr/../../specification/scripts/genxr.py", line 560, in <module>
    (gen, options) = genTarget(args)
                     ^^^^^^^^^^^^^^^
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/include/openxr/../../specification/scripts/genxr.py", line 468, in genTarget
    (gen, options) = genTarget(args)
                     ^^^^^^^^^^^^^^^
    gen = createGenerator(errFile=errWarn,
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/include/openxr/../../specification/scripts/genxr.py", line 468, in genTarget
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/specification/scripts/creflectiongenerator.py", line 72, in __init__
    self.env = make_jinja_environment(file_with_templates_as_sibs=__file__)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/specification/scripts/jinja_helpers.py", line 99, in make_jinja_environment
    gen = createGenerator(errFile=errWarn,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/specification/scripts/creflectiongenerator.py", line 72, in __init__
    from jinja2 import Environment, FileSystemLoader
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/__init__.py", line 33, in <module>
    self.env = make_jinja_environment(file_with_templates_as_sibs=__file__)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    from jinja2.environment import Environment, Template
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/specification/scripts/jinja_helpers.py", line 99, in make_jinja_environment
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/environment.py", line 15, in <module>
    from jinja2 import Environment, FileSystemLoader
    from jinja2 import nodes
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/__init__.py", line 33, in <module>
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/nodes.py", line 19, in <module>
    from jinja2.utils import Markup
    from jinja2.environment import Environment, Template
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/utils.py", line 642, in <module>
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/environment.py", line 15, in <module>
    from jinja2 import nodes
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/nodes.py", line 19, in <module>
    from jinja2.utils import Markup
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/utils.py", line 642, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/lib/python3.11/site-packages/markupsafe/__init__.py)
    from markupsafe import Markup, escape, soft_unicode
Traceback (most recent call last):
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/lib/python3.11/site-packages/markupsafe/__init__.py)
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/include/openxr/../../specification/scripts/genxr.py", line 560, in <module>
    (gen, options) = genTarget(args)
                     ^^^^^^^^^^^^^^^
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/include/openxr/../../specification/scripts/genxr.py", line 468, in genTarget
    gen = createGenerator(errFile=errWarn,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/specification/scripts/creflectiongenerator.py", line 72, in __init__
    self.env = make_jinja_environment(file_with_templates_as_sibs=__file__)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/specification/scripts/jinja_helpers.py", line 99, in make_jinja_environment
    from jinja2 import Environment, FileSystemLoader
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/environment.py", line 15, in <module>
    from jinja2 import nodes
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/nodes.py", line 19, in <module>
    from jinja2.utils import Markup
  File "/home/haagch-collabora/openxr-loader-git/src/openxr-loader/external/python/jinja2/utils.py", line 642, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/lib/python3.11/site-packages/markupsafe/__init__.py)
make[2]: *** [include/openxr/CMakeFiles/generate_openxr_header.dir/build.make:130: include/openxr/openxr_reflection_structs.h] Fehler 1

full build output

ChristophHaag avatar Jul 23 '23 20:07 ChristophHaag