Drop -Db_ndebug=true and just fix it instead

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2019-04-08 13:03:37 +02:00
parent 96171cb812
commit 741aa32203
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C
3 changed files with 48 additions and 30 deletions

View File

@ -0,0 +1,42 @@
From d88bf0eb80e2531a8017de4efd4eb02f1e3081ec Mon Sep 17 00:00:00 2001
From: Dylan Baker <dylan@pnwbakers.com>
Date: Mon, 25 Mar 2019 11:35:18 -0700
Subject: [PATCH] compilers: n_debug=if-release and buildtype=plain should not
enable assertions
It's a bit odd that it doesn't, and has resulted in bugs in distro
packaging.
Fixes #5141
---
docs/markdown/snippets/debug-if-release-plain.md | 4 ++++
mesonbuild/compilers/compilers.py | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
create mode 100644 docs/markdown/snippets/debug-if-release-plain.md
diff --git a/docs/markdown/snippets/debug-if-release-plain.md b/docs/markdown/snippets/debug-if-release-plain.md
new file mode 100644
index 00000000..013e6c83
--- /dev/null
+++ b/docs/markdown/snippets/debug-if-release-plain.md
@@ -0,0 +1,4 @@
+## n_debug=if-release and buildtype=plain means no asserts
+
+Previously if this combination was used then assertions were enabled,
+which is fairly surprising behavior.
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index da029806..66195dc1 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -510,7 +510,7 @@ def get_base_compile_args(options, compiler):
try:
if (options['b_ndebug'].value == 'true' or
(options['b_ndebug'].value == 'if-release' and
- options['buildtype'].value == 'release')):
+ options['buildtype'].value in {'release', 'plain'})):
args += ['-DNDEBUG']
except KeyError:
pass
--
2.21.0

View File

@ -1,27 +0,0 @@
From 83b32f0efe939fe8cb41c5f94c3c85e2002691d0 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Mon, 25 Mar 2019 17:00:32 +0100
Subject: [PATCH] rpm: Always set b_ndebug to true
'if-release' does not catch buildtype=plain, so we need to do this.
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
data/macros.meson | 1 +
1 file changed, 1 insertion(+)
diff --git a/data/macros.meson b/data/macros.meson
index 05d21e58..73a31ab7 100644
--- a/data/macros.meson
+++ b/data/macros.meson
@@ -21,6 +21,7 @@
--sharedstatedir=%{_sharedstatedir} \
--wrap-mode=%{__meson_wrap_mode} \
--auto-features=%{__meson_auto_features} \
+ -Db_ndebug=true \
%{_vpath_srcdir} %{_vpath_builddir} \
%{nil}}
--
2.21.0

View File

@ -4,14 +4,14 @@
Name: meson
Version: 0.50.0
Release: 2%{?dist}
Release: 3%{?dist}
Summary: High productivity build system
License: ASL 2.0
URL: http://mesonbuild.com/
Source: https://github.com/mesonbuild/meson/archive/%{version}/%{name}-%{version}.tar.gz
# https://github.com/mesonbuild/meson/pull/5142
Patch0001: 0001-rpm-Always-set-b_ndebug-to-true.patch
# https://github.com/mesonbuild/meson/commit/d88bf0eb80e2531a8017de4efd4eb02f1e3081ec
Patch0001: 0001-compilers-n_debug-if-release-and-buildtype-plain-sho.patch
BuildArch: noarch
Obsoletes: %{name}-gui < 0.31.0-3
@ -103,6 +103,9 @@ export MESON_PRINT_TEST_OUTPUT=1
%{_datadir}/polkit-1/actions/com.mesonbuild.install.policy
%changelog
* Mon Apr 08 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.50.0-3
- Drop -Db_ndebug=true and just fix it instead
* Mon Mar 25 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.50.0-2
- Set -Db_ndebug=true