OP-TEE / optee_os

Trusted side of the TEE
Other
1.54k stars 1.04k forks source link

Mix of python2 and python3 #3111

Closed ricardosalveti closed 4 years ago

ricardosalveti commented 5 years ago

Python scripts are all a mix between python2 and python3, which not ideal to handle when building optee-os on a clean system. Since most distros are moving towards supporting python3 only, it is probably a good idea to port all the scripts to python3 as well, or at least fix one base python version to use.

$ grep -R "env python"
core/arch/arm/plat-stm32mp1/scripts/stm32image.py:#!/usr/bin/env python3
scripts/gen_ldelf_hex.py:#!/usr/bin/env python
scripts/tee_bin_parser.py:#!/usr/bin/env python
scripts/gen_hashed_bin.py:#!/usr/bin/env python
scripts/arm32_sysreg.py:#!/usr/bin/env python
scripts/bin_to_c.py:#!/usr/bin/env python3
scripts/mem_usage.py:#!/usr/bin/env python3
scripts/gen_ld_sects.py:#!/usr/bin/env python
scripts/symbolize.py:#!/usr/bin/env python
scripts/pem_to_pub_c.py:#!/usr/bin/env python
scripts/ta_bin_to_c.py:#!/usr/bin/env python
scripts/sign.py:#!/usr/bin/env python
jbech-linaro commented 5 years ago

@ricardosalveti , you're right, we've had this up for discussion a couple of times. We need to have the transition to python3 before the countdown reaches zero.

wamserma commented 5 years ago

FWIW, here's the list reduced to what is left for migration:

find . -type f -name "*.py*" -exec grep -i 'python' {} + | grep -v python3
./scripts/tee_bin_parser.py:#!/usr/bin/env python
./scripts/gen_ld_sects.py:#!/usr/bin/env python
./scripts/arm32_sysreg.py:#!/usr/bin/env python
./scripts/symbolize.py:#!/usr/bin/env python
./scripts/pem_to_pub_c.py:#!/usr/bin/env python
./scripts/gen_hashed_bin.py:#!/usr/bin/env python
./scripts/sign.py:#!/usr/bin/env python
jbech-linaro commented 5 years ago

I know that some of the scripts have been tweaked to run both on Python 2 and 3, so I guess the work of converting all of them isn't probably that big. But still, some work left to be done.