MycroftAI / mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform.
https://mycroft.ai
Apache License 2.0
6.52k stars 1.27k forks source link

Central Issue for porting to windows #2627

Closed NoamDev closed 2 months ago

NoamDev commented 4 years ago

This a central issue for discussions about porting Mycroft to windows. cc @el-tocino

forslund commented 4 years ago

@NoamDev Sorry didn't quite get around to it yet. I've had limited time in front of the computer these past weeks.

NoamDev commented 4 years ago

@forslund That's ok, if you need help with cross-compiling tell me:)

forslund commented 4 years ago

@NoamDev I've built a static binary of mimic for windows and added to the latest mimic-release: Direct link: https://github.com/MycroftAI/mimic1/releases/download/1.3.0.1/mimic_windows_amd64.zip

Works for me(TM) but let me know if there are issues with using it.

NoamDev commented 4 years ago

How can I force it to use mimic1 specifically without unpairing/disconnecting network?

NoamDev commented 4 years ago

@MatthewScholefield I saw that you're the one who tagged the precise releases. How do you build them?

MatthewScholefield commented 4 years ago

@NoamDev I run ./build.sh in the repo.

krisgesling commented 4 years ago

How can I force it to use mimic1 specifically without unpairing/disconnecting network?

Select British Male as the voice, this is Mimic 1. AKA "ap" in the config which stands for "Alan Pope"

NoamDev commented 4 years ago

I run ./build.sh in the repo.

Thanks! I see it uses pyinstaller which does not support cross-compiling. So I think the first step towards windows build is a setup file for windows. Then, we can use pyinstaller the same way. That means the build process should be done on a windows machine. Do you think the setup file should be batch or powershell? powershell is much more convenient, but I'm afraid wine does not support powershell out of the box. Or maybe use py2exe? Edit: nevermind, pyinstaller does support cross-compilation (it didn't in the past). no need for py2exe which somewhat dead. I'll try to see if I can compile it to a windows executable. Edit2: support was removed in 1.5 again but it's possible to be done with wine.

NoamDev commented 4 years ago

@forslund your mimic executable works very well! i'd change my win-setup so that it'll download and unpack this. Edit: done that.

NoamDev commented 4 years ago

Because of multiple edits, I'll clarify about precise: to compile precise we use pyinstaller in order to compile to windows one should either:

  1. use a windows machine

  2. use wine

wine does not support powershell out of the box meaning if we use wine we have to use batch scripts. What's wrong with batch? In gentle words I don't like batch, it's ugly.

So, the question is: Are you OK with building precise for windows on a windows machine? please say yes 😅

ChanceNCounter commented 4 years ago

I think there are two ways of looking at that. On the one hand, it makes sense to build on the target platform. On the other hand, it makes sense to ensure that all builds can be performed by the same machines, and I can't see too many people migrating from Linux to Windows =P

IMO, it comes down to how committed you are to maintaining the Windows build. If there's a reasonable chance that it might become abandonware, I think its best shot at attracting a new maintainer would be cross-compilation, so suffer through the batfile. If you expect you'll be doing it for the foreseeable future, do it however's easiest for you. I wouldn't wish a batfile on my worst enemy.

The biggest danger in packaging a FOSS project for an unsupported platform is not that you'll do it wrong. It's that you'll do it wrong and nobody else knows how to fix it. That ends with really irate users looking for help where none exists 😛 you haven't lived until you've seen somebody throw a fit at a dev team over an unofficial package they found in the Arch User Repository!

So I'd base the decision entirely on whether you think you'll still be maintaining the build in a year.

NoamDev commented 4 years ago

@ChanceNCounter Thanks! I'm indeed not planning to maintain that forever, so I'll work a little more to make it cross-compilable (have I just made the word up?) Batch, here we come!

NoamDev commented 4 years ago

Hmm, I can use python sometimes, instead. This would both more easy and maintainable.

NoamDev commented 4 years ago

I created windows precise build script and have built windows precise tars 🥳 I still have to make sure it actuallt works, but hay, we are one step ahead!

NoamDev commented 4 years ago

How can I run the tests on precise executable?

MatthewScholefield commented 4 years ago
pip3 install pytest
pytest
NoamDev commented 4 years ago

inside or outside the venv?

MatthewScholefield commented 4 years ago

Inside

NoamDev commented 4 years ago

As you can see in the issue, releasing a new pyache version is required. The latest release is not windows compatible (though the source code is already).

forslund commented 4 years ago

I'm away camping for a couple of days, in case Kris hasn't verified and prepped the release I can look at the pyache release this weekend and do a release (Kris permitting)

NoamDev commented 4 years ago

I'm away camping for a couple of days, in case Kris hasn't verified and prepped the release I can look at the pyache release this weekend and do a release (Kris permitting)

@forslund sure, enjoy yourself!

NoamDev commented 4 years ago

Amm, what's up with that? @krisgesling already opened a PR, but a review is needed.

NoamDev commented 4 years ago

I feel confused. why precise has so many places to list its requirements? requirements.txt, requirements/prod.txt and setup.py has its own independent list of requirements.. setup.py doesn't actually use the above txt files if I understand correctly, it doesn't use find_packages or something like that.. and so, build.sh in its turn doesn't use them. Am I missing anything?

forslund commented 4 years ago

Seems like some merge has gone wrong there, the requirements.txt shouldn't be needed (replaced by the requirements/prod.txt) (and the setup.py should be changed to reference that one)

As far as I know the short list in the setup.py is the list of packages actually needed for building the executable.

Maybe my gist for building the bundle on Arm64 Linux could be of use, though windows is likely quite different so probably not.

Something that's good to know is that Python 3.8 and precise doesn't work.

NoamDev commented 4 years ago

I need to make sure astor's data files get included, astor (a requirement of tensorflow) now uses a file named VERSION. Ideally, I would add to the spec file:

a.datas += collect_data_files('astor', subdir=None, include_py_files=False)

But the spec tamplate is used for building many scripts and I worry that not all of them use tensorflow.. So is there a reason to worry? If so, is it possible to include those data files only when needed?

NoamDev commented 4 years ago

Hey all, took me a while but I adapted precise for windows support :) MycroftAI/mycroft-precise#180

forslund commented 2 months ago

Closing Issue since we're archiving the repo