Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 8072fa4

Browse files
author
Paulo Gomes
authored
Merge pull request #37 from pjbgf/remove-musl
Remove musl
2 parents 7773941 + 49eda2e commit 8072fa4

File tree

10 files changed

+17
-849
lines changed

10 files changed

+17
-849
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -17,121 +17,7 @@ permissions:
1717
id-token: write # needed for keyless signing
1818

1919
jobs:
20-
# changing this job name for some reason caused GitHub checks to
21-
# hang at `Expected — Waiting for status to be reported`.
2220
build:
23-
runs-on: ubuntu-latest
24-
env:
25-
PLATFORMS: linux/amd64,linux/arm/v7,linux/arm64
26-
services:
27-
registry:
28-
image: registry:2
29-
ports:
30-
- 5000:5000
31-
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v3
34-
- name: Unshallow
35-
run: git fetch --prune --unshallow
36-
- name: Setup Cosign
37-
uses: sigstore/cosign-installer@main
38-
- name: Set up QEMU
39-
id: qemu
40-
uses: docker/setup-qemu-action@v2
41-
with:
42-
image: tonistiigi/binfmt:latest
43-
platforms: ${{ env.PLATFORMS }}
44-
- name: Set up Docker Buildx
45-
id: buildx
46-
uses: docker/setup-buildx-action@v2
47-
with:
48-
config-inline: |
49-
[worker.oci]
50-
max-parallelism = 4
51-
driver-opts: network=host
52-
- name: Inspect builder
53-
run: |
54-
echo "Name: ${{ steps.buildx.outputs.name }}"
55-
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
56-
echo "Status: ${{ steps.buildx.outputs.status }}"
57-
echo "Flags: ${{ steps.buildx.outputs.flags }}"
58-
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
59-
- name: Cache Docker layers
60-
uses: actions/cache@v3
61-
id: cache
62-
with:
63-
path: /tmp/.buildx-cache
64-
key: ${{ runner.os }}-buildx-ghcache-${{ github.sha }}
65-
restore-keys: |
66-
${{ runner.os }}-buildx-ghcache-
67-
- run: cat ./hack/static.sh
68-
- name: Build candidate image - libgit2 compiled with libssh2 and openssl
69-
id: build_candidate_libgit2_all
70-
uses: docker/build-push-action@v3
71-
with:
72-
context: .
73-
file: Dockerfile
74-
platforms: ${{ env.PLATFORMS }}
75-
push: true
76-
tags: localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-all:latest
77-
cache-from: type=local,src=/tmp/.buildx-cache
78-
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
79-
- name: Inspect candidate images
80-
run: |
81-
docker buildx imagetools inspect localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-all:latest
82-
- name: Test candidate images
83-
id: test_candidate
84-
run: |
85-
IMG=localhost:5000/${{ github.repository_owner }}/golang-with-libgit2-all make test
86-
- # Temp fix
87-
# https://github.com/docker/build-push-action/issues/252
88-
# https://github.com/moby/buildkit/issues/1896
89-
name: Move cache
90-
run: |
91-
rm -rf /tmp/.buildx-cache
92-
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
93-
- name: Login to GHCR
94-
if: github.event_name != 'pull_request'
95-
uses: docker/login-action@v2
96-
with:
97-
registry: ghcr.io
98-
username: ${{ github.repository_owner }}
99-
password: ${{ secrets.GITHUB_TOKEN }}
100-
- name: Compose release candidate metadata - golang-with-libgit2-all
101-
id: meta_libgit2_all
102-
uses: docker/metadata-action@v3
103-
if: github.event_name != 'pull_request'
104-
with:
105-
images: |
106-
ghcr.io/${{ github.repository_owner }}/golang-with-libgit2-all
107-
tags: |
108-
type=semver,pattern=v{{version}}
109-
type=sha
110-
type=sha,format=long
111-
- name: Release candidate image - golang-with-libgit2-all
112-
id: release_candidate_libgit2_all
113-
if: github.event_name != 'pull_request'
114-
uses: docker/build-push-action@v3
115-
with:
116-
context: .
117-
file: Dockerfile
118-
platforms: ${{ env.PLATFORMS }}
119-
push: true
120-
tags: ${{ steps.meta_libgit2_all.outputs.tags }}
121-
labels: ${{ steps.meta_libgit2_all.outputs.labels }}
122-
cache-from: type=local,src=/tmp/.buildx-cache
123-
- name: Sign images
124-
env:
125-
COSIGN_EXPERIMENTAL: 1
126-
run: |
127-
array=($(echo ${{ steps.meta_libgit2_all.outputs.tags }} | tr '\n' " "))
128-
for image in "${array[@]}"
129-
do
130-
echo "Signing $image"
131-
cosign sign $image
132-
done
133-
134-
docker-build-libgit2-only:
13521
runs-on: ubuntu-latest
13622
env:
13723
PLATFORMS: linux/amd64,linux/arm/v7,linux/arm64

.github/workflows/release.yaml

Lines changed: 6 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,6 @@ permissions:
1717
id-token: write # needed for keyless signing
1818

1919
jobs:
20-
linux-x86_64-all-libs:
21-
runs-on: ubuntu-latest
22-
steps:
23-
- name: Checkout
24-
uses: actions/checkout@v3
25-
- name: Build static libraries - libgit2 compiled with libssh2 and openssl
26-
run: |
27-
TARGET_DIR=${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs \
28-
BUILD_ROOT_DIR=${GITHUB_WORKSPACE}/libgit2/build/amd \
29-
./hack/static.sh all
30-
31-
mkdir -p ./libgit2-linux-all-libs/
32-
mv ${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs/include ./libgit2-linux-all-libs/
33-
mv ${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs/share ./libgit2-linux-all-libs/
34-
mv ${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs/lib ./libgit2-linux-all-libs/
35-
mv ${GITHUB_WORKSPACE}/build/libgit2-linux-all-libs/lib64 ./libgit2-linux-all-libs/
36-
37-
tar -zcvf linux-x86_64-all-libs.tar.gz libgit2-linux-all-libs
38-
rm -rf ${GITHUB_WORKSPACE}/build ${GITHUB_WORKSPACE}/libgit2
39-
- uses: actions/upload-artifact@v3
40-
with:
41-
name: release-artifact
42-
path: "*.tar.gz"
43-
if-no-files-found: error
4420

4521
linux-x86_64-libgit2-only:
4622
runs-on: ubuntu-latest
@@ -65,88 +41,6 @@ jobs:
6541
path: "*.tar.gz"
6642
if-no-files-found: error
6743

68-
darwin-all-libs:
69-
# This job builds and releases "universal libraries" that are
70-
# supported by both darwin-amd64 and darwin-arm64.
71-
#
72-
# First builds in amd64, then cross-compile in arm64. Later combining
73-
# both outcomes onto a single binary for each static library.
74-
#
75-
# `macos-11` has been picked as support for arm64 was only added on Xcode 12.
76-
# Although some minor versions of Catalina 10.15 can support it, at the time
77-
# of testing, GitHub's macos-10.15 did not seem to.
78-
# Cross-compiling to arm64 on that runner consistently failed.
79-
runs-on: macos-11
80-
steps:
81-
- name: Checkout
82-
uses: actions/checkout@v3
83-
- name: Build universal static libraries for Darwin - libgit2 compiled with libssh2 and openssl
84-
run: |
85-
# The amd64 is used as base, using the target dir name (darwin-all-libs)
86-
# instead of the platform specific one, removes the need of replacing the
87-
# path in the .pc files.
88-
TARGET_DIR=${GITHUB_WORKSPACE}/build/darwin-all-libs \
89-
BUILD_ROOT_DIR=${GITHUB_WORKSPACE}/libgit2/build/amd \
90-
./hack/static.sh all
91-
92-
TARGET_DIR=${GITHUB_WORKSPACE}/build/libgit2-darwin-arm64 \
93-
BUILD_ROOT_DIR=${GITHUB_WORKSPACE}/libgit2/build/arm \
94-
TARGET_ARCH=arm64 \
95-
CMAKE_APPLE_SILICON_PROCESSOR=arm64 \
96-
./hack/static.sh all
97-
98-
99-
LIBGIT2_SED="s;-L/Applications/Xcode.* ;;g"
100-
LIBGIT2PC="${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/pkgconfig/libgit2.pc"
101-
102-
# pkgconfig includes absolute paths that are specific to the runner machine.
103-
# We need to remove the absolute path for iconv, so when the libgit2 library
104-
# is consumed pkgconfig will automatically try to find it through the default
105-
# search paths on the target machine.
106-
if command -v gsed &> /dev/null; then
107-
gsed -i "${LIBGIT2_SED}" "${LIBGIT2PC}"
108-
else
109-
sed -i "" "${LIBGIT2_SED}" "${LIBGIT2PC}"
110-
fi
111-
112-
mkdir -p ./darwin-all-libs/lib
113-
mv ${GITHUB_WORKSPACE}/build/darwin-all-libs/include ./darwin-all-libs/
114-
mv ${GITHUB_WORKSPACE}/build/darwin-all-libs/share ./darwin-all-libs/
115-
mv ${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/cmake ./darwin-all-libs/lib/
116-
mv ${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/engines-3 ./darwin-all-libs/lib/
117-
mv ${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/ossl-modules ./darwin-all-libs/lib/
118-
mv ${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/pkgconfig ./darwin-all-libs/lib/
119-
120-
libtool -static -o ./darwin-all-libs/lib/libcrypto.a \
121-
${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/libcrypto.a \
122-
${GITHUB_WORKSPACE}/build/libgit2-darwin-arm64/lib/libcrypto.a
123-
124-
libtool -static -o ./darwin-all-libs/lib/libgit2.a \
125-
${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/libgit2.a \
126-
${GITHUB_WORKSPACE}/build/libgit2-darwin-arm64/lib/libgit2.a
127-
128-
libtool -static -o ./darwin-all-libs/lib/libssh2.a \
129-
${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/libssh2.a \
130-
${GITHUB_WORKSPACE}/build/libgit2-darwin-arm64/lib/libssh2.a
131-
132-
libtool -static -o ./darwin-all-libs/lib/libssl.a \
133-
${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/libssl.a \
134-
${GITHUB_WORKSPACE}/build/libgit2-darwin-arm64/lib/libssl.a
135-
136-
libtool -static -o ./darwin-all-libs/lib/libz.a \
137-
${GITHUB_WORKSPACE}/build/darwin-all-libs/lib/libz.a \
138-
${GITHUB_WORKSPACE}/build/libgit2-darwin-arm64/lib/libz.a
139-
140-
tar -zcvf darwin-all-libs.tar.gz darwin-all-libs
141-
rm -rf ${GITHUB_WORKSPACE}/build ${GITHUB_WORKSPACE}/libgit2
142-
env:
143-
MACOSX_DEPLOYMENT_TARGET: 10.15
144-
- uses: actions/upload-artifact@v3
145-
with:
146-
name: release-artifact
147-
path: "*.tar.gz"
148-
if-no-files-found: error
149-
15044
# similar to darwin-all-libs, but only compiles libgit2.
15145
darwin-libgit2-only:
15246
runs-on: macos-11
@@ -165,17 +59,20 @@ jobs:
16559
CMAKE_APPLE_SILICON_PROCESSOR=arm64 \
16660
./hack/static.sh build_libgit2_only
16761
168-
LIBGIT2_SED="s;-L/Applications/Xcode.* ;;g"
62+
LIBGIT2_WORKDIR_SED="s;${GITHUB_WORKSPACE}/build/libgit2-darwin-amd64;${GITHUB_WORKSPACE}/build/darwin-libgit2-only;g"
63+
LIBGIT2_XCODE_SED="s;-L/Applications/Xcode.* ;;g"
16964
LIBGIT2PC="${GITHUB_WORKSPACE}/build/libgit2-darwin-amd64/lib/pkgconfig/libgit2.pc"
17065
17166
# pkgconfig includes absolute paths that are specific to the runner machine.
17267
# We need to remove the absolute path for iconv, so when the libgit2 library
17368
# is consumed pkgconfig will automatically try to find it through the default
17469
# search paths on the target machine.
17570
if command -v gsed &> /dev/null; then
176-
gsed -i "${LIBGIT2_SED}" "${LIBGIT2PC}"
71+
gsed -i "${LIBGIT2_WORKDIR_SED}" "${LIBGIT2PC}"
72+
gsed -i "${LIBGIT2_XCODE_SED}" "${LIBGIT2PC}"
17773
else
178-
sed -i "" "${LIBGIT2_SED}" "${LIBGIT2PC}"
74+
sed -i "" "${LIBGIT2_WORKDIR_SED}" "${LIBGIT2PC}"
75+
sed -i "" "${LIBGIT2_XCODE_SED}" "${LIBGIT2PC}"
17976
fi
18077
18178
mkdir ./darwin-libgit2-only
@@ -200,9 +97,7 @@ jobs:
20097
runs-on: ubuntu-latest
20198
needs:
20299
[
203-
linux-x86_64-all-libs,
204100
linux-x86_64-libgit2-only,
205-
darwin-all-libs,
206101
darwin-libgit2-only,
207102
]
208103
if: ${{ always() && contains(join(needs.*.result, ','), 'success') }}

.github/workflows/test.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ permissions: {}
1414

1515
jobs:
1616
darwin-dev-test:
17-
strategy:
18-
matrix:
19-
libgit_only: [true, false]
2017
runs-on: macos-11
2118
steps:
2219
- name: Checkout
@@ -26,13 +23,9 @@ jobs:
2623
rm -rf ${GITHUB_WORKSPACE}/build
2724
make dev-test
2825
env:
29-
LIBGIT2_ONLY: ${{ matrix.libgit_only }}
3026
MACOSX_DEPLOYMENT_TARGET: 10.15
3127

3228
linux-dev-test:
33-
strategy:
34-
matrix:
35-
libgit_only: [true, false]
3629
runs-on: ubuntu-latest
3730
steps:
3831
- name: Checkout
@@ -41,5 +34,3 @@ jobs:
4134
run: |
4235
rm -rf ${GITHUB_WORKSPACE}/build
4336
make dev-test
44-
env:
45-
LIBGIT2_ONLY: ${{ matrix.libgit_only }}

Dockerfile

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)