Closed ngoldbaum closed 1 year ago
When reporting an issue it is desirable to explicitly state what you are trying to achieve, the solution you tried, how it did not work, preferably corroborated by some evidence. The description of this issue allows us only to guess what you are trying to do and why you thin it does not work as expected.
I guess you are trying to obtain a build with debug symbols and with assertions enabled. To achieve that you added
[tool.meson-python.args]
setup = ["-Dbuildtype=debug"]
However, in your opinion that is not sufficient in enabling assertions (ie compile without the -DNDEBUG
compilation flag). Why do you think this is the case? The combination of -Dn_debug=if-release -Dbuildtype=debug
should not result in the -DNDEBUG
compilation flag being set.
Sorry if the initial description wasn’t clear. You’re right that I’d expect the combination of -Dn_debug=if-release
and -Dbuildtype=debug
to not set -DNDEBUG
. However, I’m finding that not to be the case, I need to explicitly set -Dn_debug=false
.
How did you verify that? I just tested it and it works as expected, see #442
Hmm, I can't seem to reproduce what I was seeing yesterday in my project. Sorry for the noise! I'll try to write a failing test next time I report a bug.
A complete test is not necessary, however providing a way to reproduce the issue would be nice.
Glad this is working as expected after all 😅. Choosing defaults has turned out to be tricky enough already.
For whatever reason I need to have
setup = ["-Dbuildtype=debug", "-Db_ndebug=false"]
in mypyproject.toml
, not justsetup = ["-Dbuildtype=debug"]
.I think what's happening is the default meson settings
meson-python
sets all need to be explicitly overriden. If I just pass-Dbuildtype=debug
, themeson setup
commandmeson-python
creates is:So I guess meson-python's settings take precedence because they are explicitly set, but then my custom settings for the build type override that, but since I don't have a custom
ndebug
, the previously setif-release
choice doesn't get reset.Maybe meson-python could check if there is a user-provided
buildtype
and not setndebug
orbuildtype
if so?