Fix parallel installation of libnvme v1 and v3#3525
Merged
Conversation
Allow parallel installation of libnvme v1 and v3. Avoid installation collisions by installing the headers into a versioned subdirectory. Signed-off-by: Daniel Wagner <dwagner@suse.de>
Allow parallel installation of libnvme v1 and v3. Avoid installation collisions by installing the document into a versioned subdirectory. Signed-off-by: Daniel Wagner <dwagner@suse.de>
|
Another thing that may collide are the udev rules. |
Contributor
Author
|
yep, but it's just about libnvme, not nvme-cli the use case here is, that distro are able to keep the v1 library around when updating to nvme-cli3. There are already project using libnvme, thus avoid flag day update scenario here. |
There was a problem hiding this comment.
Pull request overview
This PR updates the Meson build/install layout so libnvme v3 can be installed in parallel with libnvme v1 without file conflicts, by versioning the installed header and documentation paths/names.
Changes:
- Install libnvme headers into a versioned include directory (
<includedir>/<libnvme_api_name>/...) and adjust pkg-config include subdir metadata accordingly. - Add a
-<libnvme_api_name>suffix to generated man page filenames to avoid collisions. - Install HTML docs under a versioned directory path.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| meson.build | Adjusts non-standard-prefix include path to point at the versioned libnvme include directory. |
| libnvme/src/meson.build | Installs headers under a versioned include directory and updates pkg-config generation to match. |
| libnvme/doc/meson.build | Versions man page output filenames and HTML documentation install path to avoid cross-version collisions. |
Comments suppressed due to low confidence (1)
meson.build:506
- This non-standard-prefix include path now assumes headers are installed under //<libnvme_api_name>. That matches the new install layout, but it will break building nvme-cli against an older pre-installed libnvme3 that still installs headers directly under /. Adding a simple directory-existence fallback would keep compatibility while still preferring the versioned directory when present.
if not want_libnvme and not std_prefix
libnvme_hdr_location = prefixdir / get_option('includedir') / libnvme_api_name
message(
'Using non-standard libnvme headers location: ',
libnvme_hdr_location
)
# Allow compiler to find headers in non-standard location
add_project_arguments('-I' + libnvme_hdr_location, language : 'c')
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parallel installation fails because the headers and man pages collide:
Install the headers into a versioned directly and also add a postfix to the man pages, which seems to be the distro choice to handle the versioning.
https://en.opensuse.org/openSUSE:Packaging_conflicts