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

Remove unnecessary python-xcbgen and python-jinja2 from build dependencies #194

Merged

Conversation

riyad
Copy link

@riyad riyad commented Jan 27, 2021

I've tried building the last unportable release without python(3)-xcbgen and python(3)-jinja2 packages on Ubuntu focal and it worked. 🙂
Packages are identical (modulo timestamps and .buildinfo) to the build with those packages installed.

May be a first chip at #188 😉

@ghost
Copy link

ghost commented Jan 28, 2021

@Eloston this appears to be up your alley since you started the unportable work.

@Eloston
Copy link
Member

Eloston commented Jan 29, 2021

@riyad Interesting. Do you have those modules provided elsewhere in your Python 2 installation? You can check by trying to import jinja2 and import xcbgen.

@riyad
Copy link
Author

riyad commented Jan 29, 2021

I can import those packages with neither python2 nor python3.

$ python2
Python 2.7.18 (default, Aug  4 2020, 11:16:42)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import jinja2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named jinja2
>>> import xcbgen
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named xcbgen
>>>
$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import jinja2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'jinja2'
>>> import xcbgen
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'xcbgen'
>>>

A build where I tried to remove python-pkg-resources failed with the following error. It also suggest that jinja2 is vendored in ungoogled-chromium-debian/build/src/third_party/jinja2 : it is!

[...]
[20679/43893] ACTION //components/schema_org:generate_schema_org_code(//build/toolchain/linux/unbundle:default)
FAILED: gen/components/schema_org/schema_org_entity_names.h gen/components/schema_org/schema_org_entity_names.cc gen/components/schema_org/schema_org_property_configurations.h gen/components/schema_org/schema_org_property_configurations.cc gen/components/schema_org/schema_org_property_names.h gen/components/schema_org/schema_org_property_names.cc gen/components/schema_org/schema_org_enums.h gen/components/schema_org/schema_org_enums.cc
/usr/bin/python2 ../../components/schema_org/generate_schema_org_code.py --schema-file ../../third_party/schema_org/schema.jsonld --overrides-file ../../third_party/schema_org/overrides.jsonld --name-file gen/components/schema_org/schema_org_name_data.json --output-dir gen/components/schema_org --templates templates/schema_org_entity_names.cc.tmpl templates/schema_org_entity_names.h.tmpl templates/schema_org_enums.cc.tmpl templates/schema_org_enums.h.tmpl templates/schema_org_property_configurations.cc.tmpl templates/schema_org_property_configurations.h.tmpl templates/schema_org_property_names.cc.tmpl templates/schema_org_property_names.h.tmpl
Traceback (most recent call last):
  File "../../components/schema_org/generate_schema_org_code.py", line 22, in <module>
    env = Environment(loader=PackageLoader('generate_schema_org_code', ''))
  File "/build/src/build/src/components/schema_org/../../third_party/jinja2/loaders.py", line 222, in __init__
    from pkg_resources import DefaultProvider, ResourceManager, \
ImportError: No module named pkg_resources
[20680/43893] LINK ./make_top_domain_list_variables
[20681/43893] ACTION //third_party/blink/public/mojom:mojom_platform__generator(//build/toolchain/linux/unbundle:default)
[20682/43893] ACTION //third_party/blink/public/mojom:mojom_core__parser(//build/toolchain/linux/unbundle:default)
ninja: build stopped: subcommand failed.
make[1]: *** [debian/rules:77: override_dh_auto_build-arch] Error 1
make[1]: Leaving directory '/build/src'
make: *** [debian/rules:64: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
Error: error building at STEP "RUN dpkg-buildpackage -b -uc": error while running runtime: exit status 2

I also found xcbgen vendored in ungoogled-chromium-debian/build/src/third_party/xcbproto/src/xcbgen .

@Eloston
Copy link
Member

Eloston commented Jan 30, 2021

Huh, interesting. I never considered the Python modules to be bundled too. Thanks for investigating!

@Eloston Eloston merged commit ef411f6 into ungoogled-software:unportable Jan 30, 2021
@riyad riyad deleted the unportable-remove-xcbgen-jinja branch January 31, 2021 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants