Post

Replies

Boosts

Views

Activity

Reply to Controlling process architecture from Cocoa?
Here are straw man answers to my own questions. I'm still hoping someone can give me better answers. Just open the binary file and read the first few bytes of it. Traipse through the cafe babes and the feed faces to find the cputype, then check it against the defined values for arm64 or x86_64. The formats are defined in <mach-o/loader.h> and <mach-o/fat.h>. Another possibility would be to do a preflight dlopen(); if it works, you know the binary contains your current architecture. But that possibility won't work for me for other reasons. Don't use NSTask. Use posix_spawn, giving it a posix_spawn_attr that contains a posix_spawnattr_setbinpref_np, into which you can put the cputype you prefer. This is much more complex than using NSTask, and I can see why it hasn't been added to that class, but I sure wish it was. In my case, I will take the more pragmatic approach of just creating two non-fat binaries, one for each architecture. Then I can choose which one I want to launch, and do so using NSTask.
Feb ’22
Reply to How to change DYLD_LIBRARY_PATH at runtime?
Thanks Quinn. I reviewed the linked thread and, other than a wish that there were an API to modify the DYLD search paths at runtime, I didn't see anything that would help me resolve my issue. I think the answer to my question, "Is there a way to get dyld to honor changes to DYLD_LIBRARY_PATH made at runtime?", is "No".One possible workaround that I thought of, however, would be to change DYLD_LIBRARY_PATH, then exec a child process that calls dlopen() and interacts with the library (MATLAB in this case) for me. Would that work -- would the child process get my modified DYLD_LIBRARY_PATH, or would it just use the same path as me?
Jun ’20
Reply to Notarization warnings being treated as errors when the notarized app is bundled in another
Thanks Quinn for clarifying about needing the .pkg signed. I gathered as much after reading other responses from you on this forum.I have entered a bug -- FB7457705 -- for the errors not being treated as warnings in the package. For the record, our app is in a package, which is in a disk image. Eventually we will want to notarize the disk image. But I was trying this as an intermediate step.As for the actual problem, the libraries in question are an embedded Java 8 JRE from Azul Systems, built with the 10.8 SDKs. We do have plans to move to a more recent Java JRE. Their Java 11 JRE is built with the 10.9 SDK and their Java 12 JRE is built with the 10.13 SDK. But the architectural changes required to move to a later Java are too great for us to roll out just yet. And it is not feasible for us to wait to notarize our app until we can switch Javas.
Nov ’19