-
-
Notifications
You must be signed in to change notification settings - Fork 923
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
Timing problems post Merge pull request #3081 from SunderB/patch/2022-05-09-cmake-copy-bin… #3129
Comments
Hmm, that’s odd. If a fix is not immediately obvious I suggest reverting this commit for 4.0.1 and then looking into things in detail after that. |
EDIT WRONG(Actually think Pi is OK) Pi has the same behaviour. Further investigation on Mac shows that midi i/o is not being detected. Also link externally is not working. Tau log shows.
Still trying to ascertain which commit is causing problem. |
Midi I/O devices are there, as earlier versions working. Is Tau [error] Cue Server unexpected message: {midi_on,1) relevant? |
On my Mac I built 4.0 from scratch, then dropped the beam folder from that into a build of 4.0.1, replacing the beam folder there, as I don't think anything had changed for this, apart from the revamping of the build scripts. It then all worked. I suspect something may have gone amiss in the large revamp of the build process in recent merged sonderb commit. Going to try the same thing on my RPi build of 4.0.1 |
Same "solution" on RPi. I dropped in the beam folder from a working 4.0 build into a non working build of 4.0.1 It then worked fine. So it looks like there is an issue with the Tau (or possibly sp-midi or sp-link builds) following the changes between 4.0 and 4.0.1 |
What happens if you only put libsp_midi.so and libsp_link.so from the working beam/priv folder into the non-working beam folder? |
Apologies, I’m still travelling. Will look at this tonight and if the solution isn’t obvious (or already fixed) I’ll revert this for 4.0.1 and then we can have a bit longer to really understand what’s going on here. |
I think there's several things going on. First the sp_link and sp_midi libs are named with dylib extension when built and installed by 4.0.1 version. I think they should be renamed to .so Secondly, the linux clean script uses the line have to go out now, but may look further later. |
@rbnpi The libs correctly end in .so for me. I figured out what's going on though, and it's related to them not getting copied into the _build folder in the beam distribution See #3081 (review) Thank you for doing your testing! Noticing that the beam folder was what gets messed up definitely pointed me in the right direction, and I noticed the issue when doing a |
I think the issue with the sonic-pi/app/mac-pre-copy-binaries.sh Line 16 in 85782ca
|
Unless anyone sees that there's a super quick and reliable fix for this - I think it's probably sensible to roll back for 4.0.1 then look at it again. Any thoughts? |
@samaaron I’ll have a look into this and see if I can see anything obviously wrong |
Yes the name problems was on my Mac. linux/rpi is OK here. |
As far as I can see from the discussion there are currently two issues:
|
Just tried running pi-pre-tau-prod-release.rb a second time AFTER the complete build had finished. That sorted it I think, and fits in with Lily's diagnosis. |
Would it work if mix release was called at the end of *-build.sh scripts after sp_link and sp_midi were built? |
Ah I misunderstood and remember that macOS .so oddity now for NIFs :)
The "super quick" fix would be to make linux-pre-tau-prod-release.sh a post-build item rather than a pre-build item. But reverting and then trying again after discussing so as not to hold up 4.0.1 is probably best. I'll let @SunderB answer their thoughts though |
Yep that seems to be the only thing missing afaict that is causing this issue edit: and the stuff @rbnpi mentioned in the below comment need to be addressed |
Also renaming on mac, and check the deletion of sp_link and sp_midi on clean scripts. I don't think the delete command used worked. |
@rbnpi can you modify the last line of if(APPLE)
install(TARGETS libsp_link.so LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX})
else()
install(TARGETS libsp_link LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX})
endif() (and swap out 'link' for 'midi' for sp_midi) Does this solve the macOS .so issue? |
Wait that won't work libsp_link is the target name - not the output file name |
|
Erlang's @samaaron, should Tau be exiting if the nifs fail to load? Tau doesn't seem to be quitting on that failure, just throwing tons of timing errors for any run started in the editor |
@lilyinstarlight I see, thanks :) And yeah you'd think there would be a critical error if it couldn't load a NIF, unless Erlang was built to always keep running no matter what. |
Great - now when I'm building Sonic Pi, I'm getting random errors interrupting the build after some targets
|
Good question. Yes and no. It should totally be possible to boot Tau without support for either MIDI or Link (there is already some work to creating flags for this which the CI currently uses). However, it should also probably send some sort of error message back to the daemon when the NIFs aren't discovered. I guess I've been working on the assumption that they will be there as I package them for Windows and macOS - but that obviously doesn't help to make this kind of situation clear. |
@SunderB would you be ok if we rolled this back for v4.0.1 which I hope to get out tomorrow and then we can start looking into getting this properly working after that? |
Currently rebuilding from scratch to see if that fixes it - maybe the vcpkg packages have changed a bit? |
Good idea 👍🏼 Sorry for not testing this as thoroughly as I maybe should have! |
I mean, it was built for writing highly available and scalable real-time communication systems, if I remember correctly :)
Thank you for continuing to work on it though! It should help considerably in both build system robustness and for downstream Linux packagers, as we move more things to CMake and vcpkg |
I don't wanna celebrate too early, but I think I may have it working :) |
Should I make a new patch branch and PR for the fixes or put them on the existing one? |
I mean there could be reasons other than the NIFs aren't found that they might fail to load (e.g. dynamic lib loader errors). But I'm not too concerned about it since yeah in any reasonable scenario they should be found and load successfully. Maybe we could prevent the daemon from spewing all those errors when they fail without changing too much if we adjust the default stub methods that get used before the NIFs are loaded, but it's up to how much of a problem you feel it is and whether it should be accounted for (I'm not invested either way in it) |
It can be the same branch if you prefer (assuming it's been rebased or has no conflicts), but it should for-sure at least be a new PR |
@SunderB the patches in teh CMake files for renaming the libs for Mac work fine. also need to replace |
Was the linux-clean.sh script working before? I don't see why that shouldn't work. - Edit: I've removed the '-r' as it's redundant. Does doing that make it work? |
I've made a PR with the fixes so far: #3132 |
This does work on Linux and I just tried it with Bash v3.2 (which is the ancient version macOS uses) in a container and it still seemed to work. I'm assuming you're only having issues with it on macOS? |
Both on latest Mac and RPi builds.
Try this program
Runs OK as shown. Then uncomment link command and run again. Thread death Timing exception
Discovered by running example :bach. and then changing use_bpm 60 to link in that program.
Version 4 release works OK with this
The text was updated successfully, but these errors were encountered: