New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Windows Packaging #331
Conversation
3588671
to
246f305
Compare
Looks great, thanks. |
@DjLegolas |
@DjLegolas |
@doadin I agree if we can start simple with dependencies the better, where needed we can modify it later to suit. For GTK we could fork the gvsbuild repo and create releases or store them on deluge ftp, either way we want a simple reproducible process. |
@cas-- Yes I plan on on making an CD github actions, since that seems to be what we are using for other things, that will making an installer using prebuilts from github actions image, which the only thing I see needed out side of that is GTK ill make the script to use from appveyor since thats where im currently setting up a build, should be a easy change in url to a different host depending on where you would like to get it from. |
@DjLegolas @cas-- Edit: also the path to gtk may need editing all depends on how we get gtk and how the zip for it looks and is extracted and so on. Again though should be a fairly easy edit of the spec file to make any correction for how the build environment is setup. Appveyor and github actions (maybe others) seem to put openssl and such in the same location so should be pretty easy to make work any where really. Also I made the sample only build on pushed tags so any time you want to make a release should be as simple as adding a tag. We could maybe build for PRs too or something but you guys can decide that. |
884c8e7
to
8b6bebf
Compare
BTW, great work @doadin 🥇 |
d7b72e3
to
ed4e3c8
Compare
@DjLegolas @cas-- I think I have addressed the points you guys have brought up, still uncertain about nsis use again I'm not very familiar but I think other than it being cleaner its at least close to proper syntax? |
de7916e
to
b250a12
Compare
@cas-- I combined some of the commits that aimed to do the same thing so its done in 5 commits now vs 12 so its still seperate to see the process that happened to implement fixes, idk if you like this better or not or want it reduced even more? Or maybe this is worse? I saved a copy of how it was in a branch on my fork if you don't like it like this. |
664b790
to
e1cbb6a
Compare
* Rename instances of win32 to generic win or the appropriate bit where applicable * Remove files used in GTK2 * Add spec file for use with PyInstaller * Remove Python bbfreeze Script * Add Github Action To Build Releases * Add Modified script to make files used by NSIS * Update Readme
the only thing not separate is the process we went through to be able to go from py3.7 to newer other than that its still all separate so the process can be seen, just in fewer steps instead of going back and forth and having commits just changing libtorrent versions.(things I think didn't need to be separate got squished) Again I have a copy of how it was before though if this is not better. |
@doadin @mhertz first of all, great work guys. The long waited installer is an important milestone for Deluge 2.0 🥇 💯 Regarding only the commits, I would suggest to add to the reason for the patched And again, thanks for this (>130 comments 🤣) MR! |
pull_request: | ||
branches: | ||
- develop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be dropped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few changes proposed. Overall okay and is stable and working. See my further comment for additional details on possible issues however.
|
||
# Add Deluge Hidden Imports | ||
tmp_ret = collect_all('deluge') | ||
hiddenimports += tmp_ret[2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- tmp_ret = collect_all('deluge')
- hiddenimports += tmp_ret[2]
+ hiddenimports += collect_all('deluge')[2]
tmp_ret = collect_all('deluge') | ||
hiddenimports += tmp_ret[2] | ||
|
||
#Add Hidden Imports for Plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- #Add Hidden Imports for Plugins
+ # Add Hidden Imports for Plugins
- tmp_ret2 = collect_all('twisted')
- hiddenimports += tmp_ret2[2]
+ hiddenimports += collect_all('twisted')[2]
# -*- mode: python ; coding: utf-8 -*- | ||
import os | ||
import sys | ||
import deluge.common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only used by get_version
which itself is unused.
- import deluge.common
pip install $pycairopath | ||
pip install $PyGObjectpath | ||
pip install https://github.com/doadin/twisted/releases/download/latest/Twisted-21.7.0.post0-py3-none-any.whl | ||
python -m pip install libtorrent==${{ matrix.libtorrent }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason why rest of file uses pip
while this line uses python -m pip
? Note that pip
might reference different binary than module loaded by python -m
.
pip install https://github.com/doadin/twisted/releases/download/latest/Twisted-21.7.0.post0-py3-none-any.whl | ||
python -m pip install libtorrent==${{ matrix.libtorrent }} | ||
pip install -r requirements.txt | ||
pip install pyinstaller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this is done separately from libtorrent
?
$PyGObjectpath = Get-Childitem –Path "C:\GTK\release\python\" -Include PyGObject*.whl -File -Recurse -ErrorAction SilentlyContinue | select -expand FullName | ||
pip install $pycairopath | ||
pip install $PyGObjectpath | ||
pip install https://github.com/doadin/twisted/releases/download/latest/Twisted-21.7.0.post0-py3-none-any.whl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I have nothing against it by itself, this is introducing dependency on binary release that is outside of Deluge control. We should patch it ourselves or keep patched repository under deluge-torrent
organization.
- name: Fix OpenSSL For Libtorrent | ||
if: ${{ matrix.arch == 'x64' }} | ||
run: | | ||
Copy-Item -Path $env:GITHUB_WORKSPACE\packaging\win\freeze\Deluge\libssl-1_1.dll -Destination $env:GITHUB_WORKSPACE\packaging\win\freeze\Deluge\libssl-1_1-x64.dll |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked if this is necessary on GH instance? A quick run from 64-bit Windows shows that there are no libssl-1_1.dll
files produced when running with 64-bit Python, only x64
variants. Perhaps GH x64
arch uses 32-bit Python?
block_cipher = None | ||
|
||
|
||
a = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Scripts\deluge-console-script.py'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section looks good however it could be cleaner if we put the executable generation in a loop, so that any changes need to be done only once, not 6 times.
I have not checked the version that adds This was an issue with v1 too, back then YaRSS2 had its own custom code for The other issue that remains is how broken GTK3 is on Windows. Seeing some weird issues where clicking Deluge icon on taskbar does bring window to front but doing so again does not minimize it as one would expect. Using In addition, do we want to also rebase this PR for 2.0.5 so that Windows users can have a stable release? 2.1 introduces some breaking Python2 related changes that will again require attention from some plugin developers so we might want to port back some of the fixes that @cas-- pushed to 2.0.5, make it a 2.0.6 release and push a Windows installer with it, while work on 2.1 continues. For reference, even without these fixes 2.0.5 is very much usable using this PR, however I only tested it as thin-client so YMMV. |
@CirnoT, I specified e.g gtk_csd=0 other place before, but my understanding was that it wasent global and only enherented for running proces, and not transferred. Wrong? Edit: Always been somewhat leery though, as stated to possibly have a performance penalty, didnt notice any though, but hard to judge, when only quick testing. |
@CirnoT Thanks for suggestions 👍 I know that for the dependency issues (e.g. email.mime) were manual fixed in bbfreeze and py2app: deluge/packaging/win32/deluge-bbfreeze.py Line 84 in d2390cd
Line 21 in d2390cd
Can you more specific about Python2 breaking changes? I probably will have to create a 2.0.x release branch anyway so certainly possible to release 2.0.5/6 for Windows.
Did you mean |
Yes. If its possible to set environment variable for executable via
Less performance on drawing items is in my opinion preferable to broken interaction with Windows DWM.
I am not sure where you set it. Environment variables are usually either set when running process or globally for user/computer (in which case it would apply to everything). If as mentioned above
Some plugins (in this example YaRSS2) still retain some level of compatibility for Python 2, even on releases that are meant for Deluge 2. See https://bitbucket.org/bendikro/deluge-yarss-plugin/issues/67/deluge-210-removed-all-py2-support for details. The common offenders will most likely be Perhaps we could keep PY2 as a dumb stub ( |
Ideally we would package all standard modules, so that there is no difference between available environment for Windows and Linux. Python 3.10 would make it easy with For reference, here is full list of available modules for Python versions between 3.7 and 3.9 (note that some of them will not exist depending on version used, for example
Providing it as-is to hidden imports in pyinstaller SHOULD be fine, it silently skips over imports it can't enumerate. |
Very quick, as not liking intrude on your important things, but just remembered that I otherplace added requests(not stdlib) and pygame, from pip, when installing deluge from pip, so springjools's autoremoveplus fork can even be enabled/used(don't know if relevant to you), and notifications default plugin works for playing sound. Don't need to respond. Thanks for everything you good people do :) |
Appreciated to know, however non-stdlib requirements are something plugin developers must solve themselves, otherwise users are forced to take manual steps (like you did), so this is not something we can accommodate when packaging Windows version. For example, YaRSS2 depends on |
Wanted to let doadin answer, but as I had tested it anyways, then maybe save him some time... With CirnoT hiddenimports list added to spec, and
Then yarss2 still fails because of that python2 support removed, so as not sure how add py2 dumb stub as suggested, then just tested deluge master branch, and worked with above, sorry for not cutting down propperly the collect_all. Edit: Sorry, don't use yarss2, and just saw it was possible to enable yarss2 now and the plugin sub-menu came through in gtkui propperly. |
Done via 6da4c4b |
@doadin So I am happy to merge this just now and we can work on cleaning it up further in new PRs Thank you again for all the work in getting to this stage! These are some the issues that have come up in and still need addressed:
|
Btw the job will not run by default on PRs but I added a condition if labelled with 'windows' so can try that out to see if it works... |
About the stdlib, why not use the |
@cas-- Sorry, I just woke up was going to make a commit with some of the requested changes, was just commenting and saw you merged. |
That is not compatible with pyinstaller, or are you suggesting that we should abandon pyinstaller and create our own stub executables using embeddable package? |
CirnoT reported how they felt that GTK3 is not reliable on Windows. Seeing some weird issues where clicking Deluge icon on taskbar does bring window to front but doing so again does not minimize it as one would expect. By using GTK_CSD=0 this would reduce these problems. > If changed to 0, this disables the default use of client-side decorations on GTK windows, thus making the window manager responsible for drawing the decorations of windows that do not have a custom titlebar widget. This can be overridden by a global env var. Ref: deluge-torrent#331 (comment) Ref: https://docs.gtk.org/gtk3/running.html
CirnoT reported how they felt that GTK3 is not reliable on Windows. Seeing some weird issues where clicking Deluge icon on taskbar does bring window to front but doing so again does not minimize it as one would expect. By using GTK_CSD=0 this would reduce these problems. > If changed to 0, this disables the default use of client-side decorations on GTK windows, thus making the window manager responsible for drawing the decorations of windows that do not have a custom titlebar widget. This can be overridden by a global env var. Ref: #331 (comment) Ref: https://docs.gtk.org/gtk3/running.html
Check that deluge-console works.
Plugins Execute & Extractor Won't start:
Answer: 3aec79f
Answer: e8874aa
Answer: libtorrent + pyinstaller requires a lib(ssl/crypto)-1_1.dll and lib(ssl/crypto)-1_1-x64.dll odd quirk but solveable by just having two copies. Maybe later compiling our own libtorrent.
Answer: Not needed libtorrent isn't build static and pyinstaller grabs the redist files.
Answer: Not needed but comes from collect_all('deluge'):hiddenimports which is needed.