mesonbuild / mesonbuild/meson-python
Default -Dbuildtype=release cannot be overridden by native file
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 180
- Forks
- 93
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 18
Description
I find it quite convenience to package together build options using Meson's [native files](https://mesonbuild.com/Native-environments.html). Unfortunately if I try to set the build type in a native file like e.g.:
```toml
[built-in options]
buildtype = 'debug'
```
this will not override the `-Dbuildtype` given by meson-python here (even though it's given earlier in the command line):
https://github.com/mesonbuild/meson-python/blob/cfcfb3554800d42c859d04309da2c1973c9f97ce/mesonpy/__init__.py#L874
I'm not sure whether this is something that should be fixed in Meson or meson-python. One workaround could be to put these defaults in a native file specified earlier in the command line. This should cause them to be overwritten by the user native file correctly.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in mesonpy/__init__.py around line 874 and reproduce the native-file buildtype behavior described in the issue. Compare how meson-python supplies -Dbuildtype with Meson's native-file precedence rules, then verify that a native file can provide the intended default without preventing explicit user settings from taking effect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100