Skip to content

build: add an option to specify a list of plugins to include#3145

Merged
igaw merged 1 commit intolinux-nvme:masterfrom
MichaelRabek:feature-select-plugins
Mar 10, 2026
Merged

build: add an option to specify a list of plugins to include#3145
igaw merged 1 commit intolinux-nvme:masterfrom
MichaelRabek:feature-select-plugins

Conversation

@MichaelRabek
Copy link
Copy Markdown
Contributor

@MichaelRabek MichaelRabek commented Mar 9, 2026

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 meson build 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

@igaw
Copy link
Copy Markdown
Collaborator

igaw commented Mar 10, 2026

Looks good to me.

@martin-belanger do you agree?

Comment thread meson_options.txt
value : false,
description : 'building for PyPI (use short soversion, e.g. libnvme.so.3)'
)
option(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, that will be a bit more elegant solution. I will edit the patch.

@MichaelRabek MichaelRabek force-pushed the feature-select-plugins branch from 692e8b2 to ec46d0f Compare March 10, 2026 14:42
Comment thread meson_options.txt Outdated
option(
'plugins',
type : 'array',
value: ['all'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Copy Markdown
Contributor Author

@MichaelRabek MichaelRabek Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@martin-belanger
Copy link
Copy Markdown

Looks good to me

@igaw igaw merged commit e550ee8 into linux-nvme:master Mar 10, 2026
26 checks passed
@igaw
Copy link
Copy Markdown
Collaborator

igaw commented Mar 10, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: add option to select which plugin should be included

3 participants