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

Matplotlib recipe depends on local environment #1900

Closed
inclement opened this issue Jun 29, 2019 · 2 comments
Closed

Matplotlib recipe depends on local environment #1900

inclement opened this issue Jun 29, 2019 · 2 comments

Comments

@inclement
Copy link
Member

See https://travis-ci.org/kivy/python-for-android/jobs/551991431#L5947-L5958 for failing build in ci environment.

The recipe works for me but is probably getting things like the freetype headers from the wrong places (i.e. system versions). It needs fixing to correct this, and removing from the broken recipes list in ci/constants.py.

inclement added a commit to inclement/python-for-android that referenced this issue Jun 29, 2019
@AndreMiras
Copy link
Member

I'm sharing the relevant part of the log here in case the Travis one gets deleted.

[INFO]:    Building matplotlib for armeabi-v7a
[INFO]:    matplotlib apparently isn't already in site-packages
[INFO]:    Building compiled components in matplotlib
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/matplotlib-python3/armeabi-v7a__ndk_target_21/matplotlib
stty: 'standard input': Inappropriate ioctl for device
[INFO]:    -> running python setup.py build_ext -v
Exception in thread background thread for pid 11361:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 
  RAN: /home/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python setup.py build_ext -v
  STDOUT:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
            matplotlib: yes [3.0.3]
                python: yes [3.7.1 (default, Jun 28 2019, 23:44:36)  [GCC
                        7.4.0]]
              platform: yes [linux]
REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [not found. pip may install it below.]
      install_requires: yes [handled by setuptools]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                        could not be found.  You may need to install the
                        development package.]
                   png: no  [pkg-config information for 'libpng' could not
                        be found.]
                 qhull: yes [pkg-config information for 'libqhull' could not
                        be found. Using local copy.]
OPTIONAL SUBPACKAGES
           sample_data: no  [skipping due to configuration]
              toolkits: yes [installing]
                 tests: no  [skipping due to configuration]
        toolkits_tests: no  [skipping due to configuration]
OPTIONAL BACKEND EXTENSIONS
                   agg: yes [installing]
                 tkagg: no  [Disabled by patching during Android build]
                macosx: no  [skipping due to configuration]
             windowing: no  [skipping due to configuration]
OPTIONAL PACKAGE DATA
                  dlls: no  [skipping due to configuration]
============================================================================
                        * The following required packages can not be built:
                        * freetype, png
                        * Try installing freetype with `apt-get install
                        * libfreetype6-dev` and pkg-config with `apt-get
                        * install pkg-config`
                        * Try installing png with `apt-get install
                        * libpng12-dev` and pkg-config with `apt-get install
                        * pkg-config`
  STDERR:
Traceback (most recent call last):
  File "setup_testapp_python3_sqlite_openssl.py", line 22, in <module>
    package_data={'testapp_sqlite_openssl': ['*.py', '*.png']}
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/user/pythonforandroid/bdistapk.py", line 80, in run
    main()
  File "/home/user/pythonforandroid/toolchain.py", line 1183, in main
    ToolchainCL()
  File "/home/user/pythonforandroid/toolchain.py", line 666, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/user/pythonforandroid/toolchain.py", line 152, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/user/pythonforandroid/toolchain.py", line 205, in build_dist_from_args
    args, "ignore_setup_py", False
  File "/home/user/pythonforandroid/build.py", line 557, in build_recipes
    recipe.build_arch(arch)
  File "/home/user/pythonforandroid/recipe.py", line 883, in build_arch
    self.build_compiled_components(arch)
  File "/home/user/pythonforandroid/recipe.py", line 938, in build_compiled_components
    super(CppCompiledComponentsPythonRecipe, self).build_compiled_components(arch)
  File "/home/user/pythonforandroid/recipe.py", line 895, in build_compiled_components
    _env=env, *self.setup_extra_args)
  File "/home/user/pythonforandroid/logger.py", line 178, in shprint
    for line in output:
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 863, in next
    self.wait()
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 
  RAN: /home/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python setup.py build_ext -v
  STDOUT:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
            matplotlib: yes [3.0.3]
                python: yes [3.7.1 (default, Jun 28 2019, 23:44:36)  [GCC
                        7.4.0]]
              platform: yes [linux]
REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [not found. pip may install it below.]
      install_requires: yes [handled by setuptools]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                        could not be found.  You may need to install the
                        development package.]
                   png: no  [pkg-config information for 'libpng' could not
                        be found.]
                 qhull: yes [pkg-config information for 'libqhull' could not
                        be found. Using local copy.]
OPTIONAL SUBPACKAGES
           sample_data: no  [skipping due to configuration]
              toolkits: yes [installing]
                 tests: no  [skipping due to configuration]
        toolkits_tests: no  [skipping due to configuration]
OPTIONAL BACKEND EXTENSIONS
                   agg: yes [installing]
                 tkagg: no  [Disabled by patching during Android build]
                macosx: no  [skipping due to configuration]
             windowing: no  [skipping due to configuration]
OPTIONAL PACKAGE DATA
                  dlls: no  [skipping due to configuration]
============================================================================
                        * The following required packages can not be built:
                        * freetype, png
                        * Try installing freetype with `apt-get install
                        * libfreetype6-dev` and pkg-config with `apt-get
                        * install pkg-config`
                        * Try installing png with `apt-get install
                        * libpng12-dev` and pkg-config with `apt-get install
                        * pkg-config`
  STDERR:
  STDERR:
The command "docker run -e CI -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" -e TRAVIS_BRANCH="$TRAVIS_BRANCH" p4a /bin/sh -c "$COMMAND"" exited with 1.

It definitely seems we're just missing some system dependencies as suggested in the logs:

                        * The following required packages can not be built:
                        * freetype, png
                        * Try installing freetype with `apt-get install
                        * libfreetype6-dev` and pkg-config with `apt-get
                        * install pkg-config`
                        * Try installing png with `apt-get install
                        * libpng12-dev` and pkg-config with `apt-get install
                        * pkg-config

So I guess we should make a couple of tests and introduce the missing dep in Docker.
This is also related to #1750

@Julian-O
Copy link
Contributor

Closing as fixed.

If the problem persists, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants