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

GitHub Action to Build libsignal for x86-64, arm64, and armv7 #47

Merged
merged 5 commits into from
Oct 10, 2022
Merged

GitHub Action to Build libsignal for x86-64, arm64, and armv7 #47

merged 5 commits into from
Oct 10, 2022

Conversation

tholland15
Copy link
Contributor

After a lot of trial and error I finally got all of this working. This is an action triggered on workflow_dispatch so it only runs when requested. Editing LIBSIGNAL_VERSION will download and compile that version for all 3 architectures.

x86_64
Nothing special here, this is compiled normally using cargo and the resulting binary is copied to the repo and committed.

arm64 & armv7
Both of these are compiled natively under their respective architectures using qemu virtualization. This avoids the cross compiling issues that this project and others were previously facing while trying to cross compile libsignal for various arm architectures. Note that in these jobs the sources of dependencies are downloaded and vendored ahead of time before we jump into qemu virtualization for two reasons:

  1. This is much more performant, as resolving and downloading dependencies and updating the cargo indexes is much faster outside of virtualization.
  2. Qemu has a bug when virtualizing 32-bit architectures on 64-bit hosts that prevents cargo from downloading any dependencies. Therefore it is impossible to simply do cargo build while virtualizing armv7.

Therefore we use cargo vendor to resolve and download all of the dependencies into the source directory before jumping into virtualization to install rust and do the compiling itself in cargo's offline mode. Finally, we copy the resulting binary and commit it.

@tholland15 tholland15 marked this pull request as ready for review October 10, 2022 15:11
@tholland15
Copy link
Contributor Author

I've been debugging some minor issues and I now expect this PR to be updated shortly with the binaries for arm64 and armv7 once the github action I'm currently running completes (About 90 minutes from now).

@MichaelBitard MichaelBitard merged commit 6b9c40f into agileek:master Oct 10, 2022
@MichaelBitard
Copy link
Collaborator

I think I've merged your PR too fast but that's ok, I have to disable signed commits and it should pass.

@tholland15
Copy link
Contributor Author

Yes it's still failing as I'm sure you saw with:

  POST git-receive-pack (chunked)
  remote: error: GH006: Protected branch update failed for refs/heads/master.        
  remote: error: 5 of 5 required status checks are expected.        
  error: failed to push some refs to 'https://github.com/agileek/hassio-addons'

Would it be better for me to make it open a PR with the new binaries on a build instead of trying to commit them directly to master? That's an easy change.

@tholland15
Copy link
Contributor Author

Just opened a new draft PR #49 that does a pull request when the binaries are built instead of trying to commit directly to master. I'm running it locally to ensure the PR is created as expected.

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.

None yet

2 participants