libnvme: commit pre-generated accessor files and simplify build#3176
Merged
igaw merged 1 commit intolinux-nvme:masterfrom Mar 13, 2026
Merged
Conversation
5ca8861 to
bb46cbb
Compare
The accessor functions (getters/setters for nvme_path, nvme_ns, nvme_ctrl, nvme_subsystem, nvme_host, nvme_fabric_options) were previously generated at build time by a custom_target in Meson. They are now committed to the source tree and treated as maintainer-generated source files, similar to how the Linux kernel and systemd handle infrequently-changing generated code. Changes: - Commit accessors.h, accessors.c, accessors.ld to the source tree - Remove the custom_target that ran the generator on every build; generate-accessors is no longer compiled during a normal build - Add accessors.c to the sources list and accessors.h to install_headers() alongside their sibling files in libnvme/src/meson.build - Remove accessors_dep (was only needed to forward the custom_target outputs; plain files don't require this indirection) - Enhance generate-accessors.c to emit mechanical Doxygen stubs in accessors.h, covering all three member kinds: value types, dynamic char * (with NULL/copy semantics), and fixed char arrays - Add update-accessors.sh: atomically regenerates accessors.h and accessors.c when content changes, and reports symbol additions and removals against accessors.ld without overwriting it - Add a Meson run_target and Makefile target 'update-accessors' for on-demand regeneration: make update-accessors - Keep accessors.ld manually maintained; its version section labels (e.g. LIBNVME_ACCESSORS_3_0) must be assigned by the maintainer to preserve ABI compatibility - Add .github/workflows/check-accessors.yml to fail CI when the committed accessor files drift from the generator output - Update README.md with a developer guide covering regeneration, accessors.ld maintenance, and the ABI versioning convention - Fix three stale test reference files that were missing dhchap_ctrl_key from their expected JSON output following an earlier json.c update Signed-off-by: Martin Belanger <[email protected]>
bb46cbb to
772bc6c
Compare
Collaborator
|
Thanks a lot. I think this is a good middle ground. And getting rid of the hand written stuff is good :) |
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.
The accessor functions (getters/setters for nvme_path, nvme_ns, nvme_ctrl, nvme_subsystem, nvme_host, nvme_fabric_options) were previously generated at build time by a custom_target in Meson. They are now committed to the source tree and treated as maintainer-generated source files, similar to how the Linux kernel and systemd handle infrequently-changing generated code.
Changes: