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

openSUSE packages failing when built with Nuitka #522

Closed
48 tasks
jayvdb opened this issue Sep 22, 2019 · 2 comments
Closed
48 tasks

openSUSE packages failing when built with Nuitka #522

jayvdb opened this issue Sep 22, 2019 · 2 comments
Assignees
Labels

Comments

@jayvdb
Copy link
Member

jayvdb commented Sep 22, 2019

Project https://build.opensuse.org/project/show/home:jayvdb:Nuitka - Python 3 only

The collection of packages contains the initial set of dependencies needed to bootstrap a standard Python installation, with all build dependencies and necessary testing tools needed to verify the built packages. Still quite a few unresolved packages, preventing building of larger frameworks like Django.

Nuitka build failures:

  • testtools assert locals_dict_name not in locals_dict_handles, locals_dict_name : globals_testtools$_compat2x : "Cannot recurse to import module 'testtools/_compat2x.py' (..) because of 'SyntaxError'" (Fixed by deleting testtools/_compat2x.py on Python 3)
  • Js2Py assert locals_dict_name not in locals_dict_handles, locals_dict_name: globals_js2py$internals$speed : "Cannot recurse to import module 'js2py/internals/speed.py' (...) because of 'SyntaxError'"; bypassing that results in OOM in clang and gcc
  • PasteDeploy assert locals_dict_name not in locals_dict_handles, locals_dict_name : globals_paste$deploy$paster_templates (_Fixed with mv paste/deploy/paster_templates.py paste/deploy/paster_templates/__init__.py)
  • Pygments assert locals_dict_name not in locals_dict_handles, locals_dict_name : globals_tests$support (Fixed by removing tests/)
  • Twisted Twisted build_with_Nuitka fails to find twisted.news #531
  • datrie & numpy & greenlet Missing both compile_packages and py_modules, aborting...
  • pyzmq gcc: /tmp/timer_createamusva27.c:2: undefined reference to timer_create'`
  • PyInstaller Error, 'hook-PIL.Image' is not a proper python module name.

Missing artifacts (#530 is a workaround for someone of these):

Seg faults

  • Werkzeug only occurs in test_shared_data_middleware
  • hypothesis - only occurs with clang, not gcc
  • Pympler only occurs in test test_stracker_create_summary (test_sys_mods fails for less concerning reasons)

As I go through getting those packages to build, any which build but cause other failures I will disable "Use for Build Flag" e.g. https://build.opensuse.org/repositories/home:jayvdb:Nuitka/python-setuptools . I will attempt to adjust them so the tests fail.

Builds but breaks other packages:

Test failures:

  • psutil, 10 failures
  • xmlschema test_element_tree_import_script fails
  • path.py TestSpecialPaths case fails (5 tests)
  • Paste test_egg_parser fails
  • bs4 test_out_of_range_entity fails
  • pytest-shutil test_run_in_subprocess_passes_stderr fails
  • Jinja2 - test_safe_format_safety and test_safe_format_all_okay fail
  • kombu test_import_no_ssl
  • ZConfig test_existing_file & test_existing_path
  • Werkzeug test_default_stream_factory[True-???] (two tests) test_shared_data_middleware (seg fault)
  • cliff lots of failures, but may be only a few common problems, and maybe VM setup related
  • scons - test/fixture/wrapper.py & test/fixture/wrapper_with_args.py
  • pytest-cov tests fail after test_funcarg_not_active PASSED [ 52%]
  • mock - autospec functionality: TypeError: Nuitka doesn't support __defaults__ size changes - c.f. graphviz tests/conftest.py which uses this.

Convertion to setuptools pending:

  • PyYAML TypeError: dist must be a Distribution instance
  • gpgme error: each element of 'ext_modules' option must be an Extension instance or 2-tuple - workaround was create alternative python-gpg which is only the Python component, but also without the tests.
@jayvdb
Copy link
Member Author

jayvdb commented Sep 27, 2019

I've mostly figured out cryptography, and cryptography_vectors.

I needed to copy all of the subdirectories of cryptography_vectors to the top level of site-packages (hopefully not too many conflicts with other packages) -- a patch should be able to fix this easily, or a Nuitka plugin maybe. I guess there must be an existing issue about missing data files. #521 is an umbrella issue I created about that.

Then for cryptography, I first tried combinations of force-inclusions, like --include-plugin-directory cryptography.hazmat.bindings --include-module cryptography.hazmat.bindings._padding --include-module cryptography.hazmat.bindings._constant_time --include-module cryptography.hazmat.bindings._openssl --include-module cryptography.hazmat.bindings._padding.abi3 --include-module cryptography.hazmat.bindings._constant_time.abi3 --include-module cryptography.hazmat.bindings._openssl.abi3 but that didnt work, and there wasnt any warnings about those either, which feels like it should emit something.

I also tried doing build_ext first, and then rename cryptography/hazmat/bindings/_constant_time.abi3.so -> cryptography/hazmat/bindings/_constant_time.so in case the PEP 3149 names were causing the problem. Nuitka still didnt pick up the extra .so

Then I did the following before performing the build, and success.

echo 'from cryptography.hazmat.bindings import _padding' >>  src/cryptography/hazmat/bindings/__init__.py
echo 'from cryptography.hazmat.bindings import _constant_time' >>  src/cryptography/hazmat/bindings/__init__.py
echo 'from cryptography.hazmat.bindings import _openssl' >>  src/cryptography/hazmat/bindings/__init__.py

@kayhayen
Copy link
Member

I don't think this is being worked on, is it? I would like to see this closed therefore. Let me know if I am mistaken.

@kayhayen kayhayen self-assigned this Jun 21, 2023
@Nuitka Nuitka locked and limited conversation to collaborators Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants