sonic-pi
sonic-pi copied to clipboard
Building on windows - qt cmake and ruby
https://github.com/sonic-pi-net/sonic-pi/blob/41a6728e86fb88d957690f05235d9acdfbb11aa0/BUILD-WINDOWS.md?plain=1#L118
Hi, is it still best to use this version (ruby 3.1), or should we always check the latest version in use in sonicpi, or even get the latest ruby release from the repo?
Also the instructions recommend getting Qt and cmake; it looks like there's cmake in the qt folder (C:\qt\Tools\CMake_64\bin) - is that enough?
Finally Qt component WebEngine is mentioned but not present - is WebView needed?
Thanks!!
Ignore last q- I had wrong version installed, getting 6.4.3 (6.4.2 n/a via maintenance tool) and WebEngine present.
I've inadvertently picked vs '19, so may need to restart with '22 edition as instructed... will see what happens when installed. 2gb installer for vs desktop C++ workload, I may have included a few unnecessary components (like cmake and that arm thing), also used winget to get cmake, leaving just elixir to try and grab (other than the beast that is VS) - there's zips for earlier releases like recommended 1.15, but then there's v23, v24, v25... I opted for v23 from https://github.com/elixir-lang/elixir/releases/v1.14.0, looks like v1.14 may need to be made...
Wonder if another version will work, with an .exe release, like https://github.com/elixir-lang/elixir/releases/download/v1.16.0-rc.0/elixir-otp-24.exe
https://github.com/elixir-lang/elixir/releases?page=2
kept ruby config as is, not sure if that toolchain is needed...
gem install rugged failed, presumably as (looking at PATH contents in cmd) the sp ruby path I added is overriding the ruby path
ERROR: Failed to build gem native extension. current directory: C:/Users/jonny.COMPUTERNAME/.local/share/gem/ruby/3.2.0/gems/rugged-1.7.1/ext/rugged C:/Program\ Files/Sonic\ Pi/app/server/native/ruby/bin/ruby.exe extconf.rb mkmf.rb can't find header files for ruby at C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/include/ruby.h
Removed sp path from path and retried only to discover ruby hadn't installed yet (I thought I'd installed something and agreed to an add path option)
Ruby installed, no mention of msys setup so guess not needed?
gem install rugged from non-admin finds right ruby👍 but wants to play with pacman?
Fetching rugged-1.7.1.gem
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-ucrt-x86_64-libssh2 mingw-w64-ucrt-x86_64-cmake
warning: Public keyring not found; have you run 'pacman-key --init'?
error: mingw32: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: keyring is not writable
error: mingw64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: keyring is not writable
error: ucrt64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: keyring is not writable
error: clang32: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: keyring is not writable
error: clang64: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: keyring is not writable
error: msys: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
went back to the chain setup, option 1 reports properly installed
went for option 3, pacman game initiated , "nothing to do" reported, ran ridk enable
re-ran gem install rugged (from userdir) , taking longer than before ...
leaving command prompt open and hoping it's still doing something 🤞
abandoned that attempt and retried, and rugged installed, tried buildall but forgot about elixir... getting close, perhaps.
https://www.erlang.org/downloads.html#prebuilt reading elixir building it says you just need erl, so installed erlang, but path not updated
so adding either C:\Program Files\Erlang OTP\bin or C:\Program Files\Erlang OTP\erts-14.1.1\bin
still mix isn't recognised (more building of required resources needed, I think) and still get the error with compiler 17 not found
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release ..\
-- CMakeLists: Sonic Pi
CMake Error at CMakeLists.txt:39 (project):
Generator
Visual Studio 17 2022
could not find any instance of Visual Studio.
cmd /c mix tau.release
'mix' is not recognized as an internal or external command,
operable program or batch file.
whilst waiting for the latest build I looked into build-optimisation, and wonder if changes from '19 to VS'22 help here, eg restart now, or try a few more failed build attempts...
cmake -g /? tells me default is Visual Studio 16 2019
A quick search on GH finds a hit in win-config.bat
https://github.com/search?q=repo%3Asonic-pi-net%2Fsonic-pi+%22visual+studio%22&type=code
ended up here: https://medium.com/@rpw952/elixir-development-on-windows-10-ff7ca03769d and grabbing choco, which notifies me of a pending restart, so off to complete that, then retry build1 with new-dev-env (still on VS19)
After extensive research I eventually noticed I was down to 1Gb left on my SSD, so started to remove some of this dev-clutter.
I'll retry when I've made some more room. One thing I've just noticed, which may be important, re versioning, from the workflows - otp-version: "26.1.2", elixir-version: "1.15.7"
# Install Elixir on Windows
- name: Win Elixir
uses: erlef/setup-beam@v1
with:
otp-version: "26.1.2"
elixir-version: "1.15.7"
if: matrix.os == 'windows-latest'
Would be great to know what's required, what's useful as optional, what's not used... lots of results found when looking for cmake and qt stuff.
Todo: retry, trying to identify ways to check if each piece of the jigsaw is present and correct, including stuff like versioning, and install order (if relevent) and requirements (network access, admin rights, disk-space)