Can't find executable `mac_listener` - [error] exited in: GenServer.call

Hey friends,

I had the same issues as most folks above (macOS Sonoma 14.3.1) and none of the solutions worked, even reinstalling xcode, command line tools, etc.

What I ended up doing and what worked is the following inside deps/file_system:

xcrun clang -isysroot $(xcrun --show-sdk-path) -I$(xcrun --show-sdk-path)/usr/include -framework CoreFoundation -framework CoreServices -Wno-deprecated-declarations c_src/mac/*.c -o priv/mac_listener

So basically:

  • $(xcrun --show-sdk-path): Ensures the compiler knows where to find the system SDK.
  • -I$(xcrun --show-sdk-path)/usr/include: Specifies where to find include headers (probably redundant with the SDK setting :man_shrugging:).
  • -framework CoreFoundation -framework CoreServices: Links necessary Apple frameworks.
  • c_src/mac/*.c -o priv/mac_listener: Compiles all C files in the specified directory and outputs the executable as mac_listener.

And with the mac_listener in place, it worked fine.

3 Likes