Draft
Conversation
libgen.h must be included to silence a compiler error regarding the basename() function missing when building with musl libc. The basename() function call in libnvme/src/nvme/linux.c:__nvme_transport_handle_open_direct() causes a (fatal) compilation warning due to GNU using this declaration of basename: char *basename (const char *filename) and POSIX (and also musl) ommiting const. It is thus possible that the const char *devname would be modified by basename(). The solution to the problem above is to use the internal implementation of basename from glibc directly and avoid these API compatibility problems. Signed-off-by: Michal Rábek <mrabek@redhat.com>
Signed-off-by: Michal Rábek <mrabek@redhat.com>
Signed-off-by: Michal Rábek <mrabek@redhat.com>
| struct nvme_passthru_cmd dummy = { 0 }; | ||
| _cleanup_free_ char *path = NULL; | ||
| char *name = basename(devname); | ||
| /* This used instead of basename() due to behavioral differences between |
There was a problem hiding this comment.
Maybe we could define a function nvme_basename() and add it to util.c.
Collaborator
There was a problem hiding this comment.
Yes, sounds like a good plan to do. FWIW, the windows port is likely to introduce some more wrappers like this anyway.
igaw
reviewed
Feb 26, 2026
| - name: Mark repo as safe for git | ||
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
| - name: Install musl build dependencies | ||
| - run: apt-get install -y --no-install-recommends musl musl-dev musl-tools |
Collaborator
There was a problem hiding this comment.
Let me add these dependencies to the debian:latest image. The past the apt-get install step failed way to often due to $reason.
Collaborator
There was a problem hiding this comment.
ghcr.io/linux-nvme/debian:latest contains musl musl-dev musl-tools so you can drop the install step here.
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.
This series of patches contributes to solving the recurring problem with build fails with
musllibc. It includes proposed build configuration and a new CI build job.Things to check before removing draft status:
muslbuild?