lyledean1 / flutter_whisper.cpp

Flutter App That Can Transcribe Audio Offline/On Device with Whisper C++ Bindings via Rust
MIT License
102 stars 10 forks source link

Macos m1 chip build issue #4

Open jungsu0717 opened 1 year ago

jungsu0717 commented 1 year ago

Hi. Thanks for sharing your great project. While testing your code, I found that I can debug it on macos with m1 chip but have issues with build.

Command: flutter build macos -v

Here is an excerpt from the error log

[  +14 ms] ProcessInfoPlistFile /Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/build/macos/Build/Products/Release/Pods_Runner.framework/Versions/A/Resources/Info.plist
/Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/macos/Pods/Target\ Support\ Files/Pods-Runner/Pods-Runner-Info.plist (in target 'Pods-Runner' from project 'Pods')
[        ]     cd /Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/macos/Pods
[        ]     builtin-infoPlistUtility /Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/macos/Pods/Target\ Support\ Files/Pods-Runner/Pods-Runner-Info.plist -producttype
com.apple.product-type.framework -expandbuildsettings -platform macosx -o
/Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/build/macos/Build/Products/Release/Pods_Runner.framework/Versions/A/Resources/Info.plist
[        ] note: Run script build phase 'Run Script' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner'
from project 'Runner')
[   +1 ms] warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the
script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner')
[        ] ** BUILD FAILED **
[        ] The following build commands failed:
[        ]      RuleScriptExecution
/Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/build/macos/Build/Intermediates.noindex/rs_whisper_gpt.build/Release/rs_whisper_gpt-cdylib.build/Objects/x86_64-rs_whisper_gpt.dyli
b
/Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/build/macos/Build/Intermediates.noindex/rs_whisper_gpt.build/Release/rs_whisper_gpt-cdylib.build/DerivedSources/x86_64-rs_whisper_g
pt.dylib.d /Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/rs_whisper_gpt/Cargo.toml normal x86_64 (in target 'rs_whisper_gpt-cdylib' from project 'rs_whisper_gpt')
[        ]      RuleScriptExecution
/Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/build/macos/Build/Intermediates.noindex/rs_whisper_gpt.build/Release/rs_whisper_gpt-cdylib.build/Objects/aarch64-rs_whisper_gpt.dyl
ib
/Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/build/macos/Build/Intermediates.noindex/rs_whisper_gpt.build/Release/rs_whisper_gpt-cdylib.build/DerivedSources/aarch64-rs_whisper_
gpt.dylib.d /Users/yunjeongsu/Documents/sampleProject/flutter_whisper.cpp/rs_whisper_gpt/Cargo.toml normal arm64 (in target 'rs_whisper_gpt-cdylib' from project 'rs_whisper_gpt')
[        ] (2 failures)
[  +10 ms] Building macOS application... (completed in 2,357ms)
[        ] "flutter macos" took 3,643ms.
[   +2 ms] Build process failed
[        ] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      buildMacOS (package:flutter_tools/src/macos/build_macos.dart:141:5)
           <asynchronous suspension>
           #2      BuildMacosCommand.runCommand (package:flutter_tools/src/commands/build_macos.dart:62:5)
           <asynchronous suspension>
           #3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1323:27)
           <asynchronous suspension>
           #4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #5      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
           <asynchronous suspension>
           #6      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:348:9)
           <asynchronous suspension>
           #7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #8      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5)
           <asynchronous suspension>
           #9      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:113:9)
           <asynchronous suspension>
           #10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #11     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>

[  +73 ms] ensureAnalyticsSent: 71ms
[        ] Running 0 shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 1

If you know of a workaround, could you please share it? πŸ₯ΊπŸ˜­

lyledean1 commented 1 year ago

Thanks for the feedback - glad you are finding it useful! πŸ™‡β€β™‚οΈ

I had a quick check and realised I never ran it in release mode, so works fine for me in debug but throws the same error you have when in release. When I get some time I'll try to take a deeper dive into this to figure out what i've missed.

jungsu0717 commented 1 year ago

Thank you for your reply. I'm still trying to troubleshoot the issue, so I'll keep checking. πŸš€