Skip to content

failure to include abd_os.h when installed from libzfs5-devel rpm #16940

Closed
@defaziogiancarlo

Description

@defaziogiancarlo

System information

Type Version/Name
Distribution Name TOSS
Distribution Version 4
Kernel Version 4.18.0-553.33
Architecture x86_64
OpenZFS Version zfs-2.2.7_1llnl-1 https://github.com/LLNL/zfs/tree/zfs-2.2.7_1llnl

Describe the problem you're observing

When building lustre 2.15.6 against zfs 2.2.7 I get the error:

In file included from /usr/include/libzfs/sys/zio_compress.h:33,
                 from /usr/include/libzfs/sys/dmu.h:50,
                 from /usr/include/libzfs/sys/spa.h:46,
                 from libmount_utils_zfs.c:32:
/usr/include/libzfs/sys/abd.h:33:10: fatal error: sys/abd_os.h: No such file or directory
 #include <sys/abd_os.h>
          ^~~~~~~~~~~~~~

For abd_os.h the only include I see is in abd.h and is prefixed by sys: #include <sys/abd_os.h>.
In the source tree the path to abd_os.h is always prefixed by sys:

(gopher12):zfs$ find . -name abd_os.h
./include/os/freebsd/zfs/sys/abd_os.h
./include/os/linux/zfs/sys/abd_os.h
./lib/libzpool/include/sys/abd_os.h

However the libzfs5-devel rpm installs abd_os.h at:

[root@gopher12:zfs-2.2.7-rpms]# rpm -ql libzfs5-devel-2.2.7_1llnl-1.t4.x86_64.rpm | grep abd_os\.h
/usr/include/libzpool/abd_os.h

NOTE: lustre doesn't normally have "-I /usr/include/libzpool" but it is being used in this case

I think that libzfs5-devel should install abd_os.h at /usr/include/libzpool/sys/abd_os.h or maybe /usr/include/libzfs/sys/abd_os.h, otherwise the #include in abd.h will fail.

Describe how to reproduce the problem

install libzfs5-devel and attempt to include spa.h

[root@gopher12:zfs-2.2.7-rpms]# rpm -q libzfs5-devel
libzfs5-devel-2.2.7_1llnl-1.t4.x86_64pm
[root@gopher12:zfs-2.2.7-rpms]# cat ~/test_include_spa.c
#include <sys/spa.h>

int main() {
  return 0;
}
[root@gopher12:zfs-2.2.7-rpms]# gcc -Wall -I /usr/include/libspl -I /usr/include/libzfs -I /usr/include/libzpool -o test_include_spa ~/test_include_spa.c
In file included from /usr/include/libzfs/sys/zio_compress.h:33,
                 from /usr/include/libzfs/sys/dmu.h:50,
                 from /usr/include/libzfs/sys/spa.h:46,
                 from /root/test_include_spa.c:1:
/usr/include/libzfs/sys/abd.h:33:10: fatal error: sys/abd_os.h: No such file or directory
 #include <sys/abd_os.h>
          ^~~~~~~~~~~~~~

Metadata

Metadata

Assignees

Labels

Type: DefectIncorrect behavior (e.g. crash, hang)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions