Closed badabing2005 closed 2 years ago
Hi @badabing2005, thank you for the detailed issue! :)
I forked the repository in question, removed the line of hooksconfig = {}
in the build-on-linux.spec
file, altered the github action to run and it worked fine, so this might be the change you are seeking 👍
You can find a successful run here: https://github.com/JackMcKew/PixelFlasher/runs/5964114295?check_suite_focus=true
Closing this issue, please reopen if there's any other problems :)
Thanks for such a super quick turnaround.
I noticed that the generated file is only 10MB, whereas the one I build locally is 118MB And when I run the Github generated one, I get the following error.
Traceback (most recent call last):
File "PixelFlasher.py", line 3, in <module>
import Main
File "/root/.pyenv/versions/3.7.5/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
File "Main.py", line 3, in <module>
import wx
ModuleNotFoundError: No module named 'wx'
Needless to say, the local build one is working. I'm assuming that it did not build / bundle wx ?
What's the solution?
Thanks
From my understanding you should be able to add another bash step into your action to install wx with apt-get install wx
https://stackoverflow.com/questions/67496398/how-to-build-a-wxwidgets-program-on-github-actions
Thanks for your assistance, I couldn't find a package for the current version, and my attempts at building from the source all failed.
On my local system Ubuntu 20.04 The following steps were enough, buts somehow not enough with Github actions.
sudo apt install python3-pip
sudo apt install python3.8-venv
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython
sudo apt install libgtk-3-0
sudo apt-get install libnotify4
sudo apt-get install libsdl2-2.0.0
pip install -r requirements.txt
./build.sh
Update: I managed to get this working. The root issue is that building wxPython from source distribution fails on the cdrx/docker-pyinstaller Docker container, which is using ubuntu:12.04
I knew that I could build it successfully on my local Ubuntu 20.04, so I build a docker pyinstaller-wxpython-linux based on Ubuntu 20.04. Then I forked this repository and made the necessary changes to use badabing2005/pyinstaller-wxpython-linux instead of cdrx/docker-pyinstaller. It worked and the results can be seen here.
Unfortunately it takes very long time to build wxPython from source, it took over 37 minutes.
Considering that there is pre-built wheel file available for Ubuntu 20.04 https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04, I updated the docker image to include it (Tag: 1.1).
On my local setup that made the whole process much faster, yet when I do the same thing with Github actions, it always tries to build it from source.
By any chance is it possible that Github is caching the docker image used and is not using the updated one, even though I assigned a specific Tag 1.1 and updated the action to use that? I doubt it, but that is exactly how it is behaving,
On my local, if I build it with 1.0, it takes long and builds the wxPython just like it happens on Github, but if I build it with 1.1, it is super quick and it works as expected. But not on Github.
I can include --only-binary
for wxPython; --only-binary wxPython~=4.1.1
then the generated executable does not include it, the program is 15MB instead of 120MB and of course it does not work.
Describe the bug I use pyinstaller-action-windows which builds WxPython based package successfully, However I'm running into issues building for Linux. I can build it locally on Ubuntu 20.04 but not with pyinstaller-action-linux on Github.
You can see the error here.
To Reproduce Steps to reproduce the behavior:
If this is not a bug and I'm doing something wrong, I appreciate any guidance that helps me resolve this issue.
PS: Another question, is it possible to build of MacOS as well
Thanks