Skip to content

add linux/musl-riscv64 build #168

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -33,12 +33,16 @@ jobs:
name: linux-arm64
- os: ubuntu-24.04
name: linux-ppc64le
- os: ubuntu-24.04
name: linux-riscv64
- os: ubuntu-24.04
name: linux-musl-x64
- os: ubuntu-24.04
name: linux-musl-arm
- os: ubuntu-24.04
name: linux-musl-arm64
- os: ubuntu-24.04
name: linux-musl-riscv64
- os: macos-13
name: osx-x64
- os: macos-13
2 changes: 1 addition & 1 deletion Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -6,4 +6,4 @@ 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"]
4 changes: 2 additions & 2 deletions Dockerfile.linux-musl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG ARCH='amd64'
FROM multiarch/alpine:${ARCH}-v3.13
FROM multiarch/alpine:${ARCH}-v{ALPINE_VERSION}
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"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@ the following platforms:
- Windows (x86, x64, arm64)
- macOS (x64, arm64)
- Linux
- glibc: (x64, arm, arm64, ppc64le)
- musl: (x64, arm, arm64)
- glibc: (x64, arm, arm64, ppc64le, riscv64)
- musl: (x64, arm, arm64, riscv64)

[lg2s-nb]: https://www.nuget.org/packages/LibGit2Sharp.NativeBinaries
[lg2]: https://libgit2.github.com/
1 change: 1 addition & 0 deletions UpdateLibgit2ToSha.ps1
Original file line number Diff line number Diff line change
@@ -124,6 +124,7 @@ Push-Location $libgit2Directory
<dllmap os="linux" cpu="arm" wordsize="32" dll="$binaryFilename" target="lib/linux-arm/lib$binaryFilename.so" />
<dllmap os="linux" cpu="armv8" wordsize="64" dll="$binaryFilename" target="lib/linux-arm64/lib$binaryFilename.so" />
<dllmap os="linux" cpu="ppc64le" wordsize="64" dll="$binaryFilename" target="lib/linux-ppc64le/lib$binaryFilename.so" />
<dllmap os="linux" cpu="riscv64" wordsize="64" dll="$binaryFilename" target="lib/linux-riscv64/lib$binaryFilename.so" />
<dllmap os="osx" cpu="x86-64" wordsize="64" dll="$binaryFilename" target="lib/osx-x64/lib$binaryFilename.dylib" />
<dllmap os="osx" cpu="armv8" wordsize="64" dll="$binaryFilename" target="lib/osx-arm64/lib$binaryFilename.dylib" />
</configuration>
7 changes: 6 additions & 1 deletion dockerbuild.sh
Original file line number Diff line number Diff line change
@@ -3,12 +3,17 @@
set -e
echo "building for $RID"

alpineVersion=3.13

if [[ $RID =~ arm64 ]]; then
arch="arm64"
elif [[ $RID =~ arm ]]; then
arch="armhf"
elif [[ $RID =~ ppc64le ]]; then
arch="powerpc64le"
elif [[ $RID =~ riscv64 ]]; then
arch="riscv64"
alpineVersion=3.20 # alpine 3.20 is the first version with official riscv64 support
else
arch="amd64"
fi
@@ -19,7 +24,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 ALPINE_VERSION=$alpineVersion .

docker run -t -e RID=$RID --name=$RID $RID

1 change: 1 addition & 0 deletions nuget.package/libgit2/LibGit2Sharp.dll.config
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
<dllmap os="linux" cpu="arm" wordsize="32" dll="git2-3f4182d" target="lib/linux-arm/libgit2-3f4182d.so" />
<dllmap os="linux" cpu="armv8" wordsize="64" dll="git2-3f4182d" target="lib/linux-arm64/libgit2-3f4182d.so" />
<dllmap os="linux" cpu="ppc64le" wordsize="64" dll="git2-3f4182d" target="lib/linux-ppc64le/libgit2-3f4182d.so" />
<dllmap os="linux" cpu="riscv64" wordsize="64" dll="git2-3f4182d" target="lib/linux-riscv64/libgit2-3f4182d.so" />
<dllmap os="osx" cpu="x86-64" wordsize="64" dll="git2-3f4182d" target="lib/osx-x64/libgit2-3f4182d.dylib" />
<dllmap os="osx" cpu="armv8" wordsize="64" dll="git2-3f4182d" target="lib/osx-arm64/libgit2-3f4182d.dylib" />
</configuration>