Widdershin/sonic-pi-cli

Heads up. Breaking commit in SP3.2dev

Opened this issue · 6 comments

rbnpi commented

Sam has changed the port structure within SP3.2dev Now the server listening port is dynamically allocated. commit d245d93c5b797ad76fa333f829c32d67480af96c
on 30th April.
I suggest adding a -p option to sonic-pi-cli with default value 4557 but where the user can specify the dynamic port currently allocated (which can be inspected in the Sonic Pi server log). Sam talks of adding a text file where users can override the port allocations, but that is not available at present. The other alternative is that the user overrides the dynamic port allocation in teh SP source, but most users wont want to do this.

rbnpi commented

Now done a rewrite allowing for extraction of current server listen port which is dynamically allocated in Sonic Pi 3.2dev. Amended code to read the allocated port from the .sonic-pi/log/server-output.log, and then to use this when setting up the OSC link rather than the hard wired port 4557. For compatibility, if the new format log file is not present then the previous port 4557 is used ensuring compatibility back to Sonic Pi 2.7. The code used has been tested on Mac, Raspberry Pi and Windows PC.
Once I've completed final testing I'll submit a PR from my forked version

Good to know. If someone is willing to make a pull request to support this change I'd really appreciate it.

Oh sorry I hadn't reloaded this issue when I made that comment, sounds good 👍

rbnpi commented

Pretty happy with it now. Will rebase and PR the final version later this afternoon.

rbnpi commented

Now posted a PR to solve the problem

rbnpi commented

Bump this. Sonic Pi 3.2 is due to be released at the end of Feb 2020.
I have tested my PR version of sonic_pi_cli on Raspberry Pi, Windows and Mac and it works fine, both with this new release (Im using the latest beta for Windows, and builds from altest github for Mac and RPi), and more importantly with existing 3.1 builds. Can you incorporate the PR now as the existing version will not work with the new release.