Skip to content

Commit 2fd7904

Browse files
committed
Merge tag 'gh-bot-musl-build-2025-07-14' of https://github.com/ammarfaizi2/liburing
Pull musl build-test for GitHub Action Bot from Ammar Faizi: - Fix test/timestamp.c build error on musl libc env. - Add musl build-test for GitHub Action Bot. * tag 'gh-bot-musl-build-2025-07-14' of https://github.com/ammarfaizi2/liburing: github: ci: Add alpine musl build t/timestamp: Remove `#include <error.h>` and move `#include <time.h>` to the top
2 parents 9a0461d + 427dde3 commit 2fd7904

2 files changed

Lines changed: 51 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,49 @@ jobs:
197197
sudo make install;
198198
199199
200+
alpine-musl-build:
201+
needs: get_commit_list
202+
runs-on: ubuntu-24.04
203+
strategy:
204+
matrix:
205+
commit: ${{ fromJson(needs.get_commit_list.outputs.commit_list) }}
206+
207+
steps:
208+
- name: Checkout source
209+
uses: actions/checkout@v4
210+
with:
211+
fetch-depth: 0
212+
213+
- name: Checkout commit
214+
run: |
215+
git checkout ${{ matrix.commit }};
216+
217+
- name: Setup Alpine Environment
218+
uses: jirutka/setup-alpine@v1
219+
with:
220+
branch: v3.15
221+
222+
- name: Display Alpine version
223+
shell: alpine.sh {0}
224+
run: cat /etc/alpine-release;
225+
226+
- name: Install build dependencies
227+
shell: alpine.sh --root {0}
228+
run: |
229+
apk add --no-cache build-base musl-dev linux-headers;
230+
231+
- name: Build
232+
shell: alpine.sh {0}
233+
run: |
234+
./configure --cc=gcc --cxx=g++;
235+
make -j$(nproc) V=1 CPPFLAGS="-Werror" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS";
236+
237+
- name: Test install command
238+
shell: alpine.sh --root {0}
239+
run: |
240+
make install;
241+
242+
200243
codespell:
201244
needs: get_commit_list
202245
runs-on: ubuntu-24.04

test/timestamp.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
#include <time.h>
12
#include <arpa/inet.h>
2-
#include <error.h>
3-
#include <errno.h>
43
#include <inttypes.h>
54
#include <linux/errqueue.h>
65
#include <linux/ipv6.h>
@@ -15,7 +14,6 @@
1514
#include <stdlib.h>
1615
#include <string.h>
1716
#include <sys/socket.h>
18-
#include <time.h>
1917
#include <unistd.h>
2018
#include <assert.h>
2119

@@ -86,15 +84,15 @@ static int test_prep_sock(int family, int proto, unsigned report_opt)
8684

8785
fd = socket(family, proto, ipproto);
8886
if (fd < 0)
89-
error(1, errno, "socket");
87+
t_error(1, errno, "socket");
9088

9189
if (proto == SOCK_STREAM) {
9290
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
9391
(char*) &val, sizeof(val)))
94-
error(1, 0, "setsockopt no nagle");
92+
t_error(1, 0, "setsockopt no nagle");
9593

9694
if (connect(fd, (void *) &daddr6, sizeof(daddr6)))
97-
error(1, errno, "connect ipv6");
95+
t_error(1, errno, "connect ipv6");
9896
}
9997

10098
sock_opt = SOF_TIMESTAMPING_SOFTWARE |
@@ -105,7 +103,7 @@ static int test_prep_sock(int family, int proto, unsigned report_opt)
105103

106104
if (setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING,
107105
(char *) &sock_opt, sizeof(sock_opt)))
108-
error(1, 0, "setsockopt timestamping");
106+
t_error(1, 0, "setsockopt timestamping");
109107

110108
return fd;
111109
}
@@ -295,13 +293,13 @@ static void do_listen(int family, int type, void *addr, int alen)
295293

296294
fd = socket(family, type, 0);
297295
if (fd == -1)
298-
error(1, errno, "socket rx");
296+
t_error(1, errno, "socket rx");
299297

300298
if (bind(fd, addr, alen))
301-
error(1, errno, "bind rx");
299+
t_error(1, errno, "bind rx");
302300

303301
if (type == SOCK_STREAM && listen(fd, 10))
304-
error(1, errno, "listen rx");
302+
t_error(1, errno, "listen rx");
305303

306304
/* leave fd open, will be closed on process exit.
307305
* this enables connect() to succeed and avoids icmp replies

0 commit comments

Comments
 (0)