petersasi / deluge2-win-build

A set of scripts to prepare and build Deluge2 and it's prerequisites for Windows
https://github.com/petersasi/deluge2-win-build
96 stars 6 forks source link

Deluge build failure. #4

Closed mhertz closed 3 years ago

mhertz commented 4 years ago

I just noticed deluge build scripts currently will fail building for new users unfortunetly.

The issue I discovered by chance(from linux), is that I found pip caches previously installed wheels and uses when found during install. Two of the needed wheels are currently removed for some reason from pypi in py3.8 versions(sometimes happens and sometimes returns back later, dunno why, but noticed it once previously with other wheel for deluge, which came back later), and so will fail if not having them already in cache(as I did, and you, since you didn't notice before - cache is in %localappdata%\pip\wheels). The missing wheels here, in py3.8 versions needed, is twisted and setproctitle.

I don't know how to set it up to work automatically through msvc to build from source, through pip, when that happens, but instead luckilly a third-party website has most of deluge needed wheels in up to date versions(even py3.9 versions already!), so I personally in my scripts changed to using that website for getting twisted and setproctitle, before installing deluge, so doesn't fail.

I was about to make a PR, but decided against because I use variable names here, which you before stated you change, and also with the already existing PR, editing same files, I was in doubt if would work if merging one PR before the other in wrong order, possible, but could have added them to same PR of-course instead, but whatever, i'll just provide the workaround/fix here instead.

If wanted to use this, then this is what I added to both my deluge-build-scripts, just before the line copying new loaders in-place, and tested working for both deluge versions, which you can use for inspiration possibly, if wanted:

for /f %%i in ('echo %var2% ^| cut -c 1-3 ^| tr -d "."') do set var3=%%i
for /f %%i in ('git ls-remote --tags --refs https://github.com/twisted/twisted ^| cut -f2 ^| sort --version-sort ^| cut -c 19- ^| tail -1') do C:\python\Scripts\pip install https://download.lfd.uci.edu/pythonlibs/w3jqiv8s/Twisted-%%i-cp%var3%-cp%var3%-win_amd64.whl
for /f %%i in ('git ls-remote --tags --refs https://github.com/dvarrazzo/py-setproctitle ^| cut -f2 ^| sort --version-sort ^| cut -c 19- ^| tail -1') do C:\python\Scripts\pip install https://download.lfd.uci.edu/pythonlibs/w3jqiv8s/setproctitle-%%i-cp%var3%-cp%var3%"-win_amd64.whl
mhertz commented 3 years ago

The link has changed, so above fix not working now. The owner has protected the links for outside downloading without visiting site, so I originally had to use chromium developer console to retrieve the hidden links, but now I see it's changed already sadly. I have retrieved new link now and will post it here, but annoying that it seemingly will get changed again later on. I will think of better solution, but also didn't like just having a copy of the wheels sitting static in the deluge2 folder and so not getting updates. Hmm, atleast if failing then it could be set to fall back to such, but for now here's the new links, which hopefully not will be changed anytime soon:

https://download.lfd.uci.edu/pythonlibs/x2tqcw5k/Twisted-%%i-cp%var3%-cp%var3%-win_amd64.whl https://download.lfd.uci.edu/pythonlibs/x2tqcw5k/setproctitle-%%i-cp%var3%-cp%var3%"-win_amd64.whl

(Links above don't work standalone and needs the rest of batch file to work - just for others possibly reading this and being confused)

Edit: A possible solution could be use gohlkegrabber, which I might add support for later: https://pypi.org/project/gohlkegrabber/

mhertz commented 3 years ago

I changed to using gohlkegrabber on my end, to avoid issues with links changing:

python\Scripts\pip install gohlkegrabber
python\python -c "from gohlkegrabber import GohlkeGrabber; gg = GohlkeGrabber(); gg.retrieve('.', 'twisted')"
python\python -c "from gohlkegrabber import GohlkeGrabber; gg = GohlkeGrabber(); gg.retrieve('.', 'setproctitle')"
for /f %%i in ('dir /b twisted-*-win_amd64.whl') do python\Scripts\pip install %%i
for /f %%i in ('dir /b setproctitle-*-win_amd64.whl') do python\Scripts\pip install %%i
python\Scripts\pip uninstall -y gohlkegrabber lxml
del twisted-*-win_amd64.whl
del setproctitle-*-win_amd64.whl