Package: apparmor
Version: 2.13-6
Severity: normal
X-Debbugs-Cc: Jamie Strandboge <ja...@ubuntu.com>

See discussion that starts on
https://salsa.debian.org/apparmor-team/apparmor/merge_requests/9#note_35068

The attached patch implements the solution Jamie and I agreed on but
it breaks the autopkgtests:

simple.pl (Wstat: 768 Tests: 71577 Failed: 3)
  Failed tests:  71092, 71482-71483
  TODO passed:   71447, 71458-71459, 71493, 71576
  Non-zero exit status: 3

… so more work is needed here, to adjust the test suite to the
config change we want to apply.

Note that the tests do pass when they're run on a system where
/etc/apparmor/parser.conf does *not* contain
Optimize=no-expr-simplify.

>From a9d5816aed4a8b2dfa1e9505ef862cd9289b370f Mon Sep 17 00:00:00 2001
From: intrigeri <intrig...@boum.org>
Date: Wed, 1 Aug 2018 00:51:13 +0000
Subject: [PATCH 1/2] parser.conf: turn off expression tree simplification,
 that makes performance much worse in some cases.

---
 ...n-off-expression-tree-simplification.patch | 26 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 debian/patches/debian/Turn-off-expression-tree-simplification.patch

diff --git a/debian/patches/debian/Turn-off-expression-tree-simplification.patch b/debian/patches/debian/Turn-off-expression-tree-simplification.patch
new file mode 100644
index 000000000..a85abffd0
--- /dev/null
+++ b/debian/patches/debian/Turn-off-expression-tree-simplification.patch
@@ -0,0 +1,26 @@
+From: intrigeri <intrig...@boum.org>
+Date: Wed, 1 Aug 2018 00:45:18 +0000
+Subject: Turn off expression tree simplification.
+
+As discussed on
+https://salsa.debian.org/apparmor-team/apparmor/merge_requests/9, in quite a few
+situations expression tree simplification makes compilation dramatically slower.
+In one single pathological case (Evince profile) it improves things but affected
+systems, i.e. desktop systems, are more beefy and should cope with that.
+---
+ parser/parser.conf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/parser/parser.conf b/parser/parser.conf
+index 641cf1d..769de83 100644
+--- a/parser/parser.conf
++++ b/parser/parser.conf
+@@ -51,7 +51,7 @@
+ #equiv
+ 
+ ## Turn off expr tree simplification
+-#Optimize=no-expr-simplify
++Optimize=no-expr-simplify
+ 
+ ## Turn off DFA minimization
+ #Optimize=no-minimize
diff --git a/debian/patches/series b/debian/patches/series
index ff280ade1..99732f2e8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,5 +16,6 @@ debian/allow-access-to-ibus-socket.patch
 debian/non-linux.patch
 debian/Add-snapd-profiles-directory-support-to-profiles_names_li.patch
 debian/Move-the-cache-to-var-cache.patch
+debian/Turn-off-expression-tree-simplification.patch
 debian-only/pin-feature-set.patch
 debian-only/aa-notify-point-to-Debian-documentation.patch
-- 
2.18.0

Reply via email to