flexxui / webruntime

Launch HTML5 apps in the browser or a desktop-like runtime.
http://webruntime.readthedocs.io
BSD 2-Clause "Simplified" License
43 stars 10 forks source link

_common.py exe_name on MacOS #13

Closed blissend closed 4 years ago

blissend commented 5 years ago

https://github.com/flexxui/webruntime/blob/5868b778f6ebe586e3843b493c1d5c31b14b10a8/webruntime/_common.py#L389 This line is splitting something like /usr/local/opt/python/bin/python3.7 to have ext be 7 and making the exe_name on the next line be python3-ui.7 which isn't actually available in the directory it's trying to run from...

/Users/<someUser>/Library/Application Support/webruntime/temp_apps/firefox_1556661877_1~26506/python3-ui.7.app/Contents/MacOS
$ ls
XUL             libfreebl3.dylib        libmozglue.dylib        libplugin_child_interpose.dylib python3-ui
crashreporter.app       liblgpllibs.dylib       libnss3.dylib           libsoftokn3.dylib       updater.app
firefox             libmozavcodec.dylib     libnssckbi.dylib        pingsender
firefox-bin         libmozavutil.dylib      libnssdbm3.dylib        plugin-container.app

For MacOS the temp workaround is to just comment out the next line + ext part. Not doing this causes builtins.ValueError: Could not detect a suitable backend among ['firefox-app', 'nw-app']. error message but after a bunch of print statements I found the buggy part :D

Perhaps for a longer term fix is to just add ext for the other OS platforms? Or just list the directory files where app_exe is found and see what ext is if any?

NOTE: This issue manifests in the current master branch and the one in pypi for flexx

almarklein commented 5 years ago

Thanks for reporting this issue!

It looks like it's probably best to only use that line on Windows, and use the (now commented) line on Unix.