ERROR:root:code for hash md5 was not found.

2,169 views
Skip to first unread message

Christophe Vanlancker

unread,
Aug 24, 2016, 8:21:27 AM8/24/16
to skia-discuss
Hello,

I'm trying to build Skia for android, but unfortunately I'm stuck with the following issue:

[jenkins@jenkins skia]$ ./platform_tools/android/bin/android_ninja -d x86
ANDROID_HOME not set so we are setting it to a default value of ANDROID_SDK_ROOT
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "/opt/skia/skia/gyp_skia", line 157, in <module>
    res = gyp.main(args)
  File "/opt/skia/skia/third_party/externals/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/opt/skia/skia/third_party/externals/gyp/pylib/gyp/__init__.py", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/opt/skia/skia/third_party/externals/gyp/pylib/gyp/generator/ninja.py", line 2415, in GenerateOutput
    pool.map(CallGenerateOutputForConfig, arglists)
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/multiprocessing/pool.py", line 250, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/multiprocessing/pool.py", line 554, in get
    raise self._value
AttributeError: 'module' object has no attribute 'md5'


 
Building this on a Centos 7.2 machine.

I installed the relative python dev package and all kinds of SSL related packages.
I got to the point where importing the  hashlib  on python on the host machine  works.

But from the looks of things skia downloads its own copy of python which has difficulty finding the necessary crypto libraries.


Mike Klein

unread,
Aug 24, 2016, 8:36:20 AM8/24/16
to skia-discuss
That's unusual, but probably expected.  I bet we've never tried building Skia, to say nothing of the weird bits we do for Android, from a Centos machine.

Can you build Skia for your machine correctly?  E.g. does $ ./gyp_skia && ninja -C out/Release work for you?


Skia folks, is it expected that ./gyp_skia uses the NDK distributed Python when run via android_ninja?  That seems unusual.

  File "/opt/skia/skia/third_party/externals/gyp/pylib/gyp/generator/ninja.py", line 2415, in GenerateOutput
    pool.map(CallGenerateOutputForConfig, arglists)
  File "/opt/skia/skia/platform_tools/android/toolchains/x86-r12b-14/lib/python2.7/multiprocessing/pool.py", line 250, in map
    return self.map_async(func, iterable, chunksize).get()

This bit may be bypassable if we can get --no-parallel passed through to GYP.  GYP will only try to use the multiprocessing module if the default 'parallel' parameter is active.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

Christophe Vanlancker

unread,
Aug 24, 2016, 8:59:21 AM8/24/16
to skia-discuss
Works like a charm:

[jenkins@jenkins skia]$ ./gyp_skia && ninja -C out/Release
GYP_GENERATORS environment variable not set, using default, ninja
ninja: Entering directory `out/Release'
[2217/2217] STAMP obj/gyp/most.actions_depends.stamp

Derek Sollenberger

unread,
Aug 24, 2016, 9:14:16 AM8/24/16
to skia-discuss
I wasn't aware that android_ninja caused us to use a different python.  I don't see any code in our android scripts that points to a different python library.  Could it be that GYP is trying to do something clever behind our backs when we set GYP_GENERATORS=ninja-android?

--

Christophe Vanlancker

unread,
Aug 24, 2016, 11:42:44 AM8/24/16
to skia-discuss
Looks like some library references aren't resolved.

[root@jenkins skia]# find ./ -iname "*.so" -exec ldd {} \;

libc.so => not found
libm.so => not found
liblog.so => not found
libdl.so => not found
./platform_tools/android/toolchains/x86-r12b-14/host_prebuilt/lib/python2.7/lib-dynload/_hashlib.so: /lib64/libcrypto.so.1.0.0: version `OPENSSL_1.0.0' not found (required by ./platform_tools/android/toolchains/x86-r12b-14/host_prebuilt/lib/python2.7/lib-dynload/_hashlib.so)

Mike Klein

unread,
Aug 24, 2016, 11:46:12 AM8/24/16
to skia-discuss
Does anyone else reading this have a Centos machine?  If not, I'm not sure we can help you.  Almost all our Linux-based development is done on Ubuntu.

Christophe Vanlancker

unread,
Aug 24, 2016, 12:08:27 PM8/24/16
to skia-discuss
I think I just made a breakthrough.

I installed an older package of libopenssl1_0_0  (libopenssl1_0_0-1.0.1k-11.87.1.x86_64.rpm)  meant  for OpenSuse  and it works.

[jenkins@jenkins skia]$ ./platform_tools/android/bin/android_ninja -d x86
ANDROID_HOME not set so we are setting it to a default value of ANDROID_SDK_ROOT
ninja: Entering directory `/opt/skia/skia/out/config/android-x86/Release_Developer'
[2917/2917] STAMP obj/gyp/most.actions_depends.stamp

I feel terribly dirty though, it seems to have fixed my problem, but this is not the way...
Reply all
Reply to author
Forward
0 new messages