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

HiKey: build requires Python 2 #459

Open
jforissier opened this issue Mar 4, 2021 · 8 comments
Open

HiKey: build requires Python 2 #459

jforissier opened this issue Mar 4, 2021 · 8 comments
Labels

Comments

@jforissier
Copy link
Contributor

The version of EDK2 included in the HiKey build requires Python 2, which is deprecated.
On a build host with Python 3 only:

$ make
[...]
make[2]: Entering directory '/home/jerome/work/optee_repo_hikey/edk2/BaseTools/Tests'
Traceback (most recent call last):
  File "RunTests.py", line 22, in <module>
    import TestTools
  File "/home/jerome/work/optee_repo_hikey/edk2/BaseTools/Tests/TestTools.py", line 94
    print description, '(base64 encoded):'
          ^
SyntaxError: invalid syntax
make[2]: *** [GNUmakefile:17: test] Error 1
make[2]: Leaving directory '/home/jerome/work/optee_repo_hikey/edk2/BaseTools/Tests'
make[1]: *** [GNUmakefile:25: Tests] Error 2
make[1]: Leaving directory '/home/jerome/work/optee_repo_hikey/edk2/BaseTools'
make: *** [Makefile:138: edk2] Error 2
@github-actions
Copy link

github-actions bot commented Apr 4, 2021

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label Apr 4, 2021
@vchong vchong added bug and removed Stale labels Apr 4, 2021
@jforissier
Copy link
Contributor Author

I spent a few hours on this, trying to update EDK2, and I must admit I failed :-/

First, the Python 3 commits in upstream EDK2 are not completely trivial to identify. But more importantly the EDK2 HiKey/HiKey960 branch is very different from upstream (it is 3 years old and has not been rebased). So, backporting commits from upstream is very difficult. The other way around (applying HiKey/HiKey960 patches onto upstream) is equally hard. Not mentioning the crazyness^Wcomplexity of the EDK2 build system which also rules out another approach: try and fix issues as they appear.

So, my plan is: continue using the current code while possible, that is while Python 2 can still be run. Then perhaps switch to a more reasonable bootloader such as U-Boot (which apparently as received support for HiKey* recently: https://source.denx.de/u-boot/u-boot/-/tree/master/board/hisilicon).

@jbech-linaro
Copy link
Contributor

jbech-linaro commented Jun 29, 2021

Then perhaps switch to a more reasonable bootloader such as U-Boot (which apparently as received support for HiKey* recently: https://source.denx.de/u-boot/u-boot/-/tree/master/board/hisilicon).

You definitely get my +1 for that (and this might be useful as well https://github.com/jbech-linaro/u-boot-hikey ... but if there is official support, then maybe limited use of the stuff I did a long time ago).

@jforissier
Copy link
Contributor Author

Apparently there is HiKey/HiKey960 support in upstream https://github.com/tianocore/edk2-platforms (along with the main repository https://github.com/tianocore/edk2), and we already are using those Gits for FVP and Synquacer. So I will give that a try first.

@github-actions
Copy link

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

@MartinSchoenstedt
Copy link

I also came in contact with this issue on a new machine without python2. Maybe for now just add python2 to the prerequisites of OP-TEE or at least in the device specific information for the hikey board would be a temporary solution, as I searched quite some time until I found this open issue.

@jforissier
Copy link
Contributor Author

@MartinSchoenstedt I also learned that upstream EDK2 was lacking support for some stuff that are present in the fork (UFS I believe), at least it was the case back when I worked on this. So it could be more work than just a matter of Python2 vs Python3.

One other thing to consider: the OP-TEE CI loop used to run tests on HiKey, it doesn't anymore(new machine without Python2). I am in the process of introducing RockPi4B in the build environment (build.git / manifest.git) to replace it. That being said, I have no intention to remove plat-hikey from the optee_os source tree at the moment, and I will continue to run tests once in a while (at release time). So if you are targeting HiKey and can manage to deal with the Python2 issue, then you should be fine.

@MartinSchoenstedt
Copy link

@jforissier

So if you are targeting HiKey and can manage to deal with the Python2 issue, then you should be fine.

For me, just installing python2 solved the issue. I did not change EDK2 from the op-tee fork at all or modified anything else.

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

No branches or pull requests

4 participants