Change:
ln -s $out/Applications/mscore.app/Contents/MacOS/mscore $out/bin/mscore. ''; <ins> # Don't run bundled upstreams tests, as they require a running X window system. doCheck = false; </ins> passthru.tests = nixosTests.musescore; meta = with lib; {

Discussion:
Running musescore 4.1.0 from nixpkgs master causes a segfault on launch. Steps to reproduce the behavior: musescore via starts to launch, with a small window appearing for a brief second, before crashing. Please run and paste the result.
I can reproduce. I wonder whether this is only when starting it via the shell. If no, then we need to bisect, since seems to have worked for multiple people.
The integration test succeeded, Also, succeeds for me on master. It produces e.g. the following screenshot: ! So this must be because of starting it in a shell. Probably, Qt plugin resolution or something like that fails when starting in a shell.
I can't reproduce. Sometimes with these Qt programs, you have to delete your or delete your directories, because some of your previous settings are not compatible with the new version, and upstream has unfortunately failed to program MuseScore to detect those incompatibilities correctly and handle them gracefully.
I tried to move these directiories away, and also , but still I have the crash. Can you not reproduce from a shell??
I ran from a shell.
Ok, apologies, then I agree, the only way I can imagine then is some state in .
Unfortunately, removing those directories did not fix the crash for me. One thing to note is that I hear a buzzing sound in my speakers for ~1s before crashing. Unsure if that is relevant info. Could the issue be some incompatibility with some system configuration?
I'd contact upstream about this issue.
Let me know if there's any other info that should be included in the issue :+1:
One more thing you can do which might help them, is to build from nixpkgs' source with: And then after it crashes, you'll be able to share with upstream the backtrace of of the crash, via . Then in that prompt, running will print all the backtrace of all functions from which the crash started.
Posted the backtrace and also confirmed it crashes on my laptop as well, also running nixos with kde but on wayland.
Can you create a new user and try for that one?
Do you set in your environment? Musescore is wrapped with .
When I do , I get nothing, and it crashes for me as well.

Maybe it'd be worth trying with
I can try this, but the reason I did try on my laptop was that I hadn't run MuseScore on it before.
Still crashes on new user and with . Could it be an issue with KDE? Like somehow MuseScore's qt libraries are conflicting with KDE's?
I have the same crash. I was able to get musescore running again by removing from my . Didn't do any testing on whether it's the font itself that's somehow the problem.
That seems consistent with my discoveries in the other thread, it seems like MuseScore is having trouble when it tries to render something using the Noto Sans font for some reason. Edit: could this actually be an issue that's caused by the bundled freetype being somehow incompatible with NixOS? That could make some sense, since it seems the flag's removal was only included in 4.1.0:
should we pull in the patch from to nixpkgs? Should probably ask if the patch fixes it for your system too.
Yes, do it please, I'm too busy at the moment. On 11 August 2023 22:04:40 GMT+03:00, huantian should we pull in the patch from to nixpkgs?