Compilation fatal error: attr/xattr.h: No such file or directory (Fedora 24)
ldorau opened this issue · comments
On Fedora 24:
$ make
....
[ 93%] Building C object tests/preload/CMakeFiles/preload_xattr.dir/xattr/xattr.c.o
/home/ldorau/work/pmemfile/tests/preload/xattr/xattr.c:50:24: fatal error: attr/xattr.h: No such file or directory
#include <attr/xattr.h>
^
compilation terminated.
tests/preload/CMakeFiles/preload_xattr.dir/build.make:62: recipe for target 'tests/preload/CMakeFiles/preload_xattr.dir/xattr/xattr.c.o' failed
make[2]: *** [tests/preload/CMakeFiles/preload_xattr.dir/xattr/xattr.c.o] Error 1
CMakeFiles/Makefile2:3341: recipe for target 'tests/preload/CMakeFiles/preload_xattr.dir/all' failed
make[1]: *** [tests/preload/CMakeFiles/preload_xattr.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
$ find /usr -name xattr.h
/usr/include/linux/xattr.h
/usr/include/sys/xattr.h
Probably something is just messed up with the include directives in cmake, try grepping for "include.*xattr" in cmake files!
No, the man page really mentions sys/xattr.h
, so probably that should be included.
http://man7.org/linux/man-pages/man2/setxattr.2.html
It fails on my ubuntu desktop too, how did this get a green travis build?
Ahaa, that is why it worked on travis:
34b9f47
Fun, my setxattr man pages says you should include attr/xattr.h, and both attr/xattr.h and sys/xattr.h exist on my system. Attr version belongs to libattr1-dev and sys version belongs to libc6-dev.
Fixed by #253