Giter VIP home page Giter VIP logo

mac-notification-sys's Introduction

mac-notification-sys

platform version license contributors

build downloads documentation

A simple wrapper to deliver or schedule macOS Notifications in Rust.

Usage

#Cargo.toml
[dependencies]
mac-notification-sys = "0.6"

Documentation

The documentation can be found here

Example

use mac_notification_sys::*;

fn main() {
    let bundle = get_bundle_identifier_or_default("firefox");
    set_application(&bundle).unwrap();

    send_notification(
        "Danger",
        Some("Will Robinson"),
        "Run away as fast as you can",
        None,
    )
    .unwrap();

    send_notification(
        "NOW",
        None,
        "Without subtitle",
        Some(Notification::new().sound("Blow")),
    )
    .unwrap();
}

TODO

  • Add timeout option so notifications can be auto-closed
  • Allow NSDictionary to hold various types (perhaps with a union?)
  • Switch to UserNotification if possible

Contributors

Thanks goes to these wonderful people:

Any help in form of descriptive and friendly issues or comprehensive pull requests are welcome!

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in mac-notification-sys by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Conventions

The Changelog of this library is generated from its commit log, there any commit message must conform with https://www.conventionalcommits.org/en/v1.0.0/. For simplicity you could make your commits with convco.

mac-notification-sys's People

Contributors

amrbashir avatar andytom avatar betamos avatar blackholefox avatar frewsxcv avatar guiguiprim avatar h4llow3en avatar hoodie avatar joshmcguigan avatar lucasfernog avatar pandawan avatar probablykasper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mac-notification-sys's Issues

Action buttons

I want to show simple reminder notifications which doesn't automatically go away until the user manually dismisses it. To do that, I believe the way to go is to have a Done button in the notification

Updating to objc2 and adding async support

I have been writing a version of this crate but with interaction support based on the NSUserNotification Library.
Here is a working example:
https://github.com/dscso/mac-notifications

let mut provider = NotificationProvider::new("Terminal");

// callback for notification interaction
provider.set_callback(|id, resp| {
   println!("Notification {} clicked: {:?}", id, resp);
});

// sends notification
Notification::new()
    .title("Hello")
    .reply(true)
    .send().unwrap();

// run the main loop. If some notification gets interacted with, the callback will be called
for _ in 0..50 {
    provider.run_main_loop_once();
}

I've improved

  • memory leaks (now there should be none)
  • expose delegate (user of the library can set a new delegate)
  • give control over main_loop (like in #51)
  • moved to obj2 since it provides a much more stable/easy to use API
  • moved most of the stuff I could form the .m file to Rust 🦀

What has to be done:

  • action buttons not working yet
  • testing for bugs/memory bugs

Maybe this could be combined with #51 to create a full 2.0?

v0.5.3 crashes

I'm using Tauri's notification API, which depends on mac-notification-sys. It seems like v0.5.3 introduced a bug that terminates the app once 2 notifications are shown.

Pinning mac-notification-sys to 0.5.2 fixed this for me, so seems like an issue with v0.5.3.

OS: macOS 10.15

Possible version mismatch in CoreFoundation.framework

See tauri-apps/tauri#4387

I built a tauri app which includes mac-notification-sys, and one that doesn't. Both were built from macOS 12.4 with XCode 13 and 14 beta (no difference). It appears that our usage of this lib caused a "missing symbol" dyld linking error when loading the app on macOS 10.13-10.13.6 (at minimum, might affect more versions), but I don't know if it's a bug in tauri or in the build step here. So consider this issue informational for now.

The reason I'm posting here at all is because Tauri has a lot of Obj C dependencies, but this is the only one that appears to trigger a linking failure like this.

Anyway, if anyone has experience deploying to multiple versions of macOS, this could be extremely helpful. I suspect there's a version mismatch with dynamic linking to libraries, but this is over my head. Nevertheless I really hope we can fix this.

NSDictionary uses only NSStrings

This issue is a carry-over from a discussion in #16.

I'm unsure if this is a limitation of the objective c to rust library or if I missed something, but I was unable to create an NSDictionary with multiple value types. As a result, I was forced to stringify arrays, numbers, and booleans to pass them to the objective c side.

This works but ends up in ugly/hackish code where all the data is stringified before being passed between rust and objective c.

I was thinking that we could potentially use C unions to pass data of any kind, but I'm unsure of the consequences of doing this.

issues with threading.

Hi if i use threading the calls to sendNotifications hangs. its because of the while on ncDelegate.keepRunning and problably the osx call. deleting that start working correcly. i suppose that you added that to keep running the app while the deliverNotification send the note. but if the call was already made we should suppose that was already send. also we can use some local variable for that.

Hangs on macOS Catalina

Hey, I've tried to build and run the example code on Catalina, but it seems it is somehow broken. Nothing is displayed on the console, nor the program exits, it just hangs forever and no notification is displayed either.

rustc 1.43.0 (4fb7144ed 2020-04-20)
macOS 10.15.4 (19E287)
mac-notification-sys "0.1.3"

crash when label is clicked in the dropdown options

i have a notification which is setup like this

        let res = send_notification(
            "My App",
            Some(&format!(
                "Following device wants to mount: {:?}",
                disk.volume_name
            )),
            "Please allow/deny.",
            Some(Notification::new().main_button(
                mac_notification_sys::MainButton::DropdownActions("Choose", &["Allow", "Deny"]),
            )),
        )
        .unwrap();

i accidentally clicked on the "Choose" option which is supposed to be label and the program aborted. is there a way to make the label not clickable?

2023-08-10 10:42:44.313 diskguard[4386:36931] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndexedSubscript:]: index 9223372036854775807 beyond bounds [0 .. 1]'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000019bdbf154 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x000000019b8de4d4 objc_exception_throw + 60
	2   CoreFoundation                      0x000000019bea99b8 -[__NSCFString characterAtIndex:].cold.1 + 0
	3   CoreFoundation                      0x000000019bd32ee8 +[NSNull null] + 0
	4   diskguard                           0x00000001041eba10 -[NotificationCenterDelegate userNotificationCenter:didActivateNotification:] + 244
	5   Foundation                          0x000000019cd4e8d0 -[_NSConcreteUserNotificationCenter _sendDelegateMessage:sendToAppDelegate:withObject:] + 132
	6   Foundation                          0x000000019d2f3b74 -[_NSConcreteUserNotificationCenter _notificationClickedMessage:] + 436
	7   Foundation                          0x000000019cd08c90 __54-[_NSConcreteUserNotificationCenter _serverConnection]_block_invoke_4 + 88
	8   libdispatch.dylib                   0x000000019bab6874 _dispatch_call_block_and_release + 32
	9   libdispatch.dylib                   0x000000019bab8400 _dispatch_client_callout + 20
	10  libdispatch.dylib                   0x000000019bac6bf8 _dispatch_main_queue_drain + 928
	11  libdispatch.dylib                   0x000000019bac6848 _dispatch_main_queue_callback_4CF + 44
	12  CoreFoundation                      0x000000019bd87c54 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
	13  CoreFoundation                      0x000000019bd453d4 __CFRunLoopRun + 1992
	14  CoreFoundation                      0x000000019bd444b8 CFRunLoopRunSpecific + 612
	15  Foundation                          0x000000019ccbdfcc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
	16  Foundation                          0x000000019cd32394 -[NSRunLoop(NSRunLoop) runUntilDate:] + 100
	17  diskguard                           0x00000001041ec750 sendNotification + 1948
	18  diskguard                           0x00000001041e766c _ZN20mac_notification_sys17send_notification17h534efafd130e8591E + 896
	19  diskguard                           0x00000001041e1d00 _ZN9diskguard11allow_mount17hc6d117dd305f0512E + 780
	20  DiskArbitration                     0x00000001a2e764f4 _DADispatchCallback + 336
	21  DiskArbitration                     0x00000001a2e760f8 _DASessionCallback + 276
	22  CoreFoundation                      0x000000019bd76284 __CFMachPortPerform + 296
	23  CoreFoundation                      0x000000019bd46bcc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60
	24  CoreFoundation                      0x000000019bd46aec __CFRunLoopDoSource1 + 520
	25  CoreFoundation                      0x000000019bd454cc __CFRunLoopRun + 2240
	26  CoreFoundation                      0x000000019bd444b8 CFRunLoopRunSpecific + 612
	27  CoreFoundation                      0x000000019bdc957c CFRunLoopRun + 64
	28  diskguard                           0x00000001041e20f4 _ZN9diskguard4main17ha29f688eb14bdc19E + 260
	29  diskguard                           0x00000001041e2bb0 _ZN4core3ops8function6FnOnce9call_once17hb33879ec86c26350E + 20
	30  diskguard                           0x00000001041e2564 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h4733b85134cec3eaE + 24
	31  diskguard                           0x00000001041e2498 _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h372d4bda1ef4d76cE + 28
	32  diskguard                           0x0000000104209710 _ZN3std2rt19lang_start_internal17h434fe84e11a92429E + 648
	33  diskguard                           0x00000001041e2464 _ZN3std2rt10lang_start17h344ff8dd13fec62fE + 84
	34  diskguard                           0x00000001041e2208 main + 36
	35  dyld                                0x000000019b90ff28 start + 2236
)
libc++abi: terminating due to uncaught exception of type NSException

Issue: crash sending notification on custom app identifier

when setting up a custom app identifier, the set_application works correctly but then when im sending the notification the app crashes 80% of the time, sometimes works. i will try to investigate this later to fix it.

Process 25269 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
    #0  0x00007fff6e1a8a1d objc_msgSend + 29
libobjc.A.dylib`objc_msgSend:
->  0x7fff6e1a8a1d <+29>: and    r11d, dword ptr [r10 + 0x18]
    0x7fff6e1a8a21 <+33>: shl    r11, 0x4
    0x7fff6e1a8a25 <+37>: add    r11, qword ptr [r10 + 0x10]
    0x7fff6e1a8a29 <+41>: cmp    rsi, qword ptr [r11]
Target 0: (sekey) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
  * #0  0x00007fff6e1a8a1d objc_msgSend + 29
    #1  0x00007fff4444ab7d -[_NSConcreteUserNotificationCenter _initWithBundleIdentifier:type:] + 89
    #2  0x00007fff4444ab18 __57+[NSUserNotificationCenter defaultUserNotificationCenter]_block_invoke + 91
    #3  0x00007fff4444aa08 _performInCenterLock + 45
    #4  0x000000010000e2fd sendNotification + 141
    #5  0x000000010000ce2c mac_notification_sys::send_notification::h85b884fa6ea1264d + 284

doc does not build on docs.rs

I'm afraid the documentation on [https://docs.rs/] is not build on a mac and therefore can not be build, you might have to do that manually.

Notification timeout or dismiss event

This issue is a carry-over from issues I talked about in #16.

I noticed that when a notification is delivered and the user does not interact with it, it moves to the Notification Center.

This can actually be an issue when the notification is in synchronous mode and waiting for results because it will block the thread until the user interacts with it through the Notification Center. This is sub-optimal as the notification is not directly visible (as it is hidden until the Notification Center is displayed) and therefore is unlikely to be interacted with.

  • If someone knows about some kind of "dismissed/moved to notification center" event in Objective C then maybe that could be used, but I was unable to find one in the API documentation.
  • Otherwise I think one workaround would be to add some kind of timeout option which would run a timer and cancel the synchronous while loop. It seems alerter does this (though we wouldn't have to do it the same way).

set_application appears not to be thread safe

When calling set_application, the function modifies the static mut flag APPLICATION_SET. If two different points on the call-stack ever hold a mutable reference to this flag at the same time, this is undefined behaviour. This can be easily fixed using an AtomicBool or a Once from std, but as it is not marking the function as unsafe is misleading.

build fail in macos x 10.15.7

Using the demo code in the readme.md it's throwing a error in build

warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/libxml2/libxml/module.modulemap:1:8: error: redefinition of module 'libxml2'
warning: module libxml2 [system] [extern_c] {
warning:        ^
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/libxml2/module.modulemap:1:8: note: previously defined here
warning: module libxml2 [system] [extern_c] {
warning:        ^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'CoreFoundation' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
warning: While building module 'Dispatch' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:
warning: In file included from <module-includes>:1:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/dispatch/dispatch.h:59:10: fatal error: could not build module 'os_object'
warning: #include <os/object.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'CoreFoundation' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
warning: In file included from <module-includes>:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:10: fatal error: could not build module 'Dispatch'
warning: #include <dispatch/dispatch.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: In file included from <module-includes>:1:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'CoreGraphics' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:9:
warning: In file included from <module-includes>:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:8:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:12:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CFBase.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'CoreGraphics' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:9:
warning: While building module 'IOKit' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h:12:
warning: In file included from <module-includes>:4:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOCFBundle.h:26:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'Security' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:9:
warning: In file included from <module-includes>:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:27:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:28:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CFBase.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'CoreServices' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
warning: In file included from <module-includes>:1:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'CoreServices' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
warning: While building module 'DiskArbitration' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:56:
warning: In file included from <module-includes>:1:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DiskArbitration.h:27:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'CoreServices' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
warning: While building module 'CFNetwork' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:31:
warning: In file included from <module-includes>:1:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:18:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'XPC' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:14:
warning: In file included from <module-includes>:1:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/xpc/xpc.h:6:10: fatal error: could not build module 'os_object'
warning: #include <os/object.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'ApplicationServices' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAppleEventDescriptor.h:9:
warning: In file included from <module-includes>:1:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:23:10: fatal error: could not build module 'CoreServices'
warning: #include <CoreServices/CoreServices.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'ApplicationServices' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAppleEventDescriptor.h:9:
warning: While building module 'CoreText' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h:16:
warning: In file included from <module-includes>:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Headers/CoreText.h:20:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h:20:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h:20:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h:14:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'ApplicationServices' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAppleEventDescriptor.h:9:
warning: While building module 'ColorSync' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:31:
warning: In file included from <module-includes>:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/ColorSync.h:10:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h:12:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: While building module 'ApplicationServices' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAppleEventDescriptor.h:9:
warning: While building module 'ImageIO' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:47:
warning: In file included from <module-includes>:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ImageIO.framework/Headers/ImageIO.h:10:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h:16:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: In file included from objc/notify.m:1:
warning: objc/notify.h:1:9: fatal error: could not build module 'Foundation'
warning: #import <Foundation/Foundation.h>
warning:  ~~~~~~~^
warning: 16 errors generated.

error: failed to run custom build command for `mac-notification-sys v0.3.0```

Returning `failure::error::Error`forces clients to add `failure` crate as a dependency

The rust-lang-nursery/failure crate provides convenient error handling in Rust and was recently used by mac-notification-sys in v0.2. However, returning a failure::error::Error in public methods such as send_notification forces clients who wish to handle the error without calling unwrap() to use the failure crate and add it as a project dependency. This ticket is a recommendation/request to remove the failure dependency and revert to the error_chain handling in v0.1.* (or vanilla error handling).

One workaround would be to use map_err and pass the display message to our own type, but this is not optimal.

Thanks for the awesome crate :)

MacOS 13 failure

Running the example from the README.md, I get error in MacOS Ventura on M1.


❯ cargo r
   Compiling block v0.1.6
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.126
   Compiling mac-notification-sys v0.5.2
   Compiling malloc_buf v0.0.6
   Compiling num_threads v0.1.6
   Compiling dirs-sys-next v0.1.2
   Compiling time v0.3.11
   Compiling objc v0.2.7
   Compiling dirs-next v2.0.0
   Compiling objc_id v0.1.1
   Compiling objc-foundation v0.1.1
The following warnings were emitted during compilation:

warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
warning: While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:2: fatal error: module 'Darwin' is defined in both '/var/folders/r4/4fnhz7556w1btwm98ygz1t_w0000gn/C/clang/ModuleCache/O8YHJLP9XCQV/Darwin-CTM3NN7PD06L.pcm' and '/var/folders/r4/4fnhz7556w1btwm98ygz1t_w0000gn/C/clang/ModuleCache/O8YHJLP9XCQV/Darwin-1IVCWVLR6MT9T.pcm'
warning: #include <dispatch/dispatch.h>
warning:  ^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
warning: In file included from <module-includes>:1:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
warning: While building module 'CoreGraphics' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:9:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:8:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:12:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CFBase.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
warning: While building module 'CoreGraphics' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:9:
warning: While building module 'IOKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h:12:
warning: In file included from <module-includes>:6:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:45:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CFBase.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
warning: While building module 'Security' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:9:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:27:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:28:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CFBase.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
warning: While building module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
warning: In file included from <module-includes>:1:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
warning: While building module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
warning: While building module 'DiskArbitration' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:56:
warning: In file included from <module-includes>:1:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DiskArbitration.h:27:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
warning: While building module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
warning: While building module 'CFNetwork' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:31:
warning: In file included from <module-includes>:1:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:18:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: In file included from <module-includes>:1:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:9: fatal error: could not build module 'Foundation'
warning: #import <Foundation/Foundation.h>
warning:  ~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: In file included from <module-includes>:1:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:10:9: fatal error: could not build module 'Foundation'
warning: #import <Foundation/Foundation.h>
warning:  ~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'ApplicationServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
warning: In file included from <module-includes>:1:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:23:10: fatal error: could not build module 'CoreServices'
warning: #include <CoreServices/CoreServices.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'ApplicationServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
warning: While building module 'CoreText' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h:16:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h:20:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h:20:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h:20:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h:14:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'ApplicationServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
warning: While building module 'ColorSync' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:31:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h:10:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h:12:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'ApplicationServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
warning: While building module 'ImageIO' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:47:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h:10:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h:16:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'CoreData' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSKeyValueBinding.h:12:
warning: In file included from <module-includes>:1:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:8:9: fatal error: could not build module 'Foundation'
warning: #import <Foundation/Foundation.h>
warning:  ~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'CoreData' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSKeyValueBinding.h:12:
warning: While building module 'CloudKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainerOptions.h:12:
warning: In file included from <module-includes>:1:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.h:8:9: fatal error: could not build module 'Foundation'
warning: #import <Foundation/Foundation.h>
warning:  ~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'CoreData' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSKeyValueBinding.h:12:
warning: While building module 'CloudKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainerOptions.h:12:
warning: While building module 'CoreLocation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CKRecord.h:8:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.h:18:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CLErrorDomain.h:10:9: fatal error: could not build module 'Foundation'
warning: #import <Foundation/Foundation.h>
warning:  ~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h:8:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImageDefines.h:19:10: fatal error: could not build module 'ApplicationServices'
warning: #include <ApplicationServices/ApplicationServices.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
warning: While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:20:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h:21:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h:30:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CFBase.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
warning: While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:
warning: While building module 'IOSurface' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:31:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h:12:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h:36:10: fatal error: could not build module 'CoreFoundation'
warning: #include <CoreFoundation/CoreFoundation.h>
warning:  ~~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
warning: While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:
warning: While building module 'Metal' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTextureCache.h:41:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h:9:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h:8:9: fatal error: could not build module 'Foundation'
warning: #import <Foundation/Foundation.h>
warning:  ~~~~~~~^
warning: While building module 'Cocoa' imported from objc/notify.h:1:
warning: While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
warning: While building module 'QuartzCore' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLLayer.h:11:
warning: In file included from <module-includes>:1:
warning: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9:
warning: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h:1:10: fatal error: could not build module 'CoreImage'
warning: #include <CoreImage/CoreImage.h>
warning:  ~~~~~~~~^
warning: In file included from objc/notify.m:1:
warning: objc/notify.h:1:9: fatal error: could not build module 'Cocoa'
warning: #import <Cocoa/Cocoa.h>
warning:  ~~~~~~~^
warning: 23 errors generated.

error: failed to run custom build command for `mac-notification-sys v0.5.2`

Caused by:
  process didn't exit successfully: `/Users/user/Projects/tauris/macnot/target/debug/build/mac-notification-sys-b5307de2f57f85cc/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("aarch64-apple-darwin")
  OPT_LEVEL = Some("0")
  HOST = Some("aarch64-apple-darwin")
  CC_aarch64-apple-darwin = None
  CC_aarch64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_aarch64-apple-darwin = None
  CFLAGS_aarch64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh")
  running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-arch" "arm64" "-fmodules" "-o" "/Users/user/Projects/tauris/macnot/target/debug/build/mac-notification-sys-45d20d5723d05394/out/objc/notify.o" "-c" "objc/notify.m"
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
  cargo:warning=While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:2: fatal error: module 'Darwin' is defined in both '/var/folders/r4/4fnhz7556w1btwm98ygz1t_w0000gn/C/clang/ModuleCache/O8YHJLP9XCQV/Darwin-CTM3NN7PD06L.pcm' and '/var/folders/r4/4fnhz7556w1btwm98ygz1t_w0000gn/C/clang/ModuleCache/O8YHJLP9XCQV/Darwin-1IVCWVLR6MT9T.pcm'
  cargo:warning=#include <dispatch/dispatch.h>
  cargo:warning= ^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CoreFoundation.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
  cargo:warning=While building module 'CoreGraphics' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:9:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:8:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:12:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CFBase.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
  cargo:warning=While building module 'CoreGraphics' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:9:
  cargo:warning=While building module 'IOKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h:12:
  cargo:warning=In file included from <module-includes>:6:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:45:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CFBase.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
  cargo:warning=While building module 'Security' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:9:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:27:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:28:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CFBase.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
  cargo:warning=While building module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CoreFoundation.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
  cargo:warning=While building module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
  cargo:warning=While building module 'DiskArbitration' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:56:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DiskArbitration.h:27:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CoreFoundation.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
  cargo:warning=While building module 'CoreServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:15:
  cargo:warning=While building module 'CFNetwork' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:31:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:18:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CoreFoundation.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:9: fatal error: could not build module 'Foundation'
  cargo:warning=#import <Foundation/Foundation.h>
  cargo:warning= ~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:10:9: fatal error: could not build module 'Foundation'
  cargo:warning=#import <Foundation/Foundation.h>
  cargo:warning= ~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'ApplicationServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:23:10: fatal error: could not build module 'CoreServices'
  cargo:warning=#include <CoreServices/CoreServices.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'ApplicationServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
  cargo:warning=While building module 'CoreText' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h:16:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h:20:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h:20:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h:20:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h:14:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CoreFoundation.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'ApplicationServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
  cargo:warning=While building module 'ColorSync' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:31:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h:10:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h:12:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CoreFoundation.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'ApplicationServices' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
  cargo:warning=While building module 'ImageIO' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:47:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h:10:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h:16:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CoreFoundation.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreData' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSKeyValueBinding.h:12:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h:8:9: fatal error: could not build module 'Foundation'
  cargo:warning=#import <Foundation/Foundation.h>
  cargo:warning= ~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreData' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSKeyValueBinding.h:12:
  cargo:warning=While building module 'CloudKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainerOptions.h:12:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.h:8:9: fatal error: could not build module 'Foundation'
  cargo:warning=#import <Foundation/Foundation.h>
  cargo:warning= ~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreData' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSKeyValueBinding.h:12:
  cargo:warning=While building module 'CloudKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainerOptions.h:12:
  cargo:warning=While building module 'CoreLocation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CKRecord.h:8:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.h:18:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CLErrorDomain.h:10:9: fatal error: could not build module 'Foundation'
  cargo:warning=#import <Foundation/Foundation.h>
  cargo:warning= ~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h:8:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImageDefines.h:19:10: fatal error: could not build module 'ApplicationServices'
  cargo:warning=#include <ApplicationServices/ApplicationServices.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
  cargo:warning=While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:20:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h:21:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h:30:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CFBase.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
  cargo:warning=While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:
  cargo:warning=While building module 'IOSurface' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:31:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h:12:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h:36:10: fatal error: could not build module 'CoreFoundation'
  cargo:warning=#include <CoreFoundation/CoreFoundation.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
  cargo:warning=While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:
  cargo:warning=While building module 'Metal' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTextureCache.h:41:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h:9:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h:8:9: fatal error: could not build module 'Foundation'
  cargo:warning=#import <Foundation/Foundation.h>
  cargo:warning= ~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'QuartzCore' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLLayer.h:11:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9:
  cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h:1:10: fatal error: could not build module 'CoreImage'
  cargo:warning=#include <CoreImage/CoreImage.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=In file included from objc/notify.m:1:
  cargo:warning=objc/notify.h:1:9: fatal error: could not build module 'Cocoa'
  cargo:warning=#import <Cocoa/Cocoa.h>
  cargo:warning= ~~~~~~~^
  cargo:warning=23 errors generated.
  exit status: 1

  --- stderr


  error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-arch" "arm64" "-fmodules" "-o" "/Users/user/Projects/tauris/macnot/target/debug/build/mac-notification-sys-45d20d5723d05394/out/objc/notify.o" "-c" "objc/notify.m" with args "cc" did not execute successfully (status code exit status: 1).

