Blame 0001-compilers-n_debug-if-release-and-buildtype-plain-sho.patch

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