Open zhepoch opened 4 years ago
Take a look at my feature/binary_build branch. There is a scripts/pyocd.spec
file and scripts/build_pyinstaller.sh
. Unfortunately, it doesn't work yet due to an issue with the prettytable dependency. It builds ok, but when you run pyocd a pkg_resources.DistributionNotFound
exception is raised when prettytable tries to call pkg_resources.get_distribution()
. There is an attempt at a hook under scripts/hooks
based on pyinstaller/pyinstaller#4809, but it doesn't work.
If you can make progress, that would by great! You can either comment here with your improvements or create a PR to my feature/binary_build branch.
Note that another option I haven't yet explored but seems promising is PyOxidizer.
I found the root cause that package (Prettytable) init.py is an issue. and I just added some codes in that file like this :
from pkg_resources import get_distribution, DistributionNotFound import os.path try: _dist = get_distribution('prettytable') dist_loc = os.path.normcase(_dist.location) here = os.path.normcase(file) if not here.startswith(os.path.join(dist_loc, 'prettytable')): raise DistributionNotFound except DistributionNotFound: version = 'Please install this project with setup.py' else: version = _dist.version
Despair is that when I execute "./pyocd list --target" explore some warnnings, so I'm not sure if it's still a build binary issue.
./dist/pyocd list --target 0000215:WARNING:loader:unable to open builtin SVD file: [Errno 2] No such file or directory: '/tmp/_MEIp1l1zs/pyocd/debug/svd/svd_data.zip' Traceback (most recent call last): File "pyocd/debug/svd/loader.py", line 37, in from_builtin zip_stream = pkg_resources.resource_stream("pyocd", BUILTIN_SVD_DATA_PATH) File "pkg_resources/__init__.py", line 1135, in resource_stream File "pkg_resources/__init__.py", line 1383, in get_resource_stream File "pkg_resources/__init__.py", line 1386, in get_resource_string File "pkg_resources/__init__.py", line 1553, in _get File "/home/glb/build_pyocd/env/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 341, in get_data with open(path, 'rb') as fp: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEIp1l1zs/pyocd/debug/svd/svd_data.zip'
I'm tried on python3.8, But not work.
pip list:
Build log: