-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add b_ndebug=auto
because b_ndebug=if-release
is misleading
#8308
Comments
Alternative KISS suggestion (from confused co-maintainer 😅 ):
Where:
|
I don't like the names starting with |
bruchar1
added a commit
to bruchar1/meson
that referenced
this issue
Dec 1, 2023
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See mesonbuild#10808. Relates to: - mesonbuild#11645 - mesonbuild#12096 - mesonbuild#5920 - mesonbuild#5814 - mesonbuild#8220 - mesonbuild#8493 - mesonbuild#9540 - mesonbuild#10487 - mesonbuild#12265 - mesonbuild#8308 - mesonbuild#8214 - mesonbuild#7194 - mesonbuild#11732
bruchar1
added a commit
to bruchar1/meson
that referenced
this issue
Dec 2, 2023
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See mesonbuild#10808. Relates to: - mesonbuild#11645 - mesonbuild#12096 - mesonbuild#5920 - mesonbuild#5814 - mesonbuild#8220 - mesonbuild#8493 - mesonbuild#9540 - mesonbuild#10487 - mesonbuild#12265 - mesonbuild#8308 - mesonbuild#8214 - mesonbuild#7194 - mesonbuild#11732
bruchar1
added a commit
to bruchar1/meson
that referenced
this issue
Dec 5, 2023
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See mesonbuild#10808. Relates to: - mesonbuild#11645 - mesonbuild#12096 - mesonbuild#5920 - mesonbuild#5814 - mesonbuild#8220 - mesonbuild#8493 - mesonbuild#9540 - mesonbuild#10487 - mesonbuild#12265 - mesonbuild#8308 - mesonbuild#8214 - mesonbuild#7194 - mesonbuild#11732
jpakkane
pushed a commit
that referenced
this issue
Dec 23, 2023
gerioldman
pushed a commit
to gerioldman/meson
that referenced
this issue
Jul 2, 2024
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See mesonbuild#10808. Relates to: - mesonbuild#11645 - mesonbuild#12096 - mesonbuild#5920 - mesonbuild#5814 - mesonbuild#8220 - mesonbuild#8493 - mesonbuild#9540 - mesonbuild#10487 - mesonbuild#12265 - mesonbuild#8308 - mesonbuild#8214 - mesonbuild#7194 - mesonbuild#11732
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is not a big problem but rather a papercut issue that will keep hurting users as the time moves on - perhaps it's time to design a way out of it?
Describe the bug
if-release
name is confusing, that's the gist of it.Background:
I am in the process of porting the project to Meson (dosbox-staging/dosbox-staging#854) - while working on it, I discovered that NDEBUG is not automatically turned on for release builds - we don't want to define it in release because we rely heavily on C asserts in code for detecting potential bugs - we expect to catch these asserts during testing and don't want them affecting end-users of our emulator. Until now (with autoconf buildsystem) our recommendation to packagers was to pass NDEBUG flag explicitly because some (all?) Linux distributions don't have this flag included in their default CPP flags (of course, some packagers promptly ignored our recommendation to the detriment of end users).
OK, so soon I discovered that there's
b_ndebug=if-release
option, which works perfectly for this usecase (thank you for including it! :)). However due toif-release
name, few days after adding it I was already confused if this option works forplain
builds or not.Then I discovered that in meson < 0.51.0 the behaviour was different and
plain
builds required explicitNDEBUG
CPP flag…Then the first packager testing our meson buildsystem got confused about how
NDEBUG
,if-release
, andplain
interoperate… then my co-maintainer got confused as well… It seems like a pattern ;)Suggested behavior
Right now this option works this way:
if-release
turns it to true forbuildtype=release
andbuildtype=plain
(and maybe others? I don't know)I suggest changing it to:
With
auto
behaving exactly the same way asif-release
does now.release-only
behaving likeif-release
worked in meson < 0.51.0 (other names could be ok, just please - nothing withif-
prefix…iff-release
might work)And then deprecate usage of
if-release
after some time.I think this solution would cover all the cases.
Similar bug reports
There's #2566 already - however I don't argue for changing the default. I believe each OS/distro had their reasons in designing the default set of flags they use, which probably means there are C/C++ projects out there that prefer to keep NDEBUG flag undefined for end-users (I imagine some projects might want to do it for security-related reasons). C compilers nor libc implementations don't define this flag automatically depending on other compiler flags, and I think such honest behaviour is fine in C world.
The text was updated successfully, but these errors were encountered: