-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Switch sickchill to use a pypi based install to match other distributions #5431
Conversation
…ions Signed-off-by: miigotu <[email protected]>
I built this and it isn't grabbing all the pip install items before crashing with
the error on line 76 is because it doesn't exist. Only got pip and setuptools in env/lib/python3.10/site-packages/ too. |
Strange, afaik the wheels are supposed to be installed on post_install, line 40 of the service setup script I copied the way they do it in the beets package |
By the way, you don't need to build them manually. Go to the actions tab and look at the run for this PR, the spk is in the artifacts for each arch. Download the zip. |
Maybe @publicarray or someone else knows what's going on. |
same result with the x64 7 from here https://github.com/SynoCommunity/spksrc/actions/runs/3056555847 Further review shows error in packages. Requirements-pure issue.
|
Update all pypi items to current
I may be able to give it a look over the weekend if that can help |
Adjusted the requirements files, needs a pull in @miigotu repo |
Update requirements-crossenv.txt
Update requirements-pure.txt
There must be a nice way to generate the requirements files automatically when they change lol. I'm curious how I should make a PR to this repo automatically from GitHub actions if I have no easy way to tell that a package is pure python or requires cross compilation. |
Maybe I can make a PR to this https://pypi.org/project/johnnydep/#description |
do we even need version numbers in the requirements files if we want the current latest? |
Probably not, but it is best practices. There shouldn't need to be requirements files at all, if the sickchill wheel is installed into the virtualenv at build time rather than post_install you wouldn't need a requirements file at all. Just pip install sickchill with the build environment available. |
I bet if you emptied the requirements files and put the sickchill==2022.9.14 into requirements-cross.txt it would work just like that. It should build all of the dependencies required even if they need compiled and put them in wheelhouse. It might make the spk larger though, because pure wheels don't really need to be in the package. There needs to be a pep to determine if a package needs compiled... To work around the larger spk, you could delete any none-any.wheel in the makefile after the build before packaging. |
cryptography is being a pain in the butt again. 38.0.1 fails in build and requires > 35.0
|
I made a branch on my repo to test building it different. Maybe I can add something to the build process here to simplify upstream packages being able to help keep their packages up to date automatically. |
Is cross/cryptography supposed to be specified in our makefile? |
Update requirements-pure.txt
There's something odd going on, on my test pr I removed requirements-pure.txt and somehow it's regenerated in the build with poetry-date-version-plugin, which nothing should rely on. I'll need to run a dependency tree to see where that's from, maybe new-rtorrent-python or new-qbittorrent |
cryptography must be cross compiled and depends on setuptools-rust (and rust compiler). |
@BKSteve probably because I removed the extra index URL that has built wheels for cryptography. I really would rather it build natively in this tool chain, but it would work just fine from their repo |
I did a build with this suggestion. On my DSM 7 VM x64 machine it loaded perfectly and is running. |
You are on an x86_64 arch though, which has prebuilt wheels for cryptography on pypi. Arm7l doesn't for example, so it would not run for those people who don't have x64, amd64, arm64, aarch64, etc |
OK. in 8160 I have a link to the spk for those that are lucky enough to be on x64 which have cryptography available can use. |
Took a look at that PR and I see it's nearly done. Maybe when I'm at an actual PC I can try to build it 😂 |
@hgy59 as a side note, do you have any insight on how o can export our requirements easily to split them into requirements-cross and pure? I could move them all into requirements-cross (or idk if requirements.txt works directly) which would probably double the size of the spk. I know that seems bad because the initial download of the package takes longer, but install would definitely be faster. I also don't know the requirements your org has to manage artifact storage or syno repo storage, and if that comes into account. My thing is, I want to be able to write a GitHub action step in our release process that automatically checks out spksrc, exports our requirements so you can prebuild the wheels, edit the sickchill version string in the makefile, and open a PR here. Of course also checking if an existing PR is open from our spksrc:sickchill to here before opening one and if so just push to the open PR. It feels much cleaner to me to disable the sickchill in-app self updater and only allow updates through syno package center. Maybe we can create a script on spksrc that can filter a requirements.txt into pure and cross requirements files? Even if we have to hard code the list of cross requirements to check for it would help. I'd much rather lessen the load on us both of trying to keep this package up to date manually. Thoughts? |
Yes, no, maybie. There would probably be something based on other existing
If you move everything under cross you'll end-up getting build issues, often related to pip's inhability to find matching version. Although if you want your packate to include pure python wheels as well you can use EDIT: One of the many reasons is also with the objective of reducing file sizes on our repository as we're lacking that a lot.
Once you know which requirements needs to be cross-compiled everything else is pure. With that in mind you could generate your new requirement files from grep'ing your previous
Again, existing package requirement file could be used as an hard-coded list. Far from perfect but that's a start. Food for thoughts, at the framework level, as there where a lot of improvements over the past year for building wheels, perhaps requirements could be re-combined and, first pass using cross-compile mode and if it hits a build-error it automatically assume it must be retried using pure python build, then either builds OK or exit with an error code. |
I'm curious what would cause a pure python package to fail to build simply because a compiler and build dependencies are present? Without seeing the error, that seems like a flaw in the process somewhere. Just trying to imagine how that happens. |
@th0ma7 do you think if I made a global file in spksrc we can check against for packages that need cross that it would be accepted? I could create it from all of the requirements-cross.txt, strip the versions of the packages and remove duplicates, and then make a script that splits requirements.txt by comparison to that master list of packages that need cross. I guess I could do that entirely on my end or I could pass that script and list into spksrc via pr is my question. |
Well that something that a simple
I would keep that dynamic based on the status of existing package. But as I mentionned previously, I'll check if something could be done to allow unique |
If the package was still using py38 or 39 we could use wheels from piwheels for all the versions pyca doesn't build 😭 |
Easy enough to drop back to Python38 |
I just haven't had time to mess with it. I guess I need to set up a VM with a syno again and mess with it. I haven't had one set up in years, but testing non-standard architecture is going to be a hassle for either of us. Maybe I can help with the rust install for the tool chain at least |
Moving back to python38 until wheel rust support gets in the framework is certainly an option. We're doing our best to add this up but this will take a few more of our limited cycles. More I dive into it and more it shows that rust is still relatively young as we're clearly not the only ones hitting road-blocks at cross-compiling. But the upcoming adoption of rust in the kernel will most probably ease this as time passes. |
Yeah it's young for sure, but absolutely going to be a huge adoption. I'll see what I can do, I actually want to learn rust 😂 |
Update requirements-pure.txt
@miigotu rebasing against master should now allow you to build rust wheels :) |
Sweet, I'll go over the whole app tonight. |
I've added your PR in the META issue #5043
You can find an really easy build at #5447 Hope this helps and let me know if you require assistance. EDIT: @miigotu also note, many of the usual complex wheel building examples are available under |
Thanks for the step by step. Have started and will update the files here once tested. |
cryptography throwing errors when only in cross. I added cross/cryptography to makefile as only in requirements-cross.txt was also throwing a similar error.
Error maybe my bad. |
x64 issues resolved |
@BKSteve you can either tag the new PR here and close this one or push those changes here. Good job. |
Let's get some feedback on 8247 and move from there. I only did my own pull request to synocomm to build quicker. I'd built 10 but it built 13 in same time |
Sure |
Uses pypi based wheel, rather than a git install. This allows us to skip the cross step and match the syno install with windows and linux.
Added .idea folder to .gitignore because it always is in my projects from pycharm =P
@ymartin59 what are the thoughts on us disabling the internal updater completely, and me checking out spksrc and updating the requirements-pure.txt with our newly released versions and creating a PR to spksrc? This way, users never get a broken install inside a working spk install and get their updates through the syno package manager as was designed?
Maybe we could work on a template for other projects to use for doing the same thing, so that they can use it in their github actions and automate the process.
Signed-off-by: miigotu [email protected]
Description
Switched to a wheel install rather than a problematic git install
Possibly requires documentation, guidance, and wiki updates to remove old suggestions about git resets, pulls, etc. Currently if an update fails, a user will be able to uninstall and reinstall the package (we havent disabled the updater in SC for pypi based installs yet, but we might need to)
Fixes BROKEN because we removed old tags on SC.
Checklist
all-supported
completed successfullyType of change
@BKSteve @sickchill/collaborators @sickchill/moderators