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
meson.eclass */*: EMESON_BUILDTYPE & deduplicate some debug logic #35593
base: master
Are you sure you want to change the base?
Conversation
Pull Request assignmentSubmitter: @mjsir911 dev-libs/efl: @juippis Linked bugsNo bugs to link found. If your pull request references any of the Gentoo bug reports, please add appropriate GLEP 66 tags to the commit message and request reassignment. If you do not receive any reply to this pull request, please open or link a bug to attract the attention of maintainers. Missing GCO sign-offPlease read the terms of Gentoo Certificate of Origin and acknowledge them by adding a sign-off to all your commits. In order to force reassignment and/or bug reference scan, please append Docs: Code of Conduct ● Copyright policy (expl.) ● Devmanual ● GitHub PRs ● Proxy-maint guide |
a064f2f
to
d066871
Compare
d066871
to
aba9921
Compare
Pull request CI reportReport generated at: 2024-03-02 00:53 UTC There are existing issues already. Please look into the report to make sure none of them affect the packages in question: |
Pull request CI reportReport generated at: 2024-03-02 01:07 UTC There are existing issues already. Please look into the report to make sure none of them affect the packages in question: |
dev-libs/glib/glib-2.78.4-r1.ebuild
Outdated
use debug && EMESON_BUILDTYPE=debug | ||
|
||
local emesonargs=( | ||
-Dbuildtype=$(usex debug debug plain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This first commit makes sense. People really should have used it for consistency, indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can drop the two other commits and/or make a new PR and/or would it be possible to just merge in this (and the glib_debug) commit?
eclass/meson.eclass
Outdated
@@ -368,7 +368,8 @@ setup_meson_src_configure() { | |||
|
|||
|
|||
if in_iuse debug; then | |||
use debug && EMESON_BUILDTYPE=debug | |||
MESONARGS+=( -Db_ndebug=$(usex debug false true) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is setting -DNDEBUG now, for all ebuilds that have a USE="-debug".
How is this handled for other build systems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... it's very painful: https://bugs.gentoo.org/884791. We used to pass -DNDEBUG
in cmake-utils.eclass and cmake.eclass for a time, then we stopped, and every so often, we get broken software as a result..
eclass/meson.eclass
Outdated
if in_iuse debug; then | ||
use debug && EMESON_BUILDTYPE=debug | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there meson.eclass using ebuilds that define IUSE=debug but didn't set the buildtype?
Note in general this feels a bit weird. The purpose of IUSE=debug is:
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
but the debug buildtype in meson simply adds things like -g, which is specifically intended to not be the same thing.
This is why ebuilds declare it locally if they need it, typically because the meson.build files themselves check the value of the "debug" buildtype to enable additional "debug codepaths, like asserts and extra output".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -Dn_debug
flag specifically enables/disables asserts:
https://mesonbuild.com/Builtin-options.html#base-options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To answer the question though, yes there are packages that don't set the buildtype that define IUSE=debug:
app-emulation/dxvk
app-emulation/vkd3d-proton
dev-cpp/glibmm
dev-db/postgresql
games-emulation/dosbox-staging
gnome-base/gnome-control-center
gnome-base/gnome-desktop
gnome-base/gnome-settings-daemon
gnome-extra/nautilus-sendto
gui-libs/vte
media-gfx/geeqie
media-libs/gegl
media-libs/harfbuzz
media-libs/opus
media-libs/rlottie
net-irc/hexchat
net-libs/gnome-online-accounts
net-libs/libsrtp
net-misc/eventd
net-misc/networkmanager
net-p2p/transmission-remote-gtk
sys-apps/dbus
sys-apps/kmscon
sys-apps/openrc
sys-block/open-iscsi
www-client/elinks
x11-libs/cairo
x11-libs/pango
x11-libs/vte
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -Dn_debug flag specifically enables/disables asserts:
https://mesonbuild.com/Builtin-options.html#base-options
Yes, that would be why this review comment is NOT about the ndebug option, but about the buildtype option.
(It is b_ndebug, not n_debug, however.)
aba9921
to
78312c6
Compare
Pull request CI reportReport generated at: 2024-03-03 04:04 UTC There are existing issues already. Please look into the report to make sure none of them affect the packages in question: |
@eli-schwartz would it make sense to re-push the PR with only the first two commits? |
I think so, yes. They are uncontroversial, at least. For the first commit in particular I think it makes sense to provide a more detailed commit message explaining why the change was made. |
78312c6
to
725323f
Compare
glib has a special flag signalling a debug build, without this, G_ENABLE_DEBUG is only set iff --debug=true AND --optimization={0,g} (which, admittedly, -Dbuildtype=debug *does* do. It's just better to be explicit about these things) Signed-off-by: Marco Sirabella <marco@sirabella.org>
Signed-off-by: Marco Sirabella <marco@sirabella.org>
725323f
to
dcd9d1a
Compare
Pull request CI reportReport generated at: 2024-03-14 15:28 UTC There are existing issues already. Please look into the report to make sure none of them affect the packages in question: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, forgot to actually respond.
For batching reasons I opened a mega-PR above ^^. It cherry-picks these commits directly. |
Not sure if this PR is an overstep or if the commits are grouped together but this will help to potentially avoid issues like https://bugs.gentoo.org/925949
Also, EMESON_BUILDTYPE hasn't been used anywhere previously?
Of note is that commit d066871 introduces a change in the build process for some packages
eg glib that didn't previously set
-Db_ndebug
whenuse debug