Skip to content
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

hosc-0.21 breaking changes #1103

Closed
sss-create opened this issue Jan 11, 2025 · 8 comments
Closed

hosc-0.21 breaking changes #1103

sss-create opened this issue Jan 11, 2025 · 8 comments

Comments

@sss-create
Copy link
Collaborator

hosc-0.21 apparently breaks tidal-listener since Functions and Types are now differently created in hosc. E.g. data OscProtocol. Maybe Tidal should revert and expect hosc 0.20 for now and either stay there or incorporate the hosc changes into tidal-listener and Tidal itself, which I would volunteer for to do so -- if desired.

sss-create added a commit to sss-create/Tidal that referenced this issue Jan 14, 2025
…downgrade because of breaking changes in hosc 0.21 (see issue tidalcycles#1103)
@yaxu
Copy link
Member

yaxu commented Jan 14, 2025

Yes agreed we should stick to hosc-0.20.

There's also a tighter version dependency in hosc-0.21 requiring a more recent ghc than the one in current debian, that I need to get to the bottom of.

It would be great to upgrade to hosc-0.21 at some point though, as we're currently preventing its release on stackage commercialhaskell/stackage#7627

Rohan actually uploaded hosc-0.21 on my request, to get rid of an obsolete dependency that caused tidal to be removed from debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1083252

@sss-create
Copy link
Collaborator Author

sss-create commented Jan 14, 2025

What is this tighter dependency that prevents hosc to work with the debian ghc? I tried to compile the latest hosc repo code -- which seems to be at version 0.22 already -- with ghc 9.0.2 and got an error resolved by simply specifying bytestring >= 0.12.2.0 in hosc.cabal in quite a naive way.

edit: So implementing hosc-0.21/0.22 in Tidal could free the way for hosc into stackage? Is this, plus maybe the bipolar LFO feature you mentioned in #1101, enough for a new Tidal release?

@yaxu
Copy link
Member

yaxu commented Jan 14, 2025

Just retracing my steps on my laptop with ghc 8.8.4..

Sound/Osc/Transport/Fd/Udp.hs:44:55: error:
    Not in scope: ‘B.fromStrict’
    Module ‘Data.ByteString’ does not export ‘fromStrict’.
   |
44 | udp_recv_packet_or (Udp fd) = Binary.decodePacketOr . B.fromStrict <$> C.recv fd 8192
   |                                                       ^^^^^^^^^^^^
cabal: Failed to build hosc-0.21 (which is required by tidal-1.10.0). See the
build log above for details.

It looks like this is down to a change in bytestring-0.11.0.0:
haskell/bytestring#279

Importing from Data.ByteString.Lazy seems to fix backward compatibility:

diff --git a/Sound/Osc/Transport/Fd/Udp.hs b/Sound/Osc/Transport/Fd/Udp.hs
index 8076bba..902f456 100644
--- a/Sound/Osc/Transport/Fd/Udp.hs
+++ b/Sound/Osc/Transport/Fd/Udp.hs
@@ -6,6 +6,7 @@ import Control.Monad {- base -}
 import Data.Bifunctor {- base -}
 
 import qualified Data.ByteString as B {- bytestring -}
+import qualified Data.ByteString.Lazy as BL {- bytestring -}
 import qualified Network.Socket as N {- network -}
 import qualified Network.Socket.ByteString as C {- network -}
 
@@ -41,7 +42,7 @@ udp_recv_packet :: Udp -> IO (Packet.PacketOf Packet.Message)
 udp_recv_packet (Udp fd) = fmap Binary.decodePacket_strict (C.recv fd 8192)
 
 udp_recv_packet_or :: Udp -> IO (Either String Packet.Packet)
-udp_recv_packet_or (Udp fd) = Binary.decodePacketOr . B.fromStrict <$> C.recv fd 8192
+udp_recv_packet_or (Udp fd) = Binary.decodePacketOr . BL.fromStrict <$> C.recv fd 8192
 
 -- | Close Udp.
 udp_close :: Udp -> IO ()

I don't think the author of hosc Rohan uses github, so will drop him an email..

@yaxu
Copy link
Member

yaxu commented Jan 14, 2025

Oops only just read your post properly.. Yep just putting a lower bounds on bytestring on hosc seems to fix it! I'm pretty sure I tried setting the lower bounds in tidal and this didn't work, so I just assumed bytestring was part of core and couldn't be upgraded.. I'll send rohan another email!

@yaxu
Copy link
Member

yaxu commented Jan 14, 2025

edit: So implementing hosc-0.21/0.22 in Tidal could free the way for hosc into stackage? Is this, plus maybe the bipolar LFO feature you mentioned in #1101, enough for a new Tidal release?

Yes there's quite a lot of other changes waiting for release.

What's Changed

@yaxu
Copy link
Member

yaxu commented Jan 14, 2025

(oops sorry for pinging everyone!)

@sss-create
Copy link
Collaborator Author

Oops only just read your post properly.. Yep just putting a lower bounds on bytestring on hosc seems to fix it! I'm pretty sure I tried setting the lower bounds in tidal and this didn't work, so I just assumed bytestring was part of core and couldn't be upgraded.. I'll send rohan another email!

@yaxu, your solution was the better alternative, I guess: #1105
My approach was indeed too naive.

@sss-create
Copy link
Collaborator Author

closing with PR #1105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants