build: add an option to specify a list of plugins to include#3145
build: add an option to specify a list of plugins to include#3145igaw merged 1 commit intolinux-nvme:masterfrom
Conversation
|
Looks good to me. @martin-belanger do you agree? |
| value : false, | ||
| description : 'building for PyPI (use short soversion, e.g. libnvme.so.3)' | ||
| ) | ||
| option( |
There was a problem hiding this comment.
Have you considered using an array of strings for this option:
option('array_opt', type : 'array', choices : ['one', 'two', 'three'], value : ['one', 'two'])
Ref: https://mesonbuild.com/Build-options.html#build-options
There was a problem hiding this comment.
Good point, that will be a bit more elegant solution. I will edit the patch.
692e8b2 to
ec46d0f
Compare
| option( | ||
| 'plugins', | ||
| type : 'array', | ||
| value: ['all'], |
There was a problem hiding this comment.
You could also add the choices argument:
choices: ['all', 'amzn', 'dapustor', 'dell', 'dera',
'fdp', 'huawei', 'ibm', 'innogrit', 'inspur', 'intel',
'mangoboost', 'memblaze', 'micron', 'nbft',
'netapp', 'nvidia', 'sandisk', 'scaleflux',
'seagate', 'shannon', 'ssstc', 'toshiba',
'transcend', 'virtium', 'wdc', 'ymtc', 'zns']
This is nice because when you type meson configure w/o any parameters, meson will display the choices available for this option:
There was a problem hiding this comment.
I did have it in there, but ended up removing it because I though that having to modify 3 places in order to put a new module in would be a bit impractical...
meson will display the choices available for this option
But this seems like a worthy benefit.
There was a problem hiding this comment.
it's not that often we get a new module. I think I would just add a comment to the meson.build file in plugins, to remind people also to update meson_options.txt.
By default, nvme-cli builds with all available plugins. However, there are some users who are not intersted in some particular plugins or they aim to create the smallest binaries possible. This patch introduces that feature into the nvme-cli's build system. Closes: linux-nvme#2907 Signed-off-by: Michal Rábek <[email protected]>
ec46d0f to
b09264c
Compare
|
Looks good to me |
|
Thanks! |
By default, nvme-cli builds with all available plugins. However, there are some users who are not intersted in some particular plugins or they aim to create the smallest binaries possible. This patch introduces that feature into the nvme-cli's build system.
Closes: #2907
The simple test script in the attachment runs the
mesonbuild with various parameters affecting the plugins selection.It is provided for the maintainers to verify that the patch does what it is supposed to. Note: the test script was generated by Claude Code.
test-plugin-selection.sh