I have an update in progress for the port, but I'll make sure to test it with Python 3.9.
What's the build issue?
BaseTools/Source/Python/AutoGen/UniClassObject.py: codecs.lookup('ucs-2') --> LookupError: unknown encoding: ucs-2 So, change to codecs.lookup('utf-16') BaseTools/Source/Python/Common/Misc.py: array.tostring() has been renamed to array.tobytes() ref. https://docs.python.org/3/library/array.html#array.array.tobytes Note, the document says "New in version 3.2: tostring() is renamed to tobytes() for clarity.", but seems pkg.freebsd.org can build it with Python 3.8.
I'm fairly sure this will have been fixed with the update to edk2-stable202202: commit 7d47e1f2971cabf764770d0388b2c6ad671e9f94 Author: Emmanuel Vadot <manu@FreeBSD.org> Date: Mon May 2 18:49:56 2022 +0200 sysutils/edk2: Update to stable202202 Release notes: https://github.com/tianocore/edk2/releases/tag/edk2-stable202202 Release notes: https://github.com/tianocore/edk2/releases/tag/edk2-stable202111 Release notes: https://github.com/tianocore/edk2/releases/tag/edk2-stable202108 Release notes: https://github.com/tianocore/edk2/releases/tag/edk2-stable202105