Fix build with musl and add Alpine buildnode to CI#174
Fix build with musl and add Alpine buildnode to CI#174ericcurtin merged 10 commits intoinotify-tools:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #174 +/- ##
===========================================
+ Coverage 0 44.57% +44.57%
===========================================
Files 0 7 +7
Lines 0 2380 +2380
===========================================
+ Hits 0 1061 +1061
- Misses 0 1319 +1319
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
The failure on ubuntu 20.04 seems to be unrelated. It runs clang-format on this file but the .clang-format policy in the repo wants to use 8-character tab and the files |
fac3ed2 to
10a2cb3
Compare
b35fcd2 to
2853b84
Compare
ebf87d4 to
5e13d66
Compare
|
Kudos, SonarCloud Quality Gate passed! |
.github/workflows/build.yml
Outdated
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - name: Setup latest Alpine Linux | ||
| uses: jirutka/setup-alpine@v1 |
There was a problem hiding this comment.
I deliberately avoid these plugins, to avoid vendor lock-in, in case I have to migrate to GitLab or some other similar service in the future. We depend soley on free infrastructure, because we have zero funding.
I think you have the hard part done. Could we instead wrap in a podman or docker container directly and run this in one of the shell scripts?
The less .yml and plugins, the better!
There was a problem hiding this comment.
build_and_test.sh
Outdated
|
|
||
| if [ -n "$TRAVIS" ] || [ -n "$CI" ]; then | ||
| if [ "$os" != "freebsd" ]; then | ||
| if [ "${ID:-linux}" = "ubuntu" ] || [ "${ID:-linux}" = "debian" ]; then |
There was a problem hiding this comment.
This is where I'd like the alpine package installs to go, just to keep everything in the same place.
There was a problem hiding this comment.
yeah if we do not use plugin.
build_and_test.sh
Outdated
| inotifytools_inc2="$inotifytools_inc/inotifytools" | ||
| inc="-I$usr_inc -I$inotifytools_inc -I$inotifytools_inc2" | ||
|
|
||
| if [ "${ID:-linux}" = "alpine" ]; then |
There was a problem hiding this comment.
Is it possible to fix the things pointed out as warnings instead of disabling the warning?
There was a problem hiding this comment.
fixing is hard because for that it has to get definition of the structure which is the whole problem with sys/fanotify.h mess-up that various libc implementations have done. I tried to swap the elements as well but that has same problem. Because clang does not allow VLAIS it complains about it. Usually it should work ok.
There was a problem hiding this comment.
Does this fix it? 94dfc73e7cf4a31da66b8843f0b9283ddd6b8381
index f1f89132d60e2..197df344307db 100644
--- a/include/uapi/linux/fanotify.h
+++ b/include/uapi/linux/fanotify.h
@@ -162,7 +162,7 @@ struct fanotify_event_info_fid {
* Following is an opaque struct file_handle that can be passed as
* an argument to open_by_handle_at(2).
*/
- unsigned char handle[0];
+ unsigned char handle[];
};
maybe it doesn't, but I noticed they made this change in the kernel. I think the empty brackets is the modern way of doing it.
There was a problem hiding this comment.
Yeah that fixes it alright, this is what should be done instead of ignoring that warning... I just tested it...
| #define stat64 stat | ||
| #define lstat64 lstat | ||
| #ifdef ENABLE_FANOTIFY | ||
| #if defined(__FreeBSD__) && defined(ENABLE_FANOTIFY) |
| @@ -13,11 +13,6 @@ | |||
| #include <sys/syscall.h> | |||
| #include <unistd.h> | |||
|
|
|||
| @@ -1,11 +1,6 @@ | |||
| #ifndef _inotifytools_H | |||
| #define _inotifytools_H | |||
|
|
|||
|
So if you look at the latest commit f57005c I put together an alpine container for you without the plugin, you just need to uncomment the line that says "alpine" and it's good to go. |
This will define _FILE_OFFSET_BITS to be 64 if off_t is 64bit and we do not need to define lfs64 functions Signed-off-by: Khem Raj <[email protected]>
When build tree is outside source-tree its not able to find fanotify-dfid-name.h, add needed include paths on compiler commandline Signed-off-by: Khem Raj <[email protected]>
System detects to use sys/fnotify.h and then assumes glibc's definitions but musl has definitions of its own. perhaps portable thing would be to use linux/fnotify.h interface directly on linux irrespective of libc See the differences discussion here [1] [1] https://inbox.vuxu.org/musl/20191112220151.GC27331@x230/T/#ma8700992467200c8792e0fa8508eae656b81aeba Signed-off-by: Khem Raj <[email protected]>
lfs64 functions are not needed when off_t is 64-bit Additionally this fixes build with musl which does not export these functions without defining _LARGEFILE64_SOURCE Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
Fixes -Wno-gnu-variable-sized-type-not-at-end for musl clang-format Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Eric Curtin <[email protected]>
Signed-off-by: Eric Curtin <[email protected]>
Signed-off-by: Eric Curtin <[email protected]>
|
Merged, thanks for the contribution... |








These functions are not needed on 64bit systems at all and also on 32bit systems with 64bit off_t