Skip to content

Support cross-building for 32-bit arm #92

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

Closed
wants to merge 1 commit into from
Closed

Support cross-building for 32-bit arm #92

wants to merge 1 commit into from

Conversation

qmfrederik
Copy link
Contributor

As a follow-up to #91, this adds support for cross-building for 32-bit arm.

.NET Core 2.1, 2.2 and 3.0 support/will support 32-bit arm on Ubuntu 16.04, Ubuntu 18.04, Ubuntu 18.10 and Debian 9:

This keeps the RID graph rather limited, so this PR includes cross-builds for all these distros individually.

As for the dependencies, Ubuntu 18.04 and Ubuntu 18.10 end up with the same dependencies. Debian 9 has very similar dependencies, with the difference of ld-lnux-armhf.so.3 not being required:

$ readelf -d nuget.package/runtimes/ubuntu.16.04-arm/native/libgit2-.so 

Dynamic section at offset 0xb2ef0 contains 30 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libssl.so.1.0.0]
 0x00000001 (NEEDED)                     Shared library: [libcrypto.so.1.0.0]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [ld-linux-armhf.so.3]
$ readelf -d nuget.package/runtimes/ubuntu.18.04-arm/native/libgit2-.so 

Dynamic section at offset 0xb6ef0 contains 30 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libssl.so.1.1]
 0x00000001 (NEEDED)                     Shared library: [libcrypto.so.1.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [ld-linux-armhf.so.3]
$ readelf -d nuget.package/runtimes/ubuntu.18.10-arm/native/libgit2-.so 

Dynamic section at offset 0xa7ef0 contains 30 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libssl.so.1.1]
 0x00000001 (NEEDED)                     Shared library: [libcrypto.so.1.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [ld-linux-armhf.so.3]
$readelf -d nuget.package/runtimes/debian.9-arm/native/libgit2-.so 

Dynamic section at offset 0xacef8 contains 29 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libssl.so.1.1]
 0x00000001 (NEEDED)                     Shared library: [libcrypto.so.1.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

@qmfrederik
Copy link
Contributor Author

I guess you could try to use the Debian 9 build for the linux-arm RID, and that file would be used for Debian 9, Ubuntu 18.04 and Ubuntu 18.10. They should all satisfy the declared dependencies.

@bording
Copy link
Member

bording commented Apr 3, 2019

Looking at the current RID graph, I'm currently thinking that providing a linux-arm binary might be opening us up to too many unverified scenarios, but maybe ubuntu.16.04-arm and debian-arm (with the debian 9 binary being used for that) would work.

However, before doing that, we should verify that the debian 9 binary would actually work properly on Ubuntu.

@qmfrederik
Copy link
Contributor Author

I have ARM hardware so I can run some tests. Ideally I'd run them in a CI system (e.g. Drone CI) so they outcome is documented and reproducible.

How do you want to test this? Is there a test suite from libgit2sharp I can run with the ARM binaries that should pass?

@bording
Copy link
Member

bording commented Apr 9, 2019

How do you want to test this? Is there a test suite from libgit2sharp I can run with the ARM binaries that should pass?

Yes, running the LibGit2Sharp tests would be perfect. The primary thing I want to test before we merge this PR would be that if we shipped debian-arm and ubuntu.16.04-arm that the binaries would actually work for full set of OSes.

The easiest way to accomplish that might be to build a pre-release version of the nativebinaries package and then reference that from LibGit2Sharp.

@bording
Copy link
Member

bording commented May 5, 2019

@qmfrederik Let's make the same changes here as we did for the ARM64 PR.

@qmfrederik
Copy link
Contributor Author

@bording Sure, I updated the PR and squashed the commits. I'll monitor CI; let me know if there's anything else you need from me.

Thanks for your patience!

@qmfrederik
Copy link
Contributor Author

@bording Gentle ping, do you think this PR is ready to be merged?

@bording
Copy link
Member

bording commented Apr 5, 2020

@qmfrederik After an extreme delay, it looks like some progress is finally being made again, so I've incorporated the changes here into #96.

The goal is to be able to provide a single binary per architecture now that it seems achievable to remove OpenSSL as a requirement, so I'm moved to just using the debian-based image for arm/arm64,

We'll have to see if that works, and if not tweak things as we go.

@bording
Copy link
Member

bording commented Apr 5, 2020

#96 is merged, so this is in master now.

@bording bording closed this Apr 5, 2020
@qmfrederik
Copy link
Contributor Author

Thanks @bording. Here's to cross-platform, cross-distro libgit2 on Linux!

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