Skip to content

Commit 767c547

Browse files
committed
build: use meson static build to test fabrics=disabled
Add a CI test for building without fabrics code. While at it also use some non standard CFLAGS and LDFLAGS. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 141a2ff commit 767c547

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,19 @@ jobs:
174174
run: |
175175
make static
176176
177+
build-make-minimal-static:
178+
name: make static
179+
runs-on: ubuntu-latest
180+
container:
181+
image: ghcr.io/linux-nvme/debian:latest
182+
steps:
183+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
184+
- name: Mark repo as safe for git
185+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
186+
- name: build
187+
run: |
188+
scripts/build.sh minimal_static
189+
177190
build-musl:
178191
name: musl libc build on Debian
179192
runs-on: ubuntu-latest

scripts/build.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ usage() {
3434
echo " html_docs build html documentation only"
3535
echo " rst_docs build rst documentation only"
3636
echo " static build a static binary"
37+
echo " minimal_static build a static binary without fabrics support"
3738
echo " libnvme build only libnvme"
3839
echo ""
3940
echo "configs with muon:"
@@ -194,6 +195,45 @@ config_meson_static() {
194195
"${BUILDDIR}"
195196
}
196197

198+
config_meson_minimal_static() {
199+
local cflags=(
200+
-U_GNU_SOURCE
201+
-idirafter /usr/include
202+
-idirafter /usr/include/x86_64-linux-gnu
203+
-Oz
204+
-ffunction-sections
205+
-fdata-sections
206+
-fno-unwind-tables
207+
-fno-asynchronous-unwind-tables
208+
-fno-stack-protector
209+
)
210+
local ldflags=(
211+
-flto
212+
-Wl,--gc-sections
213+
-s
214+
-Wl,--build-id=none
215+
-static
216+
)
217+
local cflags_str="${cflags[*]}"
218+
local ldflags_str="${ldflags[*]}"
219+
220+
CC=musl-gcc
221+
222+
CC="${CC}" "${MESON}" setup \
223+
--werror \
224+
--buildtype=release \
225+
--default-library=static \
226+
--prefix=/usr \
227+
-Dplugins="sed,lm,feat,zns,fdp" \
228+
-Dc_args="${cflags_str}" \
229+
-Dc_link_args="${ldflags_str}" \
230+
-Dfabrics=disabled \
231+
-Djson-c=disabled \
232+
-Dtests=false \
233+
-Dexamples=false \
234+
"${BUILDDIR}"
235+
}
236+
197237
config_meson_libnvme() {
198238
CC="${CC}" "${MESON}" setup \
199239
--werror \

0 commit comments

Comments
 (0)