Skip to content

abd_os: move headers from libzpool to libspl #17394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025

Conversation

robn
Copy link
Member

@robn robn commented May 29, 2025

[Sponsors: Klara, Inc., Wasabi Technology, Inc.]

Motivation and Context

5b9e695 added specific userspace versions of abd_os.h and abd_impl_os.h for libzpool. However, abd.h and abd_impl.h, which include them, are packaged with libzfs, so other programs building against libzfs can fail to build, either because the headers aren't installed, or because they aren't on any standard include path.

Description

Move abd_os.h and abd_impl_os.h to libspl, where they we will be installed alongside abd.h and abd_impl.h in a known path.

Fixes #16940
Fixes #17390

How Has This Been Tested?

Installation and package building.

Before:

$ make install
...
$ find /usr/local/include -name abd\*.h
/usr/local/include/libzfs/sys/abd.h
/usr/local/include/libzfs/sys/abd_impl.h
/usr/local/include/libzpool/abd_impl_os.h
/usr/local/include/libzpool/abd_os.h

$ make -j6 deb-utils
...
$ dpkg-deb -c libzfs6-devel_2.3.99-389_amd64.deb | grep 'abd.*\.h'
-rw-r--r-- root/root      6037 2025-05-29 11:05 ./usr/include/libzfs/sys/abd.h
-rw-r--r-- root/root      3559 2025-05-29 11:05 ./usr/include/libzfs/sys/abd_impl.h
-rw-r--r-- root/root      1259 2025-05-29 11:05 ./usr/include/libzpool/abd_impl_os.h
-rw-r--r-- root/root      1278 2025-05-29 11:05 ./usr/include/libzpool/abd_os.h

$ rpm2cpio libzfs6-devel-2.3.99-389_g00360efa35.x86_64.rpm | cpio -it | grep 'abd.*\.h'
./usr/include/libzfs/sys/abd.h
./usr/include/libzfs/sys/abd_impl.h
./usr/include/libzpool/abd_impl_os.h
./usr/include/libzpool/abd_os.h

After:

$ make install
...
$ find /usr/local/include -name abd\*.h
/usr/local/include/libzfs/sys/abd.h
/usr/local/include/libzfs/sys/abd_impl.h
/usr/local/include/libspl/sys/abd_os.h
/usr/local/include/libspl/sys/abd_impl_os.h

$ make -j6 deb-utils
...
$ dpkg-deb -c libzfs6-devel_2.3.99-390_amd64.deb | grep 'abd.*\.h'
-rw-r--r-- root/root      1259 2025-05-29 10:47 ./usr/include/libspl/sys/abd_impl_os.h
-rw-r--r-- root/root      1278 2025-05-29 10:47 ./usr/include/libspl/sys/abd_os.h
-rw-r--r-- root/root      6037 2025-05-29 10:47 ./usr/include/libzfs/sys/abd.h
-rw-r--r-- root/root      3559 2025-05-29 10:47 ./usr/include/libzfs/sys/abd_impl.h

$ make -j6 rpm-utils
...
$ rpm2cpio libzfs6-devel-2.3.99-390_g1d2b185182.x86_64.rpm | cpio -it | grep 'abd.*\.h'
./usr/include/libspl/sys/abd_impl_os.h
./usr/include/libspl/sys/abd_os.h
./usr/include/libzfs/sys/abd.h
./usr/include/libzfs/sys/abd_impl.h

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

5b9e695 added specific userspace versions of abd_os.h and abd_impl_os.h
for libzpool. However, abd.h and abd_impl.h, which include them, are
packaged with libzfs, so other programs building against libzfs can
fail to build, either because the headers aren't installed, or because
they aren't on any standard include path.

So, move abd_os.h and abd_impl_os.h to libspl, where they we will be
installed alongside abd.h and abd_impl.h in a known path.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <[email protected]>
@amotin amotin added the Status: Code Review Needed Ready for review and testing label May 29, 2025
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels May 30, 2025
@behlendorf behlendorf merged commit 1bd225e into openzfs:master May 30, 2025
32 of 38 checks passed
@pfmooney pfmooney mentioned this pull request May 30, 2025
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

abd_os.h include path issues failure to include abd_os.h when installed from libzfs5-devel rpm
3 participants