-
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
buildtype not derived from debug and optimization options, with surprising results #11645
Comments
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
bruchar1
added a commit
to bruchar1/meson
that referenced
this issue
Jan 4, 2024
By adding a flag to indicate whether an option was explicitly set or not, it is now possible to update the value of `buildtype` from the values of `debug` and `optimization`, without modifying options that are explicitly set. Fixes mesonbuild#11645 Fixes mesonbuild#5814 (maybe this one was already fixed, but at least a test proves it works)
bruchar1
added a commit
to bruchar1/meson
that referenced
this issue
Jan 4, 2024
By adding a flag to indicate whether an option was explicitly set or not, it is now possible to update the value of `buildtype` from the values of `debug` and `optimization`, without modifying options that are explicitly set. Fixes mesonbuild#11645 Fixes mesonbuild#5814 (maybe this one was already fixed, but at least a test proves it works)
bruchar1
added a commit
to bruchar1/meson
that referenced
this issue
Jan 12, 2024
By adding a flag to indicate whether an option was explicitly set or not, it is now possible to update the value of `buildtype` from the values of `debug` and `optimization`, without modifying options that are explicitly set. Fixes mesonbuild#11645 Fixes mesonbuild#5814 (maybe this one was already fixed, but at least a test proves it works)
bruchar1
added a commit
to bruchar1/meson
that referenced
this issue
Feb 21, 2024
By adding a flag to indicate whether an option was explicitly set or not, it is now possible to update the value of `buildtype` from the values of `debug` and `optimization`, without modifying options that are explicitly set. Fixes mesonbuild#11645 Fixes mesonbuild#5814 (maybe this one was already fixed, but at least a test proves it works)
bruchar1
added a commit
to bruchar1/meson
that referenced
this issue
Feb 22, 2024
By adding a flag to indicate whether an option was explicitly set or not, it is now possible to update the value of `buildtype` from the values of `debug` and `optimization`, without modifying options that are explicitly set. Fixes mesonbuild#11645 Fixes mesonbuild#5814 (maybe this one was already fixed, but at least a test proves it works)
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
The documentation states that the
buildtype
option, when not explicitly provided, is calculated from thedebug
andbuildtype
options:However, this is not the case.
To reproduce, configure any Meson project withe
meson setup -Ddebug=false
and runmeson configure
to observe thatbuildtype
is still reported asdebug
.If Meson behavior would be based only on the
debug
andoptimization
options, this would be maybe only a cosmetic issue. However, theb_vscrt
option default value isstatic_from_buildtype
, which, as the name suggests, looks atbuildtype
for deriving which runtime library to link with. This results indebug=false
builds to be linked with the debug version of the runtime library, unless thebuildype
is also explicitly changed. Another possibly confusing option isb_ndebug
when set toif-release
. It results in-DNDEBUG
being passed to the compiler only whenbuildtype
is explicitly set torelease
however I've seen multiple instances where it was believed thatif-release
is synonym withdebug=false
. I think there are other places wherebuildtype
may be used for behavior decisions.This would not be too bad if Meson would not steer users away from using the
buildtype
and either ofdebug
andoptimization
options at the same time with a warning: there are instances where just settingdebug
oroptimization
is not enough to obtain the desired behavior.I think it is already recognized that the
buildtype
concept is flawed and it is kept around for backward compatibility (correct me if I'm wrong) see for example #10808 (I also remember a blog post from Jussi, but I could be making this up) but we are stuck with it.I wish that Meson could base all its decision based only on the
debug
andoptimization
flags, converting thebuildtype
option to values for these two when parsing options and then forgetting about it. I don't know if this is feasible. Failing that, the documentation needs some updates (see above the missing translation fromdebug
andoptimization
tobuildtype
advertised in the documentation) and needs some more flashy warnings for the foot guns above.The text was updated successfully, but these errors were encountered: