spotifyd icon indicating copy to clipboard operation
spotifyd copied to clipboard

spotifyd cannot build on apple silicon

Open chenrui333 opened this issue 4 years ago • 9 comments

Description spotifyd 0.2.25 cannot build on apple silicon

To Reproduce

build error log
The following warnings were emitted during compilation:

warning: error: unknown target triple 'unknown-apple-macosx11.0.0', please use -triple or -arch

error: failed to run custom build command for `libloading v0.5.2`

Caused by:
  process didn't exit successfully: `/private/tmp/spotifyd-20210113-96344-16ci8n/spotifyd-0.2.25/target/release/build/libloading-862fb4bd13cccf19/build-script-build` (exit code: 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 = Some("clang")
  CFLAGS_aarch64-apple-darwin = None
  CFLAGS_aarch64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  running: "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-apple-darwin" "-Wall" "-Wextra" "-o" "/private/tmp/spotifyd-20210113-96344-16ci8n/spotifyd-0.2.25/target/release/build/libloading-35258640a09c9dc2/out/src/os/unix/global_static.o" "-c" "src/os/unix/global_static.c"
  cargo:warning=error: unknown target triple 'unknown-apple-macosx11.0.0', please use -triple or -arch
  exit code: 1

  --- stderr


  error occurred: Command "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-apple-darwin" "-Wall" "-Wextra" "-o" "/private/tmp/spotifyd-20210113-96344-16ci8n/spotifyd-0.2.25/target/release/build/libloading-35258640a09c9dc2/out/src/os/unix/global_static.o" "-c" "src/os/unix/global_static.c" with args "clang" did not execute successfully (status code exit code: 1).


warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: error: unknown target triple 'unknown-apple-macosx11.0.0', please use -triple or -arch

The following warnings were emitted during compilation:

warning: error: unknown target triple 'unknown-apple-macosx11.0.0', please use -triple or -arch

error: failed to compile `spotifyd v0.2.25 (/private/tmp/spotifyd-20210113-96344-16ci8n/spotifyd-0.2.25)`, intermediate artifacts can be found at `/private/tmp/spotifyd-20210113-96344-16ci8n/spotifyd-0.2.25/target`

Expected behavior build passed

Logs

Click to show logs

Compilation flags

  • [ ] dbus_mpris
  • [ ] dbus_keyring
  • [x] alsa_backend
  • [ ] portaudio_backend
  • [ ] pulseaudio_backend
  • [ ] rodio_backend

Versions (please complete the following information):

  • OS: darwin_arm64
  • Spotifyd:0.2.25
  • cargo: 0.50.0

relates to https://github.com/Homebrew/homebrew-core/pull/68938

chenrui333 avatar Jan 13 '21 18:01 chenrui333

This seems like a different error, but this but this user did manage to compile it om m1 https://github.com/Spotifyd/spotifyd/issues/749

robinvd avatar Jan 13 '21 20:01 robinvd

anyone on the maintainer team have an M1 mac to test with?

slondr avatar Jan 16 '21 06:01 slondr

Maybe we can find a vps that has apple silicon to test on

robinvd avatar Jan 21 '21 11:01 robinvd

@robinvd I'm not on the maintainer team, but I do have an M1 mac mini and a willingness to help out. Is there anything I can do to help work towards an official M1 build?

AriYoung00 avatar Feb 20 '21 01:02 AriYoung00

I think trying to build it and reporting back the required steps would be a great help. Then we can fix it on a1 or document it in the readme

robinvd avatar Feb 20 '21 09:02 robinvd

I agree. Even if you can't get it to build on your own, even just showing us what goes wrong would do a lot

slondr avatar Feb 20 '21 18:02 slondr

I was able to get it to build with the rodio backend and default features disabled (as mentioned in #749), but I had to unpin the rust version from 1.47, since aarch64-apple-darwin is only supported as a target from rust 1.48 onward. I then ran into the panic mentioned in #719; to solve this, I disabled the "with-tremor" feature in the librespot dependency, and everything seems to be working fine since then (edit: built with rust 1.50).

AriYoung00 avatar Feb 20 '21 22:02 AriYoung00

Thats good to hear! Then we know what to fix/add

robinvd avatar Feb 21 '21 12:02 robinvd

I was also able to get it to build after some tinkering. I didn't have to change the rust version. As mentioned in #749 I compiled it with the --no-default-features and --features=portaudio flags but also added the dbus_keyring feature flag. I didn't encounter the error DarthGeek01 mentioned; I did see a panic from a portaudio error that is mentioned in this thread on their repo. I was able to resolve the panic and get it working fine by compiling it from source - presumably that will soon be resolved by a new release on their part. Hopefully that information is of some help.

vidurb avatar Mar 10 '21 15:03 vidurb

Just got it running on my M1 Macbook Silicon. Made a gist that might be helpful.

https://gist.github.com/acberk/77c0bd68009ac7eb94d561e6a31570ae

alexcberk avatar Dec 15 '22 21:12 alexcberk

Thank you! That looks like there's nothing really complicated about the installation process on M1 anymore. (Just using the correct feature flags seems to do the trick.) Should we close this or am I overlooking something?

eladyn avatar Dec 15 '22 23:12 eladyn

Should be fine to close. Just posting the steps for the next person.


From: eladyn @.> Sent: Thursday, December 15, 2022 3:31:30 PM To: Spotifyd/spotifyd @.> Cc: Alex Berk @.>; Comment @.> Subject: Re: [Spotifyd/spotifyd] spotifyd cannot build on apple silicon (#768)

Thank you! That looks like there's nothing really complicated about the installation process on M1 anymore. (Just using the correct feature flags seems to do the trick.) Should we close this or am I overseeing something?

— Reply to this email directly, view it on GitHubhttps://github.com/Spotifyd/spotifyd/issues/768#issuecomment-1353853599, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABWELIAMJEZOFDDRQB6WLWDWNOS5FANCNFSM4WBHK4YA. You are receiving this because you commented.Message ID: @.***>

alexcberk avatar Dec 15 '22 23:12 alexcberk