Skip to content

Commit

Permalink
Re-force build-type options
Browse files Browse the repository at this point in the history
This follows up the removal of -Dauto_features to explicitly force each
option that ought to be detected.
  • Loading branch information
bmerry committed Jul 29, 2024
1 parent 344479d commit 8472ac7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 15 deletions.
56 changes: 56 additions & 0 deletions .ci/setup-flags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

# Produce flags to meson to force certain features. This ensures that the CI
# builds are actually testing all the optional features, and not failing to
# include them because the detection code is broken.

flags=(
"--native-file=ci.ini"
"-Dwerror=true"
"-Dtools=enabled"
"-Dpcap=enabled"
"-Dpthread_setaffinity_np=enabled"
"-Dunit_test=enabled"
)

if [ "$(uname)" = "Linux" ]; then
flags+=(
"-Dibv=enabled"
"-Dmlx5dv=enabled"
"-Dibv_hw_rate_limit=enabled"
"-Dpcap=enabled"
"-Dcap=enabled"
"-Drecvmmsg=enabled"
"-Dsendmmsg=enabled"
"-Dgso=enabled"
"-Dgro=enabled"
"-Dposix_semaphores=enabled"
"-Deventfd=enabled"
)
fi

case "$(arch)" in
x86_64)
flags+=(
"-Dsse2_stream=enabled"
"-Davx_stream=enabled"
"-Davx512_stream=enabled"
)
;;
aarch64 | arm64)
flags+=(
"-Dsve_stream=enabled"
)
;;
esac

echo "Setting flags ${flags[*]}" 1>&2

if [ "$1" = "--python" ]; then
for arg in "${flags[@]}"; do
echo -n "--config-settings=setup-args=$arg "
done
echo
else
echo "${flags[*]}"
fi
19 changes: 4 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ jobs:
- name: Install build requirements
run: ./.ci/py-build-requirements.sh
- name: Set up build directory
run: >-
meson setup build
--native-file=ci.ini
-Dwerror=true
run: meson setup build $(.ci/setup-flags.sh)
- name: Build
run: meson compile -C build
- name: Run tests
Expand Down Expand Up @@ -100,11 +97,7 @@ jobs:
env:
CC: ${{ matrix.cc }} # Do not pass -Werror when building dependencies
- name: Install Python package
run: >-
pip install -v
--config-settings=setup-args=--native-file=ci.ini
--config-settings=setup-args=-Dwerror=true
.
run: pip install -v $(.ci/setup-flags.sh --python) .
- name: Run tests
run: pytest -v -ra # -ra summarises the reasons for skipping or failing tests
- name: Run shutdown tests
Expand Down Expand Up @@ -148,8 +141,7 @@ jobs:
# the ephemeral build directory. So do a non-isolated editable
# install instead.
run: >-
pip install -v
--config-settings=setup-args=-Dwerror=true
pip install -v $(.ci/setup-flags.sh --python)
--config-settings=setup-args=-Dbuildtype=debug
--config-settings=setup-args=-Db_coverage=true
--no-build-isolation
Expand All @@ -158,10 +150,7 @@ jobs:
run: pytest -v -ra && ./.ci/py-tests-shutdown.sh
- name: Set up C++ build
run: >-
meson setup build
-Dwerror=true
-Dcuda=disabled
-Dgdrapi=disabled
meson setup build $(.ci/setup-flags.sh)
-Dbuildtype=debug
-Db_coverage=true
- name: Build C++
Expand Down

0 comments on commit 8472ac7

Please sign in to comment.