-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
tone quit unexpectedly - m1 Mac #6
Comments
Ok, thanks. This is very useful feedback, since I do not own a Mac with M1. I'll try to give you more information to that as soon as possible. |
Maybe have to do with this: dotnet/runtime#49091 |
if it's related to m1 codesign, try following command:
|
Thx, maybe it is possible to integrate this into the automated build process as long as this is not fixed in dotnet. |
I'm not sure whether you need to do it again when the excutable is moved to another macos device, but sign with a certificate issued by Apple would like do. |
Thanks for pointing this out. I think this really might be a bug with C# on M1 / macOS. But I'll investigate this as soon as I have the time. |
I have built a debug version locally (on my mac studio) and it's working on my system -- just as a data point. I'm not sure what to try next, I guess maybe building a signed bundle? I have no idea how to do that |
interesting; so when I "publish" it to a directory I start having the same issue as with the downloaded binary |
doing a forced codesign did not help |
One possible hit: when running in debug mode I get this warning: |
@taxilian Unfortunately I cannot reproduce or help with the problem, because I do not own an M1 / M2 Mac (and have no plans to order one...). Maybe this is a problem that I should report to dotnet itself, but I don't know if this is a compiler problem (roslyn), a runtime problem (dotnet-runtime) or something completely different. If anyone has a clue what to do here or what the problem is, I would really appreciate any hints. The next thing I would like to try is to use dotnet version |
Sadly no |
@taxilian Thank you for quick feedback. I would like to ask some questions:
If you compiled it from source as is and only What do you think? |
Honestly I don't remember all the details at this point; the last time I did any real dotnet dev was well over a decade ago =] I was able to install vs on my mac and try the build but I'm not really familiar with any of the internals of this ecosystem anymore. It did compile from source just fine and I could use it, but when I did "publish" (IIRC) the resulting binary did not work. I don't know anything about PublishSingleFile or other =] |
Oh ok :-) Nevermind, thank you anyway. I'll try to build and publish a debug version of Unfortunately, |
…lts in a binary that can be actually used (#6)
@csandman @taxilian A |
it doesn't. I get this error: zsh: bus error tone |
@garlik82 Thx... Very sad. Well, let's hope we find a way fixing this issue soon. |
I'm on an M2 Pro and also thought to give it a go and had the same crash. I found this issue, which seems to be talking about the exact error we're getting: dotnet/runtime#79267 which got a fix that was backported to dotnet 7.0.3 (dotnet/runtime#80283). But you mentioned dotnet 7 is bringing other problems with it? The fix description says about the issue: This condition does seem to apply here - I see that The csproj has Without having a deeper understanding of this: Would it be possible to, e.g. turn off compression for Apple Silicon as a workaround, if it really is this exact problem? Happy to test anything 🙂 If there's something better than the Problem Report I could do to help (on macOS), please let me know. MacOS Problem Report
|
@remmycat Wow, thank you for your effort and helpful description.
Yes, there were build errors with dotnet 7, but this has been a while, I learned a lot since then and dotnet 7 matured a bit... maybe I'll give it a spin in the next weeks.
YES, absolutely. If this would fix the issue, I'd be happy to go without compression on macOS Thank you very much, I'll try to get this going in the build file for the next release. |
Here is a non-compressed build. I would really appreciate, when anyone with an arm64 mac could check if this really solves the problem. I build it on Linux, so maybe it also has to be built on mac, but for now it is the only thing I can provide atm. |
No dice, same error :( |
@garlik82 Thank you for testing |
Actually this did fix it for me, I'm successfully running your provided version of tone on macOS with an M2 chip! At first it didn't work, but I didn't get the usual crash dialog. The system logs say This seems like an unrelated issue, as the original Edit, for more info:
And macOS won't allow running unsigned binaries on M1/M2 as far as I can tell. I'm unfortunately not aware of the process on how this should usually be signed in your situation (is this on dotnet?), but the following is definitely working for me right now and I'm successfully dumping metadata. Having a known workaround is a major step forwards I'd say :) # ad-hoc code signature for tone
codesign -s - tone
# Remove quarantine flag for download (Also possible via UI by right-click + "open" on executable once)
# Might be unnecessary depending on download mechanism
xattr -d com.apple.quarantine tone Yet more info: So after searching around a bit on the topic I think the codesigning should already work when publishing with dotnet on a macOS host (basically using apple's If still necessary, there also seem to be some options that may work to codesign cross-platform using unofficial tools like https://lib.rs/crates/apple-codesign (This project was just linked as a possible option somewhere, I cannot vouch for it working) Last edit, I swear Just now thought of checking on the past builds:
The only issue that's left, but true for any macOS binary that is not signed (or notarized?) using an apple developer account and got downloaded using a browser (tarred or not) is the quarantine flag. but that should be no different to non-arm macs and there's extensive documentation on it. |
That's awesome. Thank you so much for all the details (and edits 😋) and of course thank you for your sponsorship - I really really appreciate it. You did a lot for the Let me explain: Here is what I will do for the next release:
Currently, I'm working on an OpenSource Cross Platform Audio Player (using Avalonia 11 xplat for Windows, Linux, Mac, Android, iOS, WASM) called I'll try hard to solve this problem, until then I soon will publish a custom build done on a mac for you all to do more testing in this thread. Thank you all for your patience and support! |
Sounds great! 🙂 One note in regards to quarantine: If someone uses If someone is unsure, |
So, as promised, here is the new uncompressed |
Success :). |
Awesome, thanks for the feedback and thanks again @remmycat for providing a huge contribution for solving this issue! |
it pops up the standard "we couldn't check this for malware" thing but you can get around that the usual way. it'd be cool if you could find a way to have it be notarized, but I'm not going to cast any stones if you don't want to deal with that hassle =] Awesome |
Did a release |
it's working. Anytime you need something tested on apple silicon just @ me. thanks for you work. |
Yes, all fixed in 0.1.5! 🎉 |
Hey! this projects seems like it could definitely be useful but I wanted to let you know that it's not running on my m1 Mac. I installed following the instructions in the readme, and when I try to run
tone --help
I get this:There is also a full error log from the OS, which I'm not sure will be any help, but I figure I might as well add that too:
The text was updated successfully, but these errors were encountered: