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

[bug] error: failed to run custom build command for mac-notification-sys v0.3.0 #3315

Closed
gotjoshua opened this issue Jan 31, 2022 · 9 comments

Comments

@gotjoshua
Copy link

gotjoshua commented Jan 31, 2022

Describe the bug

fresh install (both svelte and vite-preact-ts did the same)
(i also tried the reinstall and find commands from this issue #1150 (comment))
run the dev command
front end starts, cargos compile and then:

The following warnings were emitted during compilation:

warning: While building module 'Foundation' imported from objc/notify.h:1:
warning: In file included from <module-includes>:1:
warning: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
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));
warning:                                                          ~~~~~~~~~~~~~~                                                                       ^                  ~
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'
warning:         #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
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: 2 errors generated.

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

Reproduction

fresh install (both svelte and vite-preact-ts did the same)
run the dev command

Expected behavior

a fresh install should compile and launch the app.

Platform and versions

><> yarn tauri info                                                                         09:39:30
yarn run v1.22.17
warning package.json: No license field
$ tauri info
 app:spawn Running "/Volumes/Stripe/Dev/tauri-vite-preact/node_modules/@tauri-apps/cli/bin/tauri-cli tauri info" +0ms


Operating System - Mac OS, version 11.4.0 X64

Node.js environment
  Node.js - 17.4.0
  @tauri-apps/cli - 1.0.0-beta.10
  @tauri-apps/api - 1.0.0-beta.8

Global packages
  npm - 8.3.1
  yarn - 1.22.17

Rust environment
  rustc - 1.58.1
  cargo - 1.58.0

App directory structure
/dist
/node_modules
/src
/src-tauri

App
  tauri.rs - 1.0.0-beta.8
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  distDir - ../dist
  devPath - http://localhost:3000
  framework - React

✨  Done in 6.17s.

Stack trace

Caused by:
  process didn't exit successfully: `/Volumes/Stripe/Dev/tauri-vite-preact/src-tauri/target/release/build/mac-notification-sys-aa4a861da9a7283c/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("x86_64-apple-darwin")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-apple-darwin")
  CC_x86_64-apple-darwin = None
  CC_x86_64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-apple-darwin = None
  CFLAGS_x86_64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-fmodules" "-o" "/Volumes/Stripe/Dev/tauri-vite-preact/src-tauri/target/release/build/mac-notification-sys-0dc9fbc879457e17/out/objc/notify.o" "-c" "objc/notify.m"
  cargo:warning=While building module 'Foundation' imported from objc/notify.h:1:
  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=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=2 errors generated.
  exit status: 1

  --- stderr


  error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-fmodules" "-o" "/Volumes/Stripe/Dev/tauri-vite-preact/src-tauri/target/release/build/mac-notification-sys-0dc9fbc879457e17/out/objc/notify.o" "-c" "objc/notify.m" with args "cc" did not execute successfully (status code exit status: 1).

Additional context

No response

@FabianLars
Copy link
Member

Possible duplicate of #1150 ?
So i'd appreciate it if you try the solution mentioned here: #1150 (comment)
If it works we'll most likely add it to the FAQ or something.

@gotjoshua
Copy link
Author

gotjoshua commented Jan 31, 2022

try the solution mentioned here: #1150 (comment)

as mentioned in the description, i did try both solutions from that thread but nothing changed

@FabianLars
Copy link
Member

ayy sorry, didn't see that

@lucasfernog
Copy link
Member

Maybe related to h4llow3En/mac-notification-sys#28

@OscarHedeby
Copy link

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

brew install llvm

@lucasfernog
Copy link
Member

Closing this as users can fix this problem by reinstalling the xcode command line tools or upgrading llvm as stated above.

@schickling
Copy link

Closing this as users can fix this problem by reinstalling the xcode command line tools or upgrading llvm as stated above.

This workaround doesn't seem to work when using Nix to install llvm. 🙈

@honlyHuang
Copy link

Im remove CommandLineTools

# Uninstall command line tools
# According to https://developer.apple.com/library/archive/technotes/tn2339/_index.html, 
# we can just remove that:
rm -rf /Library/Developer/CommandLineTools 

# .. and reinstall
xcode-select --install

and

brew install llvm

that no work, I install Xcode App , it work.

@amlcodes
Copy link

amlcodes commented Aug 7, 2024

this worked - h4llow3En/mac-notification-sys#28 (comment)

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

No branches or pull requests

7 participants