SoundcoreManager icon indicating copy to clipboard operation
SoundcoreManager copied to clipboard

It didn't build on mac os

Open rixtrayker opened this issue 2 years ago • 2 comments

Here is the log

yarn run v1.22.19 $ tauri build Running beforeBuildCommand yarn build $ tsc && vite build vite v3.2.5 building for production... ✓ 1105 modules transformed. dist/assets/a3027_img_device.e0d85385.webp 33.06 KiB dist/assets/a3028_img_device.cdafd53d.webp 45.58 KiB dist/assets/a3029_img_device.56d22a6c.webp 37.58 KiB dist/assets/a3951_img_device_left.4d0d7088.webp 8.36 KiB dist/assets/a3951_img_device_right_edited.0c3d60b2.webp 8.51 KiB dist/assets/a3040_img_device.877189fe.webp 14.88 KiB dist/assets/a3935_img_device.a77ed0ac.webp 18.83 KiB dist/index.html 0.39 KiB dist/assets/index.95be6cc2.js 570.16 KiB / gzip: 185.16 KiB

(!) Some chunks are larger than 500 KiB after minification. Consider:

  • Using dynamic import() to code-split the application

  • Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks

  • Adjust chunk size limit for this warning via build.chunkSizeWarningLimit. warning: unused import: PathBuf --> build.rs:3:18 | 3 | path::{Path, PathBuf}, | ^^^^^^^ | = note: #[warn(unused_imports)] on by default

    Compiling bluetooth-lib v0.1.0 (/Users/amr/tools/SoundcoreManager/bluetooth-lib) warning: soundcoremanager (build script) generated 1 warning Compiling soundcoremanager v0.1.1 (/Users/amr/tools/SoundcoreManager/src-tauri) error[E0433]: failed to resolve: use of undeclared crate or module windows --> /Users/amr/tools/SoundcoreManager/bluetooth-lib/src/error.rs:27:17 | 27 | source: windows::core::Error, | ^^^^^^^ use of undeclared crate or module windows

warning: unused imports: RefCell, Ref, sync::Arc --> /Users/amr/tools/SoundcoreManager/bluetooth-lib/src/macos/rfcomm.rs:3:12 | 3 | cell::{Ref, RefCell}, | ^^^ ^^^^^^^ 4 | sync::Arc, | ^^^^^^^^^ | = note: #[warn(unused_imports)] on by default

warning: unused imports: Handle, Runtime --> /Users/amr/tools/SoundcoreManager/bluetooth-lib/src/macos/rfcomm.rs:6:22 | 6 | use tokio::runtime::{Handle, Runtime}; | ^^^^^^ ^^^^^^^

For more information about this error, try rustc --explain E0433. warning: bluetooth-lib (lib) generated 2 warnings error: could not compile bluetooth-lib due to previous error; 2 warnings emitted warning: build failed, waiting for other jobs to finish... error: failed to run custom build command for soundcoremanager v0.1.1 (/Users/amr/tools/SoundcoreManager/src-tauri)

Caused by: process didn't exit successfully: /Users/amr/tools/SoundcoreManager/src-tauri/target/release/build/soundcoremanager-7d8a811d0b5bc1b5/build-script-build (exit status: 101) --- stderr Compiling iobluetooth v0.1.0 (/Users/amr/tools/SoundcoreManager/bluetooth-lib/iobluetooth) warning: unused import: objc::runtime::Object --> src/server.rs:3:5 | 3 | use objc::runtime::Object; | ^^^^^^^^^^^^^^^^^^^^^ | = note: #[warn(unused_imports)] on by default

warning: unused import: Instant --> src/inquiry_adapter.rs:3:22 | 3 | time::{Duration, Instant}, | ^^^^^^^

warning: unused imports: NSDate, NSRunLoop --> src/inquiry_adapter.rs:10:18 | 10 | foundation::{NSDate, NSRunLoop}, | ^^^^^^ ^^^^^^^^^

warning: unused imports: Boolean, CFRunLoopGetCurrent, CFRunLoopRunInMode, CFRunLoopRun, CFRunLoopStop, CFStringCreateWithBytesNoCopy, CFStringRef, CFString, kCFAllocatorDefault, kCFAllocatorNull, kCFStringEncodingUTF8 --> src/inquiry_adapter.rs:13:12 | 13 | base::{kCFAllocatorDefault, kCFAllocatorNull, Boolean}, | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^ 14 | mach_port::CFIndex, 15 | runloop::{CFRunLoopGetCurrent, CFRunLoopRun, CFRunLoopRunInMode, CFRunLoopStop}, | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ 16 | string::{kCFStringEncodingUTF8, CFString, CFStringCreateWithBytesNoCopy, CFStringRef}, | ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^

warning: unused imports: Class, Object --> src/inquiry_adapter.rs:22:15 | 22 | runtime::{Class, Object}, | ^^^^^ ^^^^^^

warning: unused imports: Receiver, Sender, self --> src/inquiry_delegate.rs:2:30 | 2 | use futures::channel::mpsc::{self, Receiver, Sender}; | ^^^^ ^^^^^^^^ ^^^^^^

warning: unused import: futures::sink::SinkExt --> src/inquiry_delegate.rs:3:5 | 3 | use futures::sink::SinkExt; | ^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: uint32_t, uint8_t --> src/iobluetoothdevice.rs:4:12 | 4 | use libc::{uint32_t, uint8_t, KERN_SUCCESS}; | ^^^^^^^^ ^^^^^^^

warning: unused import: rc::StrongPtr --> src/iobluetoothdevice.rs:7:5 | 7 | rc::StrongPtr, | ^^^^^^^^^^^^^

warning: unused import: IOBluetoothRFCOMMChannel --> src/iobluetoothdevice.rs:12:37 | 12 | use crate::util::{string_to_string, IOBluetoothRFCOMMChannel, IOReturn}; | ^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: BufRead, BufReader, Read, TcpListener, TcpStream, Write --> src/rfcomm_delegate.rs:2:10 | 2 | io::{BufRead, BufReader, Read, Write}, | ^^^^^^^ ^^^^^^^^^ ^^^^ ^^^^^ 3 | net::{TcpListener, TcpStream}, | ^^^^^^^^^^^ ^^^^^^^^^

warning: unused import: Protocol --> src/rfcomm_delegate.rs:13:30 | 13 | runtime::{Class, Object, Protocol, Sel}, | ^^^^^^^^

warning: unused import: crate::util::IOBluetoothRFCOMMChannel --> src/rfcomm_delegate.rs:17:5 | 17 | use crate::util::IOBluetoothRFCOMMChannel; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: NSData --> src/util.rs:5:18 | 5 | foundation::{NSData, NSString}, | ^^^^^^

warning: use of deprecated type alias libc::uint32_t: Use u32 instead. --> src/iobluetoothdevice.rs:4:12 | 4 | use libc::{uint32_t, uint8_t, KERN_SUCCESS}; | ^^^^^^^^ | = note: #[warn(deprecated)] on by default

warning: use of deprecated type alias libc::uint8_t: Use u8 instead. --> src/iobluetoothdevice.rs:4:22 | 4 | use libc::{uint32_t, uint8_t, KERN_SUCCESS}; | ^^^^^^^

error[E0308]: mismatched types --> src/iobluetoothdevice.rs:84:13 | 81 | pub fn is_paired(&self) -> bool { | ---- expected bool because of return type ... 84 | is_paired | ^^^^^^^^^ expected bool, found i8

Expected type did not match the received type.

Erroneous code examples:

fn plus_one(x: i32) -> i32 {
    x + 1
}

plus_one("Not a number");
//       ^^^^^^^^^^^^^^ expected `i32`, found `&str`

if "Not a bool" {
// ^^^^^^^^^^^^ expected `bool`, found `&str`
}

let x: f32 = "Not a float";
//     ---   ^^^^^^^^^^^^^ expected `f32`, found `&str`
//     |
//     expected due to this

This error occurs when an expression was used in a place where the compiler expected an expression of a different type. It can occur in several cases, the most common being when calling a function and passing an argument which has a different type than the matching type in the function declaration. ...skipping... error[E0308]: mismatched types --> src/iobluetoothdevice.rs:91:13 | 88 | pub fn is_connected(&self) -> bool { | ---- expected bool because of return type ... 91 | is_connected | ^^^^^^^^^^^^ expected bool, found i8

error[E0308]: mismatched types --> src/util.rs:146:13 | 143 | pub fn is_open(&self) -> bool { | ---- expected bool because of return type ... 146 | is_open | ^^^^^^^ expected bool, found i8

For more information about this error, try rustc --explain E0308. warning: iobluetooth (bin "soundcoremanager-iobtserver") generated 16 warnings error: could not compile iobluetooth due to 3 previous errors; 16 warnings emitted thread 'main' panicked at 'Failed to build iobluetooth server!', build.rs:49:9 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Error failed to build app: failed to build app error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

rixtrayker avatar May 21 '23 13:05 rixtrayker

Will look into this as this seems not a lot to fix but macOS is a very experimental platform and I can't promise it will work reliably.

gmallios avatar May 21 '23 15:05 gmallios

Check out the macos-fixes branch and test it out. In case you connect and the app keeps loading, close the app -> disconnect from the device -> open app and connect (tick should not appear). This is a weird bug I wasn't able to fix when implementing the macOS backend.

gmallios avatar May 21 '23 17:05 gmallios