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

add CD support for armv6 and armv7 #479

Merged
merged 4 commits into from
Jan 24, 2020
Merged

Conversation

nicokaiser
Copy link
Contributor

This PR adds a workflow that creates "arm-unknown-linux-gnueabihf" builds for the "slim" and "full" versions with "alsa_backend" using cross compilation.

The resulting packages are called spotifyd-linux-armhf-slim.tar.gz and spotifyd-linux-armhf-full.tar.gz.

As a new package source has to be installed, ubuntu-latest cannot be used here, so the new step uses ubuntu-18.04 (which currently is the same, but we need to be sure).

Instead of a full sbuild setup, the armhf packages are installed and copied manually, which may look dirty. Unfortunately, dbus-rs needs quite some system packages, so we need to download and put them where the linker expects them to be. This process is described here: diwic/dbus-rs#184 (comment)

Issues:

  • I'm not sure if the binaries produced by this run on the Raspberry Pi 1 (or Zero). To be able to run on these, it might be necessary to use the arm-bcm2708 linker from raspberrypi/tools, as stated here: Request: Binaries for ARM / Raspberry Pi BurntSushi/ripgrep#676 (comment)
  • Can someone test the full version? I can build it, but cannot get MPRIS D-Bus running on my machine, which may as well be a client problem: the process refuses to start without $DISPLAY, and when using the system dbus, playerctl acts up and won't display anything. Not sure if I broke this or it did not work at all in the first place. (If I understand it correctly, starting the full version always requires D-Bus? Dbus not avalible when headless #244)

Related: #259, #280, #286

@nicokaiser
Copy link
Contributor Author

The Travis workflow was deactivated anyway, right? So if (?) this works, the .travis.yml could also be removed.

@@ -34,40 +34,87 @@ jobs:
artifact_prefix: linux
audio_backend: alsa
target: x86_64-unknown-linux-gnu
- build_target: linux-armhf
os: ubuntu-18.04
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since "bionic" is needed when adding the Ubuntu Ports source later, this must be hard-coded to ubuntu-18.04.

- name: Packaging final binary
shell: bash
run: |
cd target/${{ matrix.target }}/release

strip spotifyd
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strip will not recognise cross-compiled binaries, so we cannot always use it (and just assume that Rust creates good-enough ones).

@mainrs
Copy link
Member

mainrs commented Jan 22, 2020

Great work! Yes, the current DBUS doesn't work in headless for most cases. I've tried the same with ubuntu-16.04 but I didn't get it to work :)

I'm not sure if the binaries produced by this run on the Raspberry Pi 1 (or Zero). To be able to run on these, it might be necessary to use the arm-bcm2708

I think I've posted this somewhere in one of our issues so I don't forget this. That is the case, yes. The binary you created should be armv7 iirc. If you have the time, could you try to run it in a qemu armv6 emulator and see if it loads? Because I am actually not sure what target armhf exactly targets.

THis could be expanded to support aarch64 as well as most dependencies should be available there as well. The tricky part is to find a working mirror that provides those files for us. That was the main issue I faced with my try.

@mainrs
Copy link
Member

mainrs commented Jan 22, 2020

Would it be possible to extend this for armv6 as well @nicokaiser?
Relevant (maybe): #259 (comment)

@mainrs
Copy link
Member

mainrs commented Jan 23, 2020

@nicokaiser could you trigger a new release on your fork and see if the workflow works correctly? This can be done by creating and pushing a new tag to the master branch.

@nicokaiser
Copy link
Contributor Author

Okay the linux-armhf version does not work on the Raspberry Pi Zero (and thus, neither on the Pi 1).

I managed to add a build for armv6 using the Raspberry Pi toolchain, however due to the very old gcc version (gcc-4.9.3 from 2015) and its libc-2.19 the full version will not compile, as systemd requires a newer libc.

There are other repositories with updated toolchains (such as Pro/raspi-toolchain), however I think the slim version will be enough for the most usecases of spotifyd on a Raspberry Pi 1/Zero, so I'll just exclude the full version for the linux-armv6 builds.

@mainrs
Copy link
Member

mainrs commented Jan 23, 2020

Awesome! Thank you very much! I will merge it once you added the armv6 chain. If the builds work as expected we can remove Travis altogether.

@mainrs
Copy link
Member

mainrs commented Jan 24, 2020

I forked your repo and ran a test. All binaries sucessfully built and were deployed.

Thank you very very much! You did an awesome job here! Really appreciated!

@mainrs mainrs changed the title Add armhf workflow to produce ARMv7 (maybe ARMv6?) binaries add CD support for armv6 and armv7 Jan 24, 2020
@mainrs mainrs merged commit 295ad9c into Spotifyd:master Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants