github: Test build against the installed liburing
PATCH 1/1 github: Test build against the installed liburing
When adding a new header file, the author might forget to add it to the installation path in the Makefile.
For example, commit 7e565c0116ba ("tests: test the query interface"), introduced an include to the query.h file via liburing.h, but the query.h file was not added to the installation entry, which resulted in the following error:
In file included from a.c:1:
/usr/include/liburing.h:19:10: fatal error: liburing/io_uring/query.h: No such file or directory
19 | #include "liburing/io_uring/query.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
This kind of breakage is only caught by the liburing that's installed in the system. Make sure the GitHub CI covers it so we can catch the breakage earlier before a new release is tagged and distributed.
Thanks to Romain Pereira for reporting the issue on GitHub!
--- .github/workflows/ci.yml | 18 ++++++++++++++++++ .github/workflows/test_build.c | 9 +++++++++ 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/test_build.c
.github/workflows/ci.yml +18 -0
@@ -196,6 +196,17 @@ jobs: run: | sudo make install; + - name: Test build against the installed liburing + run: | + export TEST_FILE=".github/workflows/test_build.c"; + if [ "$SANITIZE" -eq "1" ]; then + export SANITIZE_FLAGS="-fsanitize=address,undefined"; + else + export SANITIZE_FLAGS=""; + fi; + ${{matrix.build_args.cc}} -x c -o a.out $TEST_FILE -luring $SANITIZE_FLAGS; + ${{matrix.build_args.cxx}} -x c++ -o a.out $TEST_FILE -luring $SANITIZE_FLAGS; + alpine-musl-build: needs: get_commit_list
@@ -239,6 +250,13 @@ jobs: run: | make install; + - name: Test build against the installed liburing + shell: alpine.sh {0} + run: | + export TEST_FILE=".github/workflows/test_build.c"; + gcc -x c -o a.out $TEST_FILE -luring; + g++ -x c++ -o a.out $TEST_FILE -luring; + codespell: needs: get_commit_list
.github/workflows/test_build.c new file +9 -0
@@ -0,0 +1,9 @@ +#include <liburing.h> + +int main (void ) +{ +struct io_uring ring; +io_uring_queue_init (8 , &ring,0 ); +io_uring_queue_exit (&ring); +return 0 ; +}
Signature · 1 line
Ammar Faizi
Quoted 9 lines · Ammar Faizi
When adding a new header file, the author might forget to add it to the installation path in the
Makefile.For example, commit
7e565c0116ba("tests: test the query interface"), introduced an include to thequery.hfile vialiburing.h, but thequery.hfile was not added to the installation entry, which resulted in the following error:[...]
Applied, thanks!
[1/1] github: Test build against the installed liburing
commit: f22f2fb4341afbe755870b0e7dd1b680dbb5bb8f
Best regards,
Signature · 1 line
Jens Axboe