Prism for Mac #40
Replies: 19 comments 3 replies
|
This is neither. The library is libprism.dylib/.so on all other platforms but Windows. If it's a static library build, then it's libprism.a. |
|
Excuse me? The log also shows this: The library is being detected but then the exception is thrown. And no, I'm using the dynamic build. |
|
Many people are still using older versions of Mac, for example Macos 14 or even Macos 12. I understand if Macos 12 would be impossible to support, but at least it should be lowered to the hard minimum version supported. |
|
@diamondStar35 Apologies for being so abrasive earlier. I accidentally didn't read the entire comment since I was reading through what Discord notifications indicated. As for lowering the minimum deployment version, definitely worth a try, especially since I need to modify CI workflows to build using CMake's native iOS support and not through the hacky solution I use right now. |
|
@ethindp no problem, everything is fine :) Thanks for considering this. |
|
@diamondStar35 Can you please test using the MacOS artifacts for the latest CI run, found here? |
|
@ethindp Sorry, I didn't see the new comment. |
|
@ethindp |
|
Also please note that Prism is unusable on IOS because it is built as a standalone .dylib. Apple documents that standalone .dylib in IOS apps is not supported. |
|
@diamondStar35 The iOS port is built in both static and dynamic modes. I know that dylib is unsupported by Apple (since they prefer an xcframework or similar), however constructing one would be rather annoying and only packaging the framework would make it harder for language bindings to be created where the language does not support Apple's framework directory structure. So, we leave as it is now to give you maximum flexibility. I am lead to understand that static linking is the typical on iOS, so I don't believe that this will necessarily pose a problem, and you should still be able to use it on iOS. However, if this does cause app store issues I am wide-open to setting up a framework or xcframework if needed. |
|
Thanks for that. Will try static linking then. |
|
Of course. Did this also solve your original issue? |
Please see the comment where I mentioned that Voice Over backend is showing as unsupported at runtime, while AV speech is working. It did partially solve the issue but I'm confused on why Voice Over is still unavailable though. The comment is here, you might have missed it: #40 (comment) |
|
As I said earlier, either |
|
I would need a debugger to analyze the control flow to see where it breaks. |
|
I'm not really sure either. And by the way no that log was from a Mac x64 machine. Anyway, it resolved the original issue of throwing an exception, so you may want to close it. If I get any new info on why Voice Over is not working, I may open a new discussion in the future but hopefully there will be some kind of a solution. |
|
@ethindp |
|
@diamondStar35 So, I really need to make a section describing this in the manual, but the problem is that you don't have an NSApplication main loop or an AppKit window. The VoiceOver backend requires both to be active when it is initialized. If you want it to use the legacy AppleScript method (which allows it to emulate the NVDA controller client or JAWS back-ends with respect to being able to announce things system-wide), you also need Apple Events automation access, which will display a TCC permission prompt. A console / CLI-style program that doesn't start an AppKit run loop is not going to satisfy the VO backend, regardless of whether you launch it from Terminal or from Finder, and in those cases you should fall back to AVSpeech. This is not a bug in Prism itself but more in its documentation. I appreciate you opening and asking because this is a gap that I do need to close, and I am considering introducing several new error codes to make issues like this much clearer and easier to diagnose, since To fix this, switch to the net9.0-macos TFM (or later), install the macos workload, and change your using AppKit;
using Foundation;
static class Program
{
static void Main(string[] args)
{
NSApplication.Init();
NSApplication.SharedApplication.Delegate = new AppDelegate();
NSApplication.Main(args);
}
}
sealed class AppDelegate : NSApplicationDelegate
{
NSWindow? window;
public override void DidFinishLaunching(NSNotification notification)
{
window = new NSWindow(new CoreGraphics.CGRect(0, 0, 1, 1), NSWindowStyle.Borderless, NSBackingStore.Buffered, false);
window.MakeKeyAndOrderFront(this);
Task.Run(RunPrismReproAsync);
}
async Task RunPrismReproAsync()
{
try
{
// Initial code runs here
}
finally
{
NSApplication.SharedApplication.InvokeOnMainThread(() => NSApplication.SharedApplication.Terminate(this));
}
}
}I could be slightly off here (I have little experience with MacOS apps in .NET) but this is the general pattern. When integrating this into actual GUI apps, most of this boilerplate should be handled by whatever toolkit or game framework you're using. |
|
@ethindp You can consider this as closed since you answered me with the solution. Hopefully will see something in the manual about this so people will be aware of it. Thanks so much! |
Uh oh!
There was an error while loading. Please reload this page.
Hello.
I do not know does this fall under an issue or not so I just opened a discussion.
I have tried Prism on Macos 12.6, and here's what I got.
System.DllNotFoundException: Unable to load shared library 'prism' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable:
dlopen(/Users/nnolan/prism/prism.dylib, 0x0001): tried: '/Users/nnolan/prism/prism.dylib' (no such file)
dlopen(prism.dylib, 0x0001): tried: 'prism.dylib' (no such file), '/usr/local/lib/prism.dylib' (no such file), '/usr/lib/prism.dylib' (no such file), '/Users/nnolan/prism.dylib' (no such file)
dlopen(/Users/nnolan/prism/libprism.dylib, 0x0001): Symbol not found: (_$sSD10FoundationE19_bridgeToObjectiveCSo12NSDictionaryCyF)
Referenced from: '/Users/nnolan/prism/libprism.dylib'
Expected in: '/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation'
dlopen(libprism.dylib, 0x0001): tried: 'libprism.dylib' (no such file), '/usr/local/lib/libprism.dylib' (no such file), '/usr/lib/libprism.dylib' (no such file), '/Users/nnolan/libprism.dylib' (no such file)
dlopen(/Users/nnolan/prism/prism, 0x0001): tried: '/Users/nnolan/prism/prism' (no such file)
dlopen(prism, 0x0001): tried: 'prism' (not a file), '/usr/local/lib/prism' (no such file), '/usr/lib/prism' (no such file), '/Users/nnolan/prism' (not a file)
dlopen(/Users/nnolan/prism/libprism, 0x0001): tried: '/Users/nnolan/prism/libprism' (no such file)
dlopen(libprism, 0x0001): tried: 'libprism' (no such file), '/usr/local/lib/libprism' (no such file), '/usr/lib/libprism' (no such file), '/Users/nnolan/libprism' (no such file)
Because I don't see a minimum requirement for Mac, I decided to first ask before opening an issue since this maybe intended due to min requirements.
Regards.
All reactions