mesonbuild / meson-python

Meson PEP 517 Python build backend
https://mesonbuild.com/meson-python/
MIT License
131 stars 69 forks source link

Warn (or error?) on unhandled options passed to `meson install` #670

Open WillAyd opened 2 months ago

WillAyd commented 2 months ago

It appears that having:

[tool.meson-python.args]
install = ['--skip-subprojects nanoarrow']

is a no-op. To actually skip the subproject, I have to use:

[tool.meson-python.args]
install = ['--skip-subprojects=nanoarrow']

Is this distinction intentional?

dnicolodi commented 1 month ago

The correct form is either install = ['--skip-subprojects', 'nanoarrow'] or install = ['--skip-subprojects=nanoarrow']. The install = ['--skip-subprojects nanoarrow'] form passes a single --skip-subprojects nanoarrow flag, which is incorrect. I don't know why this does not result in an error though.

dnicolodi commented 1 month ago

meson-python allows to specify options to be passed to the different meson subcommands invoked during the build: meson setup, meson compile, meson install. However, it does not really execute meson install but performs equivalent operations. For this reason, the options that would be passed to meson install are interpreted directly by meson-python. meson-python supports the --tags and --skip-subprojects options and ignores everything else. As reported by the OP, this may cause confusion when options are misspelled or when unsupported options are specified.

Emitting an error when an unsupported option is specified may be the best thing to do. A warning should be emitted, at least.