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

WIP: Add CD support for Aarch64/ARM64 #653

Closed
wants to merge 1 commit into from

Conversation

jonkerj
Copy link

@jonkerj jonkerj commented Aug 3, 2020

I thought: might as well fix it myself, should not be too hard. I tested the CD myself and spotifyd built succesfully for aarch64. It was a bit fiddly to test, since I am very inexperienced with GitHub actions/workflows. Also, I had not set up tokens, so the actual publication failed. But the rust cross-build worked fine (when not auto cancelled by GH due to time limit).

Closes #280

@mainrs
Copy link
Member

mainrs commented Aug 3, 2020

Thank you very much! I did try it out myself as well but failed miserably :)
Does the timeout happen often? The CD looks very basic (in the way that it would be hard to strip off some runtime).

@jonkerj
Copy link
Author

jonkerj commented Aug 3, 2020

Good question, I was just guessing about the reason of the timeouts, but let me show you what happened:
image

It shows "The operation was cancelled" after 9m44 of building. I am sure I did not click on cancel. I assumed it had something to do with time limits GH puts on actions. I then stripped the cd of everything non-aarch64 (since it's not affected by my PR) and my build passed the "cargo build phase". Could be just random

@jonkerj
Copy link
Author

jonkerj commented Aug 5, 2020

Did some reading: it turns out GH cancels all jobs when one of them fails. Unless you set fail-fast to false in the matrix: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast. @sirwindfield : can you check if that is going on?

@mainrs
Copy link
Member

mainrs commented Aug 5, 2020

Ye sure I can. Might be a good idea to make all the compilation of the binaries fail fast false later on as well

@jonkerj
Copy link
Author

jonkerj commented Aug 5, 2020

In the meanwhile, I'm hunting down the actual reason one of the jobs got cancelled. Until now, the culprit was my tagging/pushing behaviour (did some wrong assumptions) but not the code. But it is still building.

@jonkerj
Copy link
Author

jonkerj commented Aug 5, 2020

My trimmed down CD actually builds, releases and uploads when doing it right:

git tag v0.25.0-test1
git push origin v0.25.0-test1

Grab some coffee, and eventually the release appears. Now rebuilding using the full CD.

@jonkerj
Copy link
Author

jonkerj commented Aug 5, 2020

aarch64 + full breaks with: ld: cannot find -ldbus-1. Will dig further, test and update the PR

@jonkerj jonkerj changed the title Add CD support for Aarch64/ARM64 WIP: Add CD support for Aarch64/ARM64 Aug 5, 2020
@jonkerj
Copy link
Author

jonkerj commented Aug 5, 2020

I got it working, it's quite easy when you look at armhf + full. I'm doing a test run of all combinations. If that works, I'd like to do some additional changes if you like:

  • rename target 'linux' to 'linux-x86_64' (so all naming is consistent)
  • de-duplicate the code setting up the dependencies (by using variables like architecture in the matrix). This will unify the semi-similar steps, making it much easier to add targets later on.
  • have all linux targets use a single version (preferably 20.04, latest LTS), instead of 18.04/-latest (the latter is a moving target)

@sirwindfield : what's your opinion on this?

@mainrs
Copy link
Member

mainrs commented Aug 5, 2020

There is already a PR open that changes the workflow files: #610.

It changes the naming of the binaries and their feature set to be a little bit more useful. The linked issue describes it. I'd love to have this PR follow the naming of them as well. Tl;dr: slim is the minimal features needed to make it work, i.e. only the audio backend IIRC. default contains the additional features that are supported on a platform (like dbus_keyring). And all is just default with all audio backends enabled.

If you would be OK with it, I'd say we wait till the author of the linked PR writes back whether the changed workflow files do build successfully. I am rather limited on time right now. If you want and have time, you could probably fork his fork and see if it builds with a dummy tag. If that is the case, I'ld merge PR #610 and we could continue with this PR afterwards.

Is that OK with you?

The changes proposes are nice and I like them. However, implementing them right now would mean that we have to do two refactors. By merging #610 we just need one :)

@jonkerj
Copy link
Author

jonkerj commented Aug 5, 2020

Sounds great to me, if someone is already putting in the effort, I'll just focus on getting aarch64 to work. My objective is to have spotifyd running on my new board :)

@mainrs
Copy link
Member

mainrs commented Aug 5, 2020

@jonkerj Great! I'll ping you once I know more about the other PR :)

@mainrs
Copy link
Member

mainrs commented Aug 5, 2020

@jonkerj The PR has been merged so go ahead.

@jonkerj
Copy link
Author

jonkerj commented Aug 5, 2020

Excellent, I'll work on it. It might take me a while, since testing is a bit iffy.

@mainrs
Copy link
Member

mainrs commented Aug 5, 2020

No worries about time :) And thanks for tackling this one down :)

@mainrs mainrs mentioned this pull request Aug 5, 2020
@stale
Copy link

stale bot commented Jan 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Issues that will not be fixed under any circumstances label Jan 13, 2021
@stale stale bot closed this Jan 26, 2021
@robinvd
Copy link
Contributor

robinvd commented Jan 26, 2021

@jonkerj should we reopen this PR? as i think we still dont have arm64 CI

@jonkerj
Copy link
Author

jonkerj commented Jan 26, 2021

I have been meaning to revamp the CI code, I have some ideas to unify most of the code (DRY) and make it much easier to build for new platforms. Tricky thing is, I need to put a couple of evenings into it, and the current covid/lockdown/homeschool situation makes it hard for me to sacrifice the little spare time I have left (sorry, I have more hobbys 😄 ).

I promise I will get to it (have to build the recent releases on my aarch64 board anyway). If you would ask me, I would leave this WIP PR open and I'll rebase and amend it. If the maintainers want me to open a new one, it's fine with me.

@jonkerj
Copy link
Author

jonkerj commented Jan 28, 2021

In the meanwhile, I've made some attempts to leverage multiarch to install the required cross-libs:

$ cat build-prep.sh
ARCH="$1" # arm
ABI="$2" # gnueabihf
DEBARCH="$3" # armhf

export DEBIAN_FRONTEND=noninteractive

cat > /etc/apt/sources.list << EOT_NATIVE
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
EOT_NATIVE
cat > /etc/apt/sources.list.d/cross.list << EOT_CROSS
deb [arch=$DEBARCH] http://ports.ubuntu.com/ focal main restricted universe multiverse
deb [arch=$DEBARCH] http://ports.ubuntu.com/ focal-updates main restricted universe multiverse
deb [arch=$DEBARCH] http://ports.ubuntu.com/ focal-security main restricted universe multiverse
EOT_CROSS

dpkg --add-architecture ${DEBARCH}
apt-get update
apt-get install -y -qq \
        gcc-${ARCH}-linux-${ABI} libc6-${DEBARCH}-cross libc6-dev-${DEBARCH}-cross \
        libasound2:${DEBARCH} libasound2-dev:${DEBARCH} libssl-dev libssl1.1:${DEBARCH}

This seems to install the required libs. Still have to fix some errors about libc6 not properly configuring itself. I believe this approach is much cleaner than the almost similar per-arch stanza's in the current CD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix Issues that will not be fixed under any circumstances
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide arm binaries for all platforms.
3 participants