Notifications do not display

I made a minimal test program from one of the examples:

# Cargo.toml
[dependencies]
mac-notification-sys = "0.3"
// main.rs
use mac_notification_sys::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    set_application("com.apple.Terminal")?;

    send_notification(
        "Danger",
        &Some("Will Robinson"),
        "Run away as fast as you can",
        &None,
    )?;

    Ok(())
}

Running the program doesn't produce a notification, on both debug and release mode. It does not crash.
I'm on a M1 Macbook Pro (2021, 14-inch) on MacOS Monterey with Rust 1.58.
Compiling on stable-aarch64-apple-darwin or stable-x86_64-apple-darwin produces the same results.

Create Github Actions

Create Github Actions to:

  • Build all branches and PRs
  • Lint all builds
  • Build releases (on tags maybe?)
  • Publish releases
  • Build gh-pages with docs of release

Switch to UN* API

The NS* API for notifications is deprecated, the new deal is this:

https://developer.apple.com/documentation/usernotifications

It also allows to add attachments, which might be interesting! A good example (and the most interesting class to play around with) is UNMutableNotificationContent.

I think a new API that supports badge, sound, and attachments would be nice. The old API could still be based on the deprecated macOS API (and be usable before mojave). IDK how to conditionally compile based on macOS version though.

set_application doesn't seem to take effect (and can't be set twice)

First, the source:

use mac_notification_sys::*;

fn main() {
    let bundle = get_bundle_identifier_or_default("reminder");
    set_application(&bundle).unwrap();

    let _ = send_notification("Title", &Some("Subtitle"), "This is the body", &None).unwrap();

    let other_app_bundle = get_bundle_identifier_or_default("other_app");
    set_application(&other_app_bundle).unwrap();

    send_notification(
        "Danger",
        &Some("Will Robinson"),
        "Run away as fast as you can",
        &None,
    )
    .unwrap();
}

There are two issues here:

  1. the bundle doesn't seem to be set (notification still comes from "terminal", which is later on confirmed by (2)
  2. it's not possible to set the application name twice (or, to have notification not override themselves, i.e. generate a couple of notifications that would be displayed at the same time):
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Application(AlreadySet("com.apple.Terminal"))', src/main.rs:10:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Replace send_notification() with show()

This issue is a carry-over from a discussion in #16.

Instead of having a send_notification() function, perhaps the Notification struct should implement a show() method for cleaner/simpler interfacing.

This would be a major breaking change so it needs to be pre-planned.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.