linaro-swg / optee_examples

OP-TEE Sample Applications
Other
163 stars 140 forks source link

Strange things, when including Python libs #73

Closed alzeha closed 4 years ago

alzeha commented 4 years ago

Hi,

from time to time, following error occurs:

>>> optee_examples_ext 1.0 Building
PATH="/home/alzeha/Desktop/bc-praktikum-group2/optee-project-for-rpi3/out-br/host/bin:/home/alzeha/Desktop/bc-praktikum-group2/optee-project-for-rpi3/out-br/host/sbin:/home/alzeha/bin:/home/alzeha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"  /usr/bin/make   -C /home/alzeha/Desktop/bc-praktikum-group2/optee-project-for-rpi3/out-br/build/optee_examples_ext-1.0/
Scanning dependencies of target optee_example_hello_world
Scanning dependencies of target optee_example_acipher
Scanning dependencies of target optee_example_aes
Scanning dependencies of target optee_example_hotp
Scanning dependencies of target optee_example_random
Scanning dependencies of target optee_example_secure_storage
[  8%] Building C object hello_world/CMakeFiles/optee_example_hello_world.dir/host/main.c.o
[ 16%] Building C object aes/CMakeFiles/optee_example_aes.dir/host/main.c.o
[ 25%] Building C object acipher/CMakeFiles/optee_example_acipher.dir/host/main.c.o
[ 33%] Building C object random/CMakeFiles/optee_example_random.dir/host/main.c.o
[ 41%] Building C object hotp/CMakeFiles/optee_example_hotp.dir/host/main.c.o
[ 50%] Building C object secure_storage/CMakeFiles/optee_example_secure_storage.dir/host/main.c.o
[ 58%] Linking C executable optee_example_hello_world
[ 66%] Linking C executable optee_example_random
[ 75%] Linking C executable optee_example_hotp
[ 83%] Linking C executable optee_example_aes
[ 91%] Linking C executable optee_example_acipher
[ 91%] Built target optee_example_hello_world
[ 91%] Built target optee_example_random
[ 91%] Built target optee_example_hotp
[100%] Linking C executable optee_example_secure_storage
[100%] Built target optee_example_aes
[100%] Built target optee_example_acipher
[100%] Built target optee_example_secure_storage
Building /home/alzeha/Desktop/bc-praktikum-group2/optee-project-for-rpi3/out-br/build/optee_examples_ext-1.0/acipher/ta/Makefile
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  CC      out/acipher_ta.o
  CC      out/user_ta_header.o
  CPP     out/ta.lds
  GEN     out/dyn_list
  LD      out/a734eed9-d6a1-4244-aa50-7c99719e7b7b.elf
  OBJDUMP out/a734eed9-d6a1-4244-aa50-7c99719e7b7b.dmp
  OBJCOPY out/a734eed9-d6a1-4244-aa50-7c99719e7b7b.stripped.elf
  SIGN    out/a734eed9-d6a1-4244-aa50-7c99719e7b7b.ta
Traceback (most recent call last):
  File "/home/alzeha/Desktop/bc-praktikum-group2/optee-project-for-rpi3/optee_os/out/arm/export-ta_arm64/scripts/sign_encrypt.py", line 258, in <module>
    main()
  File "/home/alzeha/Desktop/bc-praktikum-group2/optee-project-for-rpi3/optee_os/out/arm/export-ta_arm64/scripts/sign_encrypt.py", line 131, in main
    from Cryptodome.Signature import pss
ModuleNotFoundError: No module named 'Cryptodome'
make[3]: *** [/home/alzeha/Desktop/bc-praktikum-group2/optee-project-for-rpi3/optee_os/out/arm/export-ta_arm64/mk/link.mk:104: out/a734eed9-d6a1-4244-aa50-7c99719e7b7b.ta] Error 1
make[2]: *** [package/pkg-generic.mk:242: /home/alzeha/Desktop/bc-praktikum-group2/optee-project-for-rpi3/out-br/build/optee_examples_ext-1.0/.stamp_built] Error 2
make[1]: *** [Makefile:23: _all] Error 2
make[1]: Leaving directory '/home/alzeha/Desktop/bc-praktikum-group2/optee-project-for-rpi3/out-br'
make: *** [common.mk:227: buildroot] Error 2

I am not really sure about the reasons, when it happens. It seems like this error corresponds to the circumstances of adding new python packages from github, using the $(eval $(python-package)) command. But again: Not sure about this. Including the missing library does not help and as I said, it often works.

Has someone seen something similar? This is a very strange behavior, isn't it?

EDIT: On my new Linux Mint machine, Python2 is not really broadly accepted anymore. So it might is a problem with cryptodome, but due to these outdated prerequisites?

jforissier commented 4 years ago

This issue has been reported numerous times, there is no clear answer because each Linux distribution and version has its own specificities. In any case you need to figure out which package to install that provides the Python 3 Cryptodome module.

alzeha commented 4 years ago

Ok, so I do not really get, why this is distro specific, but nevertheless, if you know that error...

Thx