Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fail in macos x 10.15.7 #28

Open
algoz098 opened this issue Jan 21, 2021 · 19 comments
Open

build fail in macos x 10.15.7 #28

algoz098 opened this issue Jan 21, 2021 · 19 comments

Comments

@algoz098
Copy link

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```
@algoz098
Copy link
Author

Found the solution removing and reinstalling the xcode commandtools.

@hoodie
Copy link
Collaborator

hoodie commented Jan 22, 2021

is this still an issue then?

@productinfo
Copy link

i also got same issue as above, re-install command line tools worked.. I think this is no more an issue but should be documented to frequently encounter errors/FAQ.

Commands to re-install Xcode command line tools.

# delete existing command line tools
sudo rm -rf /Library/Developer/CommandLineTools
# install command line tools
xcode-select —install

@t-mw
Copy link

t-mw commented Dec 27, 2021

Upgrading ncurses from v6.2 to v6.3 in macports fixed this for me:

sudo port upgrade ncurses

although I was getting a slightly different error:

  cargo:warning=/opt/local/include/unctrl.h:61:63: error: unknown type name 'SCREEN'
  cargo:warning=NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype);
...
  cargo:warning=In file included from objc/notify.m:1:
  cargo:warning=objc/notify.h:1:9: fatal error: could not build module 'Foundation'
  cargo:warning=#import <Foundation/Foundation.h>
  cargo:warning= ~~~~~~~^
  cargo:warning=16 errors generated.
  exit status: 1

Related: https://stackoverflow.com/a/46613039

@schickling
Copy link

schickling commented Dec 31, 2021

I'm facing the same problem when using cargo installed via Nix (which seems (to try) to link against nix-packaged macOS frameworks).

My context is a simple Tauri app. Here is a repro: https://github.com/schickling-test/tauri-nix-mac-repro

Ib2GxjwqCReOZRcGI1vtwfxKxzKg48Ru0SKoKSER

@felipesere
Copy link

I get the same issue trying to install cargo-watch.
I'm using ncurses v6.3 from homebrew, although I tried to use it via
LDFLAGS="-L/opt/homebrew/opt/ncurses/lib" CPPFLAGS="-I/opt/homebrew/opt/ncurses/include" cargo install cargo-watch

@schickling
Copy link

@felipesere are you on an M1? Which macOS version?

@felipesere
Copy link

Yeah, I am on M1 with macOS 11.6.2 "Big Sur"

@rpearce
Copy link

rpearce commented Jan 16, 2022

Same thing for me in a nix environment with cargo-watch with an M1 on macOS Monterey

warning: In file included from objc/notify.m:1:
warning: objc/notify.h:1:9: fatal error: 'Foundation/Foundation.h' file not found
warning: #import <Foundation/Foundation.h>
warning:         ^~~~~~~~~~~~~~~~~~~~~~~~~
warning: 1 error generated.

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

So then I manually go and include Foundation (pkgs.darwin.apple_sdk.frameworks.Foundation), and I get

warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: In file included from <module-includes>:1:
warning: /nix/store/641gv090lkmcfz52wlf9314rnl4fb1jm-apple-framework-Foundation-11.0.0/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6: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: While building module 'CoreServices' imported from objc/notify.h:3:
warning: In file included from <module-includes>:1:
warning: /nix/store/srl8r7rk11sgvgbz07vipmfi6cdq8vlw-apple-framework-CoreServices-11.0.0/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 'CoreServices' imported from objc/notify.h:3:
warning: While building module 'DiskArbitration' imported from /nix/store/srl8r7rk11sgvgbz07vipmfi6cdq8vlw-apple-framework-CoreServices-11.0.0/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/File
warning: In file included from <module-includes>:1:
warning: /nix/store/9ksh90av3smccmwlnqh2svq48xhj2pkf-apple-framework-DiskArbitration-11.0.0/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 'CoreServices' imported from objc/notify.h:3:
warning: While building module 'DiskArbitration' imported from /nix/store/srl8r7rk11sgvgbz07vipmfi6cdq8vlw-apple-framework-CoreServices-11.0.0/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/File
warning: While building module 'IOKit' imported from /nix/store/9ksh90av3smccmwlnqh2svq48xhj2pkf-apple-framework-DiskArbitration-11.0.0/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h:28:
warning: In file included from <module-includes>:4:
warning: /nix/store/kvcr4lv0a477a35khkdnim11sy0nics9-apple-framework-IOKit-11.0.0/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 'CoreServices' imported from objc/notify.h:3:
warning: While building module 'CFNetwork' imported from /nix/store/srl8r7rk11sgvgbz07vipmfi6cdq8vlw-apple-framework-CoreServices-11.0.0/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:31:
warning: In file included from <module-includes>:1:
warning: /nix/store/yg3zg4w95cn4bp4c70kcbh7ildxbadnf-apple-framework-CFNetwork-11.0.0/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 'CoreServices' imported from objc/notify.h:3:
warning: While building module 'Security' imported from /nix/store/srl8r7rk11sgvgbz07vipmfi6cdq8vlw-apple-framework-CoreServices-11.0.0/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityB
warning: In file included from <module-includes>:1:
warning: In file included from /nix/store/c7ilkh6b3lva99kixsv4n1la0vw68rav-apple-framework-Security-11.0.0/Library/Frameworks/Security.framework/Headers/Security.h:27:
warning: /nix/store/c7ilkh6b3lva99kixsv4n1la0vw68rav-apple-framework-Security-11.0.0/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 'CoreServices' imported from objc/notify.h:3:
warning: While building module 'Security' imported from /nix/store/srl8r7rk11sgvgbz07vipmfi6cdq8vlw-apple-framework-CoreServices-11.0.0/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityB
warning: While building module 'XPC' imported from /nix/store/c7ilkh6b3lva99kixsv4n1la0vw68rav-apple-framework-Security-11.0.0/Library/Frameworks/Security.framework/Headers/SecCode.h:35:
warning: In file included from <module-includes>:1:
warning: /nix/store/8mgx8iwvhxqpqq87blr6ligj8y2ka80w-apple-lib-xpc/include/xpc/xpc.h:7:2: fatal error: module 'ObjectiveC' is defined in both '/var/folders/k7/sspdr20908j9vyw063hj9f4h00009d/C/clang/ModuleCache/1DUII0VXZWGY4/Objec
warning: #include <dispatch/dispatch.h>
warning:  ^
warning: 8 errors generated.

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

Not sure how much of this is helpful.

@winston0410
Copy link

Confirm the same issue persist for mac-notification-sys v0.5.0

 --- stdout
  TARGET = Some("aarch64-apple-darwin")
  OPT_LEVEL = Some("3")
  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("false")
  CARGO_CFG_TARGET_FEATURE = Some("aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,llvm14-builtins-abi,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,v8.1a,v8.2a,v8.3a,v8.4a,vh")
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-fmodules" "-o" "/Users/hugosum/Desktop/jyut-speech-to-text/src-tauri/target/release/build/mac-notification-sys-c5cfa49e7a6ec1ad/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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
  cargo:warning=- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
  cargo:warning=                                                         ~~~~~~~~~~~~~~                                                                       ^                  ~
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
  cargo:warning=        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
  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=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreData' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSKeyValueBinding.h:12:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreData' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSKeyValueBinding.h:12:
  cargo:warning=While building module 'CloudKit' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainerOptions.h:12:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreData' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSKeyValueBinding.h:12:
  cargo:warning=While building module 'CloudKit' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainerOptions.h:12:
  cargo:warning=While building module 'CoreLocation' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.h:18:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreImage' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
  cargo:warning=In file included from <module-includes>:1:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h:9: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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreImage' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
  cargo:warning=While building module 'CoreVideo' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:
  cargo:warning=While building module 'IOSurface' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:31:
  cargo:warning=In file included from <module-includes>:4:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h:15: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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreImage' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
  cargo:warning=While building module 'CoreVideo' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:29:
  cargo:warning=In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h:628:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:31:10: fatal error: could not build module 'IOSurface'
  cargo:warning=#include <IOSurface/IOSurface.h>
  cargo:warning= ~~~~~~~~^
  cargo:warning=While building module 'Cocoa' imported from objc/notify.h:1:
  cargo:warning=While building module 'AppKit' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'CoreImage' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:51:
  cargo:warning=While building module 'CoreVideo' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:
  cargo:warning=While building module 'Metal' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h:9:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13:
  cargo:warning=While building module 'QuartzCore' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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 /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9:
  cargo:warning=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.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=12 errors generated.
  exit status: 1

  --- stderr


  error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-fmodules" "-o" "/Users/hugosum/Desktop/jyut-speech-to-text/src-tauri/target/release/build/mac-notification-sys-c5cfa49e7a6ec1ad/out/objc/notify.o" "-c" "objc/notify.m" with args "cc" did not execute successfully (status code exit status: 1).

@OscarHedeby
Copy link

I had the same error and fixed it by simply upgrading/installing llvm

brew install llvm

@koriwi
Copy link

koriwi commented Jul 30, 2022

I still have this issue on 11.6
Freshly installed commandline tools and llvm

@hoodie
Copy link
Collaborator

hoodie commented Aug 4, 2022

even with xcode installed? you need to have Foundation on your system

@koriwi
Copy link

koriwi commented Aug 13, 2022

need to try that. was a bit hesitant to install complete xcode because it was something like 10gig.

@koriwi
Copy link

koriwi commented Aug 23, 2022

installing the newest available xcode available for my 2014 macbook pro 15 (not supported on latest macos) works :)

@hoodie hoodie closed this as completed Aug 24, 2022
@schickling
Copy link

schickling commented Aug 26, 2022

Unfortunately I'm still facing the same problem as described above. Would be great if this issue could be kept open until the underlying issue is resolved.

Here is a repro: https://github.com/schickling-test/tauri-nix-mac-repro

@hoodie hoodie reopened this Sep 21, 2022
@boneyard93501
Copy link

same here. started after the (latest) xcode-select update to version 2384.
llvm 15.0.1, rust 1.64.0 (a55dd71d5 2022-09-19), cargo-tauri 1.1.1

wyuenho referenced this issue in macports/macports-ports Feb 16, 2023
@pmarquesmota
Copy link

For the record, I managed to solve it with

export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"

@gelove
Copy link

gelove commented Nov 27, 2024

For the record, I managed to solve it with

export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"

Thx, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests