simonrob / email-oauth2-proxy

An IMAP/POP/SMTP proxy that transparently adds OAuth 2.0 authentication for email clients that don't support this method.
Apache License 2.0
797 stars 86 forks source link

No menu with pyinstaller #197

Closed debilin closed 11 months ago

debilin commented 11 months ago

The proxy runs fine when I installed it directly using pip. But when I build it with pyinstaller I only see the icon in the taskbar but no menu when I clicked on it. I am on Linux Mint 21 Cinnamon. The icon also appear discolored. I build it with the command

pyinstaller --onefile emailproxy.py

Can you give me some pointer?

simonrob commented 11 months ago

PyInstaller builds are not tested (or supported), and are more of a bonus than a core feature.

My instinct is that this behaviour is due to a missing import for pystray on Linux that PyInstaller is not detecting. It might be worth trying the same build configuration that is know to work for the release macOS and Windows builds – see the GitHub action file. Does this make any difference?

If not, and you can track down the missing dependency, you should be able to add this in the same way the timeago one is included (i.e., --hidden-import missing.package.name).

debilin commented 11 months ago

I finally found the reason. I ran pyinstaller inside docker and so pystray didn't get included because there is no X server and I got a Bad display name error which I couldn't see because the log was collapsed during the docker build run. When I build inside a full VM in VirtualBox, pyinstaller generated an single executable that work just fine with menu and all. Thanks.