Skip to content

Commit bc273ca

Browse files
author
Claude
committed
Remove unnecessary musl builds for static libraries
Static libraries (.a files) are just archives of object files with unresolved libc symbols. Those symbols get resolved when the final executable is linked, using whatever libc is available on the target system (glibc or musl). Therefore, separate musl builds are not needed. Changes: - Removed build-linux-musl and build-linux-aarch64-musl jobs - Removed LDFLAGS="-static" from Linux builds (incorrect for libraries) - Simplified to 4 platform builds: * x86_64/Linux * aarch64/Linux * x86_64/Darwin * arm64/Darwin The resulting static libraries will work on both glibc and musl systems since libc symbols are resolved at final link time, not library build time.
1 parent 8b3c8d9 commit bc273ca

1 file changed

Lines changed: 11 additions & 108 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ on:
55
pull_request:
66

77
jobs:
8-
build-linux:
8+
build-linux-x86_64:
99
runs-on: ubuntu-latest
1010
timeout-minutes: 90
1111
env:
1212
OS_NAME: Linux
1313
ARCH_NAME: x86_64
1414
LIB_NAME: libasyncprocess.a
15-
RESULT_NAME: result-linux
16-
RESULT_PATH: result-linux
15+
RESULT_NAME: result-linux-x86_64
16+
RESULT_PATH: result-linux-x86_64
1717
RESULT_PATH_SUB: result-async/static
1818
steps:
1919
- uses: actions/checkout@v4
@@ -30,8 +30,8 @@ jobs:
3030
autoheader
3131
automake --add-missing --copy --foreign
3232
autoconf
33-
# Configure for static build
34-
./configure --enable-static --disable-shared LDFLAGS="-static"
33+
# Configure for static library build
34+
./configure --enable-static --disable-shared
3535
make
3636
- name: Verify static library
3737
run: |
@@ -49,53 +49,6 @@ jobs:
4949
name: ${{ env.RESULT_NAME }}
5050
path: ${{ env.RESULT_PATH }}
5151

52-
build-linux-musl:
53-
runs-on: ubuntu-latest
54-
timeout-minutes: 90
55-
env:
56-
OS_NAME: Linux-musl
57-
ARCH_NAME: x86_64
58-
LIB_NAME: libasyncprocess.a
59-
RESULT_NAME: result-linux-musl
60-
RESULT_PATH: result-linux-musl
61-
RESULT_PATH_SUB: result-async/static
62-
steps:
63-
- uses: actions/checkout@v4
64-
- name: Build on Alpine Linux (musl)
65-
uses: uraimo/run-on-arch-action@v2
66-
with:
67-
arch: x86_64
68-
distro: alpine_latest
69-
run: |
70-
apk add --no-cache build-base automake autoconf libtool
71-
pwd
72-
uname
73-
uname -m
74-
gcc -v
75-
# Generate build system
76-
libtoolize --copy --force --quiet
77-
aclocal
78-
autoheader
79-
automake --add-missing --copy --foreign
80-
autoconf
81-
# Configure for static build
82-
./configure --enable-static --disable-shared LDFLAGS="-static"
83-
make
84-
# Verify static library
85-
file .libs/libasyncprocess.a
86-
ls -lh .libs/libasyncprocess.a
87-
- name: Copy Result
88-
if: always()
89-
run: |
90-
mkdir -p $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME
91-
cp .libs/$LIB_NAME $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME/
92-
- name: Upload Result
93-
if: always()
94-
uses: actions/upload-artifact@v4
95-
with:
96-
name: ${{ env.RESULT_NAME }}
97-
path: ${{ env.RESULT_PATH }}
98-
9952
build-linux-aarch64:
10053
runs-on: ubuntu-latest
10154
timeout-minutes: 90
@@ -109,63 +62,13 @@ jobs:
10962
steps:
11063
- uses: actions/checkout@v4
11164
- name: Build on aarch64 (arm64)
112-
id: runcmd
11365
uses: uraimo/run-on-arch-action@v2
11466
with:
11567
arch: aarch64
11668
distro: ubuntu22.04
11769
run: |
11870
apt-get update
119-
apt-get -y install build-essential
120-
apt-get -y install automake
121-
apt-get -y install libtool
122-
pwd
123-
uname
124-
uname -m
125-
gcc -v
126-
# Generate build system
127-
libtoolize --copy --force --quiet
128-
aclocal
129-
autoheader
130-
automake --add-missing --copy --foreign
131-
autoconf
132-
# Configure for static build
133-
./configure --enable-static --disable-shared LDFLAGS="-static"
134-
make
135-
# Verify static library
136-
file .libs/libasyncprocess.a
137-
ls -lh .libs/libasyncprocess.a
138-
- name: Copy Result
139-
if: always()
140-
run: |
141-
mkdir -p $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME
142-
cp .libs/$LIB_NAME $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME/
143-
- name: Upload Result
144-
if: always()
145-
uses: actions/upload-artifact@v4
146-
with:
147-
name: ${{ env.RESULT_NAME }}
148-
path: ${{ env.RESULT_PATH }}
149-
150-
build-linux-aarch64-musl:
151-
runs-on: ubuntu-latest
152-
timeout-minutes: 90
153-
env:
154-
OS_NAME: Linux-musl
155-
ARCH_NAME: aarch64
156-
LIB_NAME: libasyncprocess.a
157-
RESULT_NAME: result-linux-aarch64-musl
158-
RESULT_PATH: result-linux-aarch64-musl
159-
RESULT_PATH_SUB: result-async/static
160-
steps:
161-
- uses: actions/checkout@v4
162-
- name: Build on aarch64 Alpine (musl)
163-
uses: uraimo/run-on-arch-action@v2
164-
with:
165-
arch: aarch64
166-
distro: alpine_latest
167-
run: |
168-
apk add --no-cache build-base automake autoconf libtool
71+
apt-get -y install build-essential automake libtool
16972
pwd
17073
uname
17174
uname -m
@@ -176,8 +79,8 @@ jobs:
17679
autoheader
17780
automake --add-missing --copy --foreign
17881
autoconf
179-
# Configure for static build
180-
./configure --enable-static --disable-shared LDFLAGS="-static"
82+
# Configure for static library build
83+
./configure --enable-static --disable-shared
18184
make
18285
# Verify static library
18386
file .libs/libasyncprocess.a
@@ -219,7 +122,7 @@ jobs:
219122
autoheader
220123
automake --add-missing --copy --foreign
221124
autoconf
222-
# Configure for static build
125+
# Configure for static library build
223126
./configure --enable-static --disable-shared
224127
make
225128
- name: Verify static library
@@ -264,7 +167,7 @@ jobs:
264167
autoheader
265168
automake --add-missing --copy --foreign
266169
autoconf
267-
# Configure for static build
170+
# Configure for static library build
268171
./configure --enable-static --disable-shared
269172
make
270173
- name: Verify static library
@@ -286,7 +189,7 @@ jobs:
286189

287190
release:
288191
runs-on: ubuntu-latest
289-
needs: [build-linux, build-linux-musl, build-linux-aarch64, build-linux-aarch64-musl, build-osx-arm64, build-osx-x86_64]
192+
needs: [build-linux-x86_64, build-linux-aarch64, build-osx-arm64, build-osx-x86_64]
290193
if: startsWith(github.ref, 'refs/tags/')
291194
steps:
292195
- name: Download all artifacts

0 commit comments

Comments
 (0)