Check that local machine dependencies for macOS application exist - swift

Having an issue with my app crashing if a local dependency is missing. I'm building a macOS application -- using Swift 5 in Xcode -- that uses a library, which then wraps a C++ library (librdkafka). If I install librdkafka using homebrew everything works as expected with no issues.
If I uninstall librdkafka however, the application crashes before even opening, and a window is displayed explaining why it crashed: because it cannot find librdkafka (as expected since I purposefully uninstalled librdkafka)
I understand why this is crashing, but what I am trying to figure out is if there is a way to gracefully handle the scenario where librdkafka does not exist on the local machine?
I implemented a function to check the file itself exists and I call it in applicationWillFinishLaunching in the delegate, but the app crashes before that function is called, so thats no good.
My second thought would be to maybe fork the repo and tweak the imports here: https://github.com/IBM-Swift/SwiftKafka/blob/master/Sources/Crdkafka/shim.h -- but I am not 100% sure if this is the best way.
Thanks!

Related

Launching non-sandboxed Swift app at login -- best practice

I've developed a Mac status-menu app which can't be sandboxed, because it creates a virtual drive; it's installed alongside a Finder rightclick-menu extension, which does conform to sandboxing rules. At this point (after manual install) the right-click launches smoothly on login, but the application doesn't.
In recent versions of MacOS the previous methods for adding an app to login items (involving LSSharedFile) have been deprecated. The examples I've found since then involving SMLoginItemSetEnabled or launch agents (e.g. MenuApp in Swift 4 to Run on Login for High Sierra?) all seem to involve sandboxing. Is there a best practice for running an un-sandboxed app at login on OS X 10.11+ -- either in code or at installation time?
I'm thinking about using a launch agent, as described above; can all these steps be done at install time with administrator privileges, even without sandboxing? And if so, what would I need to do to automate uninstallation as well?

Can't execute "swift test" in non-XCode Swift project

I'm beginning in Swift development (server side, no iOS). I have created the minimal package with swift package init and then swift build.
So far, so good. Now, when I run swift test, I get this error:
cannot load underlying module for 'XCTest'
I'm not using XCode, but just Visual Studio Code. How can I solve it? I have seen some solutions using XCode but I didn't found anything for "standalone" projects
Even if you're not using Xcode's editor, you still need the tools that come with it. Make sure you keep everything up-to-date, as the language is still evolving.

Python kernel crashed (win-64bit)

I am supporting a user who is trying to use Canopy. Every time she starts the program the kernel crashes. I installed the program myself and viewed another install which work fine. I believe her issue is that the .ipython and .matplotlib foders are not getting installed in her home directory.
The same issue arises with the 32-bit client after all updates are applied.

How to debug into Cordova.framework in xcode

I'm having a problem where cordova is failing to start the camera app on iOS. A simple case works fine, but in my app, not so much.
So I'd like to debug into the Cordova.framework to see what the problem is.
But I can't figure out how to do it. I've built the Cordova project that's sitting next to the installed framework, and I've replaced my framework reference in my project to point at it. That seems to be fine. But I can't step in or set breakpoints.
With the cordova project, i"m building UniversalFramework and it looks like it's set to debug in the scheme config, even though it always builds to release (this seems to be in the script), I see --DDEBUG in the clang output, so I think it's debug. I'm fairly new to xcode so I don't know if it's building a symbol file or how to verify it's a debug framework, etc.
Latest Cordova (2.0.0) has it like a seperate project and linked as static library.
Use that version, you can put breakpoints in the library code.

getting GDB working with eclipse and the RX62N board from renesas

I have set up the board according to the RX cpu example in eclipse, and everything seemed to be working fine till I wanted to get the example running on the board. When I click the option to hardware debug, I get an error saying "Error launching GDB server. Check installation".
Am I to re install eclipse, or the GCC toolchain for the RX cpu, or anything else?
I don't know anything about your specifics (that is Renesas or the RX62N). I do use eclipse for embedded work. Typically on a new platform I would make sure I can build and download a release version first. Once you have that working then see if you can get a Debug build and the debugger running. On the platforms I am used to, you have to put in hooks (typically just a single call) to enable the debugger. For exmple on the NetBurner the debugger can run over the serial port or Ethernet so the call has to specify which version you want to use. I know other platforms use JTAG debuggers etc, Typically a dev kit for the board comes with a manual that details how to get the debugger working. I doubt that you need to reinstall anything you just need to get the configuration set up correctly.