Skip to content

Commit 720356e

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 d59a820 commit 720356e

2 files changed

Lines changed: 54 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: 41 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,46 @@ 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+
-flto
205+
-ffunction-sections
206+
-fdata-sections
207+
-fno-unwind-tables
208+
-fno-asynchronous-unwind-tables
209+
-fno-stack-protector
210+
)
211+
local ldflags=(
212+
-flto
213+
-Wl,--gc-sections
214+
-s
215+
-Wl,--build-id=none
216+
-static
217+
)
218+
local cflags_str="${cflags[*]}"
219+
local ldflags_str="${ldflags[*]}"
220+
221+
CC=musl-gcc
222+
223+
CC="${CC}" "${MESON}" setup \
224+
--werror \
225+
--buildtype=release \
226+
--default-library=static \
227+
--prefix=/usr \
228+
-Dplugins="sed,lm,feat,zns,fdp" \
229+
-Dc_args="${cflags_str}" \
230+
-Dc_link_args="${ldflags_str}" \
231+
-Dfabrics=disabled \
232+
-Djson-c=disabled \
233+
-Dtests=false \
234+
-Dexamples=false \
235+
"${BUILDDIR}"
236+
}
237+
197238
config_meson_libnvme() {
198239
CC="${CC}" "${MESON}" setup \
199240
--werror \

0 commit comments

Comments
 (0)