Daniel Shahaf wrote on Tue, 18 Sep 2018 15:42 +0000:
> Off the top of my head, we have several options:
> 
> 1. Pass --with-pcre=foo to configure *and* make sure that configure dies
> if pcre is not found.  (The configure.ac patch can be upstreamed.)
> 
> 2. After running configure, check that the pcre line in config.modules
> has the expected values.  (not upstreamable)
> 
> 3. Patch Test/V07pcre to fail, rather than skip, if the PCRE module was
> not built.  (not upstreamable)
> 
> We can do more than one of these, e.g., #1+#3.

#3 is easy, attached.
From 9c8883c924a4b69ca0b22b0f6a851a9d5eddf07a Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <danie...@apache.org>
Date: Tue, 18 Sep 2018 16:30:24 +0000
Subject: [PATCH] Make sure the build will fail if PCRE is not available.

---
 debian/patches/hard-fail-unless-pcre.patch | 24 ++++++++++++++++++++++++
 debian/patches/series                      |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 debian/patches/hard-fail-unless-pcre.patch

diff --git a/debian/patches/hard-fail-unless-pcre.patch b/debian/patches/hard-fail-unless-pcre.patch
new file mode 100644
index 000000000..6f2dfafc9
--- /dev/null
+++ b/debian/patches/hard-fail-unless-pcre.patch
@@ -0,0 +1,24 @@
+Description: Fail the build if PCRE is not available
+ The upstream build system treats PCRE as an optional dependency, but in Debian
+ we want to fail hard if PCRE is not available, for compatibility reasons (see
+ #909084).
+Author: Daniel Shahaf <danie...@apache.org>
+Bug-Debian: https://bugs.debian.org/909114
+Forwarded: not-needed
+Last-Update: 2018-09-18
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+
+--- a/Test/V07pcre.ztst
++++ b/Test/V07pcre.ztst
+@@ -2,8 +2,8 @@
+ 
+   if ! zmodload -F zsh/pcre C:pcre-match 2>/dev/null
+   then
+-    ZTST_unimplemented="the zsh/pcre module is not available"
+-    return 0
++    echo >&2 "error: zsh/pcre not available"
++    return 1
+   fi
+ # Load the rest of the builtins
+   zmodload zsh/pcre
diff --git a/debian/patches/series b/debian/patches/series
index 14d4bba19..b173ee0ef 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ further-mitigate-test-suite-hangs.patch
 update-debian-sections.patch
 cherrypick_decc78c72__svn:_Allow_hyphens_in_command_name_aliases.patch
 cherry-pick-551ff842-43464-another-attachtty-fix.patch
+hard-fail-unless-pcre.patch

Reply via email to