From d5926f08a27f558098e9d6d7b6a7c5810fd624ab Mon Sep 17 00:00:00 2001 From: David Christensen Date: Thu, 31 Oct 2024 16:20:33 -0400 Subject: [PATCH 1/2] Add ppc64le support Signed-off-by: David Christensen --- .github/workflows/ci.yml | 4 ++++ Dockerfile.linux | 5 +++-- Dockerfile.linux-musl | 2 +- README.md | 2 +- UpdateLibgit2ToSha.ps1 | 1 + dockerbuild.sh | 11 ++++++++++- nuget.package/libgit2/LibGit2Sharp.dll.config | 1 + 7 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc6de30a..72382304 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,10 @@ jobs: name: linux-musl-arm64 - os: ubuntu-24.04 name: linux-arm + - os: ubuntu-24.04 + name: linux-ppc64le + - os: ubuntu-24.04 + name: linux-musl-ppc64le - os: macos-13 name: osx-x64 - os: macos-13 diff --git a/Dockerfile.linux b/Dockerfile.linux index 4421da3d..7bf83726 100644 --- a/Dockerfile.linux +++ b/Dockerfile.linux @@ -1,9 +1,10 @@ FROM bording/crossbuild ARG ARCH='amd64' -ENV CROSS_TRIPLE=${ARCH} +ARG CC_ARCH='amd64' +ENV CROSS_TRIPLE=${CC_ARCH} RUN apt update && apt -y install pkg-config WORKDIR /nativebinaries COPY . /nativebinaries/ -CMD ["/bin/bash", "-c", "./build.libgit2.sh"] \ No newline at end of file +CMD ["/bin/bash", "-c", "./build.libgit2.sh"] diff --git a/Dockerfile.linux-musl b/Dockerfile.linux-musl index 1cfa1e4e..76341f81 100644 --- a/Dockerfile.linux-musl +++ b/Dockerfile.linux-musl @@ -5,4 +5,4 @@ RUN apk add --no-cache bash build-base cmake WORKDIR /nativebinaries COPY . /nativebinaries/ -CMD ["/bin/bash", "-c", "./build.libgit2.sh"] \ No newline at end of file +CMD ["/bin/bash", "-c", "./build.libgit2.sh"] diff --git a/README.md b/README.md index 053524de..313b85a1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ the following platforms: - Windows (x86, x64, arm64) - macOS (x64, arm64) - - Linux (x64, arm, arm64) for both musl and glibc + - Linux (x64, arm, arm64, ppc64le) for both musl and glibc [lg2s-nb]: https://www.nuget.org/packages/LibGit2Sharp.NativeBinaries [lg2]: https://libgit2.github.com/ diff --git a/UpdateLibgit2ToSha.ps1 b/UpdateLibgit2ToSha.ps1 index 3f37e9fd..a3111d3d 100644 --- a/UpdateLibgit2ToSha.ps1 +++ b/UpdateLibgit2ToSha.ps1 @@ -123,6 +123,7 @@ Push-Location $libgit2Directory + diff --git a/dockerbuild.sh b/dockerbuild.sh index 489ba499..90373ccc 100755 --- a/dockerbuild.sh +++ b/dockerbuild.sh @@ -5,10 +5,19 @@ echo "building for $RID" if [[ $RID =~ arm64 ]]; then arch="arm64" + cc_arch="arm64" elif [[ $RID =~ arm ]]; then arch="armhf" + cc_arch="armhf" +elif [[ $RID == linux-ppc64le ]]; then + arch="ppc64le" + cc_arch="powerpc64le" +elif [[ $RID == linux-musl-ppc64le ]]; then + arch="ppc64le" + cc_arch="ppc64le" else arch="amd64" + cc_arch="amd64" fi if [[ $RID == linux-musl* ]]; then @@ -17,7 +26,7 @@ else dockerfile="Dockerfile.linux" fi -docker buildx build -t $RID -f $dockerfile --build-arg ARCH=$arch . +docker buildx build -t $RID -f $dockerfile --build-arg ARCH=$arch --build-arg CC_ARCH=$cc_arch . docker run -t -e RID=$RID --name=$RID $RID diff --git a/nuget.package/libgit2/LibGit2Sharp.dll.config b/nuget.package/libgit2/LibGit2Sharp.dll.config index 81ed6243..31c8e42b 100644 --- a/nuget.package/libgit2/LibGit2Sharp.dll.config +++ b/nuget.package/libgit2/LibGit2Sharp.dll.config @@ -2,6 +2,7 @@ + From 16f0470339ffedc6d20f3b89f2101d33fe17a69e Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 23 Nov 2024 13:17:45 -0500 Subject: [PATCH 2/2] Tweaks --- .github/workflows/ci.yml | 2 -- Dockerfile.linux | 5 ++--- Dockerfile.linux-musl | 2 +- README.md | 4 +++- dockerbuild.sh | 13 +++---------- 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72382304..48ee9ae8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,8 +39,6 @@ jobs: name: linux-arm - os: ubuntu-24.04 name: linux-ppc64le - - os: ubuntu-24.04 - name: linux-musl-ppc64le - os: macos-13 name: osx-x64 - os: macos-13 diff --git a/Dockerfile.linux b/Dockerfile.linux index 7bf83726..4421da3d 100644 --- a/Dockerfile.linux +++ b/Dockerfile.linux @@ -1,10 +1,9 @@ FROM bording/crossbuild ARG ARCH='amd64' -ARG CC_ARCH='amd64' -ENV CROSS_TRIPLE=${CC_ARCH} +ENV CROSS_TRIPLE=${ARCH} RUN apt update && apt -y install pkg-config WORKDIR /nativebinaries COPY . /nativebinaries/ -CMD ["/bin/bash", "-c", "./build.libgit2.sh"] +CMD ["/bin/bash", "-c", "./build.libgit2.sh"] \ No newline at end of file diff --git a/Dockerfile.linux-musl b/Dockerfile.linux-musl index 76341f81..1cfa1e4e 100644 --- a/Dockerfile.linux-musl +++ b/Dockerfile.linux-musl @@ -5,4 +5,4 @@ RUN apk add --no-cache bash build-base cmake WORKDIR /nativebinaries COPY . /nativebinaries/ -CMD ["/bin/bash", "-c", "./build.libgit2.sh"] +CMD ["/bin/bash", "-c", "./build.libgit2.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 313b85a1..a6f68879 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,9 @@ the following platforms: - Windows (x86, x64, arm64) - macOS (x64, arm64) - - Linux (x64, arm, arm64, ppc64le) for both musl and glibc + - Linux + - glibc: (x64, arm, arm64, ppc64le) + - musl: (x64, arm, arm64) [lg2s-nb]: https://www.nuget.org/packages/LibGit2Sharp.NativeBinaries [lg2]: https://libgit2.github.com/ diff --git a/dockerbuild.sh b/dockerbuild.sh index 90373ccc..4ee5a0a2 100755 --- a/dockerbuild.sh +++ b/dockerbuild.sh @@ -5,19 +5,12 @@ echo "building for $RID" if [[ $RID =~ arm64 ]]; then arch="arm64" - cc_arch="arm64" elif [[ $RID =~ arm ]]; then arch="armhf" - cc_arch="armhf" -elif [[ $RID == linux-ppc64le ]]; then - arch="ppc64le" - cc_arch="powerpc64le" -elif [[ $RID == linux-musl-ppc64le ]]; then - arch="ppc64le" - cc_arch="ppc64le" +elif [[ $RID =~ ppc64le ]]; then + arch="powerpc64le" else arch="amd64" - cc_arch="amd64" fi if [[ $RID == linux-musl* ]]; then @@ -26,7 +19,7 @@ else dockerfile="Dockerfile.linux" fi -docker buildx build -t $RID -f $dockerfile --build-arg ARCH=$arch --build-arg CC_ARCH=$cc_arch . +docker buildx build -t $RID -f $dockerfile --build-arg ARCH=$arch . docker run -t -e RID=$RID --name=$RID $RID