Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ChristophHaag opened this issue Jul 23, 2023 · 2 comments
Open
Labels
bug Something isn't working synced to gitlab Synchronized to OpenXR internal GitLab

Comments

@ChristophHaag
Copy link
Contributor

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

@rpavlik
Copy link
Contributor

rpavlik commented Jul 24, 2023

ugh, yeah, thanks for the ping on this. I think if I update the vendored versions it should fix this? Really hate that the Jinja folks broke compatibility in a minor version, which is the underlying problem here.

@rpavlik-bot rpavlik-bot added the synced to gitlab Synchronized to OpenXR internal GitLab label Aug 2, 2023
@rpavlik-bot
Copy link
Collaborator

An issue (number 2070) has been filed to correspond to this issue in the internal Khronos GitLab (Khronos members only: KHR:openxr/openxr#2070 ), to facilitate working group processes.

This GitHub issue will continue to be the main site of discussion.

@rpavlik rpavlik added the bug Something isn't working label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working synced to gitlab Synchronized to OpenXR internal GitLab
Projects
None yet
Development

No branches or pull requests

3 participants