Skip to content

Build fails on Mac OSX 10.14.6 #4

@gbillyb

Description

@gbillyb

during the build process, ozw-admin/scripts/macdeployqtfix.py fails with the following error:

INFO | fixing executable '../ozwadmin.app/Contents/MacOS/ozwadmin'
Traceback (most recent call last):
  File "/Users/gbromley/projects/HomeAutomation/Z-Wave/ozw-admin/scripts/macdeployqtfix.py", line 395, in <module>
    main()
  File "/Users/gbromley/projects/HomeAutomation/Z-Wave/ozw-admin/scripts/macdeployqtfix.py", line 385, in main
    if fix_main_binaries():
  File "/Users/gbromley/projects/HomeAutomation/Z-Wave/ozw-admin/scripts/macdeployqtfix.py", line 323, in fix_main_binaries
    if fix_binary(GlobalConfig.exepath):
  File "/Users/gbromley/projects/HomeAutomation/Z-Wave/ozw-admin/scripts/macdeployqtfix.py", line 307, in fix_binary
    for dep in get_dependencies(binary):
  File "/Users/gbromley/projects/HomeAutomation/Z-Wave/ozw-admin/scripts/macdeployqtfix.py", line 64, in get_dependencies
    deps = [s.strip().split(' ')[0] for s in proc_out.stdout.splitlines()[1:] if s]
  File "/Users/gbromley/projects/HomeAutomation/Z-Wave/ozw-admin/scripts/macdeployqtfix.py", line 64, in <listcomp>
    deps = [s.strip().split(' ')[0] for s in proc_out.stdout.splitlines()[1:] if s]
TypeError: a bytes-like object is required, not 'str'
make[1]: *** [../ozwadmin.app/Contents/MacOS/ozwadmin] Error 1
make: *** [sub-ozwadmin-main-make_first-ordered] Error 2

The issue is the binary output from the otool command.
It's a simple fix so I haven't created a pull request, just the diff below. I hope this is ok.

--- a/scripts/macdeployqtfix.py
+++ b/scripts/macdeployqtfix.py
@@ -61,7 +61,7 @@ def get_dependencies(filename):
     deps = []
     if proc_out.retcode == 0:
         # some string splitting
-        deps = [s.strip().split(' ')[0] for s in proc_out.stdout.splitlines()[1:] if s]
+        deps = [s.strip().split(b' ')[0].decode('utf-8') for s in proc_out.stdout.splitlines()[1:] if s]
         # prevent infinite recursion when a binary depends on itself (seen with QtWidgets)...
         deps = [s for s in deps if os.path.basename(filename) not in s]
     return deps

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions