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

spotifyd cannot build on apple silicon #768

Closed
1 of 6 tasks
chenrui333 opened this issue Jan 13, 2021 · 12 comments
Closed
1 of 6 tasks

spotifyd cannot build on apple silicon #768

chenrui333 opened this issue Jan 13, 2021 · 12 comments
Labels
bug A functionality or parts of a program that do not work as intended pinned Apply to make stale bot ignore issue/PR.
Milestone

Comments

@chenrui333
Copy link

chenrui333 commented Jan 13, 2021

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
  • 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 Homebrew/homebrew-core#68938

@chenrui333 chenrui333 added the bug A functionality or parts of a program that do not work as intended label Jan 13, 2021
@robinvd
Copy link
Contributor

robinvd commented Jan 13, 2021

This seems like a different error, but this but this user did manage to compile it om m1 #749

@slondr slondr added this to the v0.3.1 milestone Jan 16, 2021
@slondr
Copy link
Member

slondr commented Jan 16, 2021

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

@slondr slondr changed the title spotifyd 0.2.25 cannot build on apple silicon spotifyd cannot build on apple silicon Jan 17, 2021
@robinvd
Copy link
Contributor

robinvd commented Jan 21, 2021

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

@slondr slondr added the pinned Apply to make stale bot ignore issue/PR. label Jan 22, 2021
@AriYoung00
Copy link

@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?

@robinvd
Copy link
Contributor

robinvd commented Feb 20, 2021

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

@slondr
Copy link
Member

slondr commented Feb 20, 2021

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

@AriYoung00
Copy link

AriYoung00 commented Feb 20, 2021

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).

@robinvd
Copy link
Contributor

robinvd commented Feb 21, 2021

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

@vidurb
Copy link

vidurb commented Mar 10, 2021

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.

@alexcberk
Copy link

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

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

@eladyn
Copy link
Member

eladyn commented Dec 15, 2022

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?

@alexcberk
Copy link

alexcberk commented Dec 15, 2022 via email

@eladyn eladyn closed this as completed Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A functionality or parts of a program that do not work as intended pinned Apply to make stale bot ignore issue/PR.
Projects
None yet
Development

No branches or pull requests

7 participants