mesonbuild / meson-python

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

Unexpected -Ccompile-args limitation #516

Closed Nic30 closed 11 months ago

Nic30 commented 11 months ago

Hello,

python3 -m build -Ccompile-args="-j1"  -Ccompile-args="--verbose" .

works as expected

python3 -m build -Ccompile-args="-j 1 --verbose" .

does not work.

...
+ /tmp/build-env-mpnhy9ak/bin/ninja -j 2 --verbose
ninja: fatal: invalid -j parameter

ERROR Backend subprocess exited when trying to invoke build_wheel

I am using:

[build-system]
requires = [
  "wheel", # python package distribution lib.
  "meson>=1.1.0", # meson buildsystem
  'meson-python>=0.12.1', # meson to pip adapter
  "ninja>=1.11.1", # build tool for meson to use
]
build-backend = 'mesonpy'

Example: https://app.circleci.com/pipelines/github/Nic30/hdlConvertor/145/workflows/46678c89-6bc2-4b1f-9545-8c299f17e2b6/jobs/210

I did not see it in doc (https://meson-python.readthedocs.io/en/latest/how-to-guides/config-settings.html).

Is this an expected behavior?

dnicolodi commented 11 months ago

Is this an expected behavior?

Yes. Different arguments need to be slit to be interpreted correctly.

I did not see it in doc

You don't see what?

[build-system]
requires = [
  "wheel", # python package distribution lib.
  "meson>=1.1.0", # meson buildsystem
  'meson-python>=0.12.1', # meson to pip adapter
  "ninja>=1.11.1", # build tool for meson to use
]

wheel is not used in the build process. Why do you depend on it?

Please don't add ninja to build-system.requires, meson-python will require it if ninja is not found on the system where the build is run. Adding it to the build dependencies causes it to be needlessly installed on systems where it is provided by the system and makes distribution maintainers life harder.

Nic30 commented 11 months ago

You don't see what?

Ah, my bad. I did not see that -Csetup-args is there twice and it is from this reason. And that is why I was asking this stupid question.

don't add ninja to build-system.requires

OK, my intent was to force up to date version because of some issue when linking 3rd party library with older ninja version.