maestro-cli icon indicating copy to clipboard operation
maestro-cli copied to clipboard

Windows build in release

Open graphixillusion opened this issue 2 years ago • 7 comments

Hi there. This is a cool program indeed but please consider to add the Windows build during release. Right now you need to install atleast 6GB of buildtools/visual studio environment just for make the compile of just_playback lib. I've already tried this command

pip install PATH_TO_DOWNLOADED_WIN64_WHEEL

with this file but it doesn't work on my system (Windows 11 x64). The only solution is to install buildtools and Windows SDK plus Visual C libraries for buildtools for make the compile successfull

graphixillusion avatar Jun 22 '23 21:06 graphixillusion

Hi Gabe,

Yeah, I need to look into this ... if you don't mind me asking, do you have any idea how I can do that? I only own a Mac ... is there any way to have GitHub do it for me with GitHub Actions or something?

It's ok if you're not familiar, I'll try to figure it out sometime

PrajwalVandana avatar Jun 23 '23 04:06 PrajwalVandana

@PrajwalVandana Sadly i can't help you with this, i'm not as much advanced about these things...

graphixillusion avatar Jun 23 '23 15:06 graphixillusion

Hey @graphixillusion, just wanted to lyk I'm working on this right now. Turns out the reason the prebuilt wheel didn't work for you is because you are using Windows 11, not 10. I'll see if I can figure out a way to get the prebuilt Windows 11 wheel as well.

PrajwalVandana avatar Jul 10 '23 21:07 PrajwalVandana

Hey @graphixillusion, found a cool replacement for just_playback: https://github.com/irmen/pyminiaudio

will port over audio playback to this package, which doesn’t seem to have the same cumbersome build tool requirements for Windows 👍🏾

PrajwalVandana avatar Jul 12 '23 06:07 PrajwalVandana

Hey @graphixillusion, I looked deeper into this and porting the playback code to pyminiaudio is too daunting a task for me, and after some digging it doesn't seem like it'll even work (i.e. allow maestro-cli to install without Visual C++ build tools).

Is normal pip install just-playback also throwing the same error? Because I checked the just-playback repo and they added Github Actions recently for the build process ... so it install precompiled binaries and not need build tools ...

If that's still not working, I'm sorry but there's not much I can do right now, although I'll keep researching

PrajwalVandana avatar Jul 14 '23 05:07 PrajwalVandana

@PrajwalVandana yep:

Building wheels for collected packages: just-playback, tinytag
  Building wheel for just-playback (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for just-playback (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\just_playback
      copying just_playback\ma_result.py -> build\lib.win-amd64-cpython-311\just_playback
      copying just_playback\playback.py -> build\lib.win-amd64-cpython-311\just_playback
      copying just_playback\__init__.py -> build\lib.win-amd64-cpython-311\just_playback
      running build_ext
      generating cffi module 'build\\temp.win-amd64-cpython-311\\Release\\_ma_playback.c'
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      building '_ma_playback' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for just-playback
  Building wheel for tinytag (pyproject.toml) ... done
  Created wheel for tinytag: filename=tinytag-1.9.0-py3-none-any.whl size=36847 sha256=cdac72d0d12418ec15e285893459b6643cb9dffbb87c1764467d1e28694234c6
  Stored in directory: c:\users\mefisto\appdata\local\pip\cache\wheels\12\f5\8c\8abec9cd815a9c49d3c49d4a2fdf808509a27994948dec1d0c
Successfully built tinytag
Failed to build just-playback
ERROR: Could not build wheels for just-playback, which is required to install pyproject.toml-based projects

graphixillusion avatar Jul 14 '23 11:07 graphixillusion

I ran into the same issue! Unfortunately just_playback does not have that many wheels, and the only solution I found was to build it myself and then share it around for other people (in fact, i built the cp312 version that didn't work for you, lol) if you do ever end up building a wheel, please share it with the devs.

Here is a page that can help you with building: https://pypi.org/project/build/. Or, try this:

Download and extract the source Then cd to the directory of the source code

py -m pip install build
py -m pip build

Note that this is not tested, just writing this from my (foggy) memory, so it may not work.

kaneryu avatar Nov 28 '23 03:11 kaneryu

hey @graphixillusion, I have a windows installer for maestro available now! Will be available as a release soon, im still working on the dev branch right now, but i've attached it here. I think there are some issues (my friends tested it on their computers, i only have a Mac) with startup speed, but it should work overall! Let me know if you have any issues.

https://github.com/PrajwalVandana/maestro-cli/actions/runs/10066965427/artifacts/1732586111

let me know if the link doesn't work, it might not be a permalink

PrajwalVandana avatar Jul 24 '24 04:07 PrajwalVandana

Thank you. Could you provide it as binary/portable?

graphixillusion avatar Jul 26 '24 10:07 graphixillusion

Do you mean the direct executable instead of an installer? If so, here it is: https://github.com/PrajwalVandana/maestro-cli/actions/runs/10116171397/artifacts/1745133528

But it has a maestro.exe and a _internal folder with dependencies when unzipped

PrajwalVandana avatar Jul 26 '24 21:07 PrajwalVandana

Ok, everything seems to work fine with the Windows build.

graphixillusion avatar Jul 27 '24 00:07 graphixillusion

Any issues with startup speed/performance in general?

Also there are a lot more features in this dev version (e.g. listen-along streaming with the -S flag to maestro play) that aren't in the README, just lyk

PrajwalVandana avatar Jul 27 '24 01:07 PrajwalVandana

Well actually is a little bit slow to start, even the maestro -h tooks around 3 seconds to print to stdout.

graphixillusion avatar Jul 27 '24 01:07 graphixillusion

Yeah, my friends had that issue as well ... unfortunately I don't have a Windows device to test on so I wasn't able to figure out why

On my Mac it's also slow to startup but only on the first run of any command, I think it's slow for all runs on Windows though 😔 I guess pip install is the best way for now ...

I think the author of just-playback has provided wheels for Windows, so it shouldn't need visual c++ tools anymore ...

PrajwalVandana avatar Jul 27 '24 03:07 PrajwalVandana

I managed to install maestro from pip install but the performance are the same of the binary, still slow to start.

graphixillusion avatar Jul 27 '24 18:07 graphixillusion

Ah, that's probably because it's the old version, I've made a lot of updates since then that I haven't yet published (soon though!)

You can install the dev branch with

pip install --force-reinstall --upgrade https://github.com/PrajwalVandana/maestro-cli/archive/dev.zip

PrajwalVandana avatar Jul 27 '24 20:07 PrajwalVandana

Is it faster now, btw?

PrajwalVandana avatar Jul 28 '24 04:07 PrajwalVandana

Nope, still the same performance as before.

graphixillusion avatar Jul 28 '24 14:07 graphixillusion

That's odd ... I'll see if I can set up a Windows VM to test

What commands are you running? Is it slow for maestro -h too??? Also can you run where maestro or gcm maestro (not sure what the exact command is, I use mac) to ensure that the version installed by Python is picked up first (rather than the executable)?

PrajwalVandana avatar Jul 28 '24 17:07 PrajwalVandana

maestro is running from:

/c/Users/USER/scoop/apps/python/current/Scripts/maestro

I've python installed with scoop.

About the performance, here's a gif:

https://imgur.com/GBBmdRx

Every command has this type of delay

graphixillusion avatar Jul 28 '24 18:07 graphixillusion

Hmm that is … odd to say the least

I’m looking into it, one last question: is the performance the same on all runs? Like if you run the same command right after, does it get any quicker?

PrajwalVandana avatar Jul 28 '24 23:07 PrajwalVandana

Same for all runs.

graphixillusion avatar Jul 28 '24 23:07 graphixillusion

Hey Gabe, I was able to get much better performance even on my Mac after making some fixes! Can you try the latest dev commit again? same command as above

pip install --force-reinstall --upgrade https://github.com/PrajwalVandana/maestro-cli/archive/dev.zip

PrajwalVandana avatar Jul 29 '24 07:07 PrajwalVandana

Yep i confirm that this build is faster now, not immediate but now the delay is around 1s since you hit enter

graphixillusion avatar Jul 29 '24 15:07 graphixillusion

Should be even faster now

pip install --force-reinstall --no-deps https://github.com/PrajwalVandana/maestro-cli/archive/dev.zip

PrajwalVandana avatar Jul 29 '24 21:07 PrajwalVandana

Yep, i confirm: now the output of the maestro -h command is immediate. All the other commands are slower: they can be optimized too?

graphixillusion avatar Jul 30 '24 12:07 graphixillusion

Hmm ... not sure how what else to speedup as the fixes I made till now were to localize heavy imports as much as possible

Which other commands do you find slow, and how slow? I'll see what I can do from there

PrajwalVandana avatar Jul 31 '24 06:07 PrajwalVandana

Now maestro -h is almost immediate. Every other command has around 1s delay since you press enter, even maestro version

graphixillusion avatar Jul 31 '24 13:07 graphixillusion

Ok, got it; most likely the issue was with the code in the cli function that runs on every non-help command. I think the latest dev commit should fix it, try that?

PrajwalVandana avatar Jul 31 '24 17:07 PrajwalVandana

Yep, new dev is ok with all the other cli commands. Good job!

graphixillusion avatar Jul 31 '24 19:07 graphixillusion