From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IMePC1idWWKQFQEAgWs5BA (envelope-from ) for ; Fri, 15 Apr 2022 18:29:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id sO9DCFidWWKC/wAAauVa8A (envelope-from ) for ; Fri, 15 Apr 2022 18:29:12 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D72392DF28 for ; Fri, 15 Apr 2022 18:29:11 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 812E45F70E; Fri, 15 Apr 2022 16:23:51 +0000 (UTC) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by mail.notmuchmail.org (Postfix) with ESMTPS id 91CFD5F706 for ; Fri, 15 Apr 2022 16:23:49 +0000 (UTC) Received: by mail-ed1-x532.google.com with SMTP id 21so10471322edv.1 for ; Fri, 15 Apr 2022 09:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kvjq2ilo/NszfHDEyPzfuYtKao8V5++pOnI/meyn4Tg=; b=bZDYFqA8H9lnbYn5gVWH8hJcH8mfNAGRxnKeSSx8Z3DGCD5A61BiRV/7xZ2mDRn3zo 1wbYzNPY23Wdyf/b5yDXHBEEUwVtF5L5/u6zhCPNNiWmHkPgJMZEUxp7RhBKyaj7TJtk 3KGW8BPbEAwN/uS1W9veo0aZMjmEh4wNnZYk+f9N0rgB89CYClCCnsFmOXIStopszLYI ETjjaTmqYoszCv3nSuTPk+8Rr0ZA3hRkhFAUeFfTS5/skbz1m87N2cK5yuPOnsi7M6ln xVx6YcTGG3ymUSJeFhaTywzHwzGccaQBZjFyQqLHtUhUZ8V5yzzc+/zKqiTEnZnWyHjt HL+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kvjq2ilo/NszfHDEyPzfuYtKao8V5++pOnI/meyn4Tg=; b=iC1g64UwWrhvM4OTh/asnUa1qVBsLKKJLO+miMRBVdnToZXOdt0vrdbMNHolFChQj3 Fmk5JBdOswoL6AiNdy/yzJHGAkkBKyo9o9VkVHRR9/sFrWg/UtQrEZ2ECqBYp2sv5Nod cizP79tJjx3pHS99DMy9GYvMZxKbYByz/LObKyplqeJ/eh1PDuirVuQcLSwtJMrMGqhN PJHDS0Fhg6h9ad8ED8fz/QcWpDDT0L+NNOHRcHQ8W356+Vug6M62sC+qXKQ3+IC0soza 006nSwoOSAy1ifzH1TTAt02WjujF+FiWekSTbBndHIUzYrjtgI+5aERpaL1hg7J8GwA2 Vh3A== X-Gm-Message-State: AOAM533f6N17/Sv77z+HPfgrItAN9axZegcUCVPM/7W7xMDsJ9JzBpDR Fbcv2LlQOm1B7tlpKgnF9FpVil8UIEc= X-Google-Smtp-Source: ABdhPJxxN887RbdEkVhiLUV8yMDdJGl6/b9EU4bsWkiUWEHIuYAxnlsVv3v+rAfg7Qy0qdcRGKLM/g== X-Received: by 2002:a50:ee89:0:b0:41d:70eb:eb36 with SMTP id f9-20020a50ee89000000b0041d70ebeb36mr58257edr.24.1650039828316; Fri, 15 Apr 2022 09:23:48 -0700 (PDT) Received: from localhost ([2001:9e8:6a5f:6700:a6d1:2173:768a:678a]) by smtp.gmail.com with ESMTPSA id v2-20020a17090606c200b006a728f4a9bcsm1836742ejb.148.2022.04.15.09.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 09:23:47 -0700 (PDT) Sender: Michael J Gruber From: michaeljgruber+grubix+git@gmail.com To: notmuch@notmuchmail.org Subject: [PATCH] fix build without sfsexp Date: Fri, 15 Apr 2022 18:23:46 +0200 Message-Id: <50cd016213f4fbff4330ff27b05761c418bceb4c.1650039637.git.git@grubix.eu> X-Mailer: git-send-email 2.36.0.rc2.472.gf6a51f5f41 In-Reply-To: References: MIME-Version: 1.0 Message-ID-Hash: 5UGYKR7JBUBVR6VE2EE2WYMG7ERB4AKP X-Message-ID-Hash: 5UGYKR7JBUBVR6VE2EE2WYMG7ERB4AKP X-MailFrom: michaeljgruber+grubix+git@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Michael J Gruber X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650040151; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Nf+olJbjvVjOlTAvmznWJ73oOQY2OjS9HUY6NCKDtVY=; b=IEFZaAPwG1OpogyTx0PIIriWQ5ij+0LR6SsBBDtCCvSDhl/ls0ykWiUceJ7ffHhxim/Mfx wbABDRnS79m7xXUtFDdRyRO9N7WhWD9GToty3oSVNNNW/Sg1SymOaC8iwJ0XEFm3mJAso+ Yz9CeCKN6bEfnuZ7VKeBa4FN2sYItyzvRnzPjsPdjOZAip4IBAzjJHOcJR/QkijUgvEJbJ FbYEuscoLw6lc1+cqnVbtKVW80xDe3DmKkEPIA4eZg+Rcp50tAtna7BwYLFwRBSvHMEq+3 RZ54xhBxdTWfTCiHJgslRT4GlXwmfWr0HhIraEAf0PNCjMyhJ0Vah4n9fZzYTw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650040151; a=rsa-sha256; cv=none; b=K0DnEDEjKXiIrlvpbM5/eSTYoPd/ln4leXhkb/WVMNEgR0gUW2Z5ZmdMndjmW0KNF2mTcS YelSnC4YVu2Wh3MyQqm04BJ1GPg/X66A0xg9PuFLCdPCAN1pIHZ+A8/oMXcHyjmtw/QCu6 bldiGydy7igdje9R6fg6dBfjIIeZp9x65z9UWgszFrhFXvdusklosd2ga4A/ye4cZ9iyHF i3x3Jt95F54FNEmu640y7z4nPKjdWIqKklvi9zHMTwOxlDgJBfoowu2e49Mpogp6Ht1EWJ 9ij/cMCaPkfEjvDNuv9wCim42a9zHHYAKHbRp4d4qzegGP2h76V3KiHoQNZRKg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=bZDYFqA8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 6.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=bZDYFqA8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: D72392DF28 X-Spam-Score: 6.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: UXpjQBknWlMb From: Michael J Gruber a1d139de ("lib: add sexp: prefix to Xapian (infix) query parser.", 2022-04-09) introduced sfsexp infix queries. This requires the infix preprocessor to be built in in a way which does not require sfsexp when notmuch is built without it. Make the preprocessor throw a Xapian error in this case (and fix the build). Signed-off-by: Michael J Gruber --- Maybe something like this - I have not test *with* sfsexp, though. lib/database-private.h | 4 ---- lib/query.cc | 2 ++ lib/sexp-fp.cc | 4 ++++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/database-private.h b/lib/database-private.h index 657b1aa1..419b9fe6 100644 --- a/lib/database-private.h +++ b/lib/database-private.h @@ -354,10 +354,6 @@ _notmuch_query_string_to_xapian_query (notmuch_database_t *notmuch, std::string query_string, Xapian::Query &output, std::string &msg); -/* parse-sexp.cc */ -notmuch_status_t -_notmuch_sexp_string_to_xapian_query (notmuch_database_t *notmuch, const char *querystr, - Xapian::Query &output); notmuch_status_t _notmuch_query_expand (notmuch_database_t *notmuch, const char *field, Xapian::Query subquery, diff --git a/lib/query.cc b/lib/query.cc index b0937fcc..707f6222 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -227,6 +227,7 @@ _notmuch_query_ensure_parsed_xapian (notmuch_query_t *query) return NOTMUCH_STATUS_SUCCESS; } +#if HAVE_SFSEXP static notmuch_status_t _notmuch_query_ensure_parsed_sexpr (notmuch_query_t *query) { @@ -243,6 +244,7 @@ _notmuch_query_ensure_parsed_sexpr (notmuch_query_t *query) _notmuch_query_cache_terms (query); return NOTMUCH_STATUS_SUCCESS; } +#endif static notmuch_status_t _notmuch_query_ensure_parsed (notmuch_query_t *query) diff --git a/lib/sexp-fp.cc b/lib/sexp-fp.cc index ed26f6ec..1fdf5225 100644 --- a/lib/sexp-fp.cc +++ b/lib/sexp-fp.cc @@ -30,10 +30,14 @@ SexpFieldProcessor::operator() (const std::string & query_string) notmuch_status_t status; Xapian::Query output; +#if HAVE_SFSEXP status = _notmuch_sexp_string_to_xapian_query (notmuch, query_string.c_str (), output); if (status) { throw Xapian::QueryParserError ("error parsing " + query_string); } +#else + throw Xapian::QueryParserError ("sexp query parser not available"); +#endif return output; -- 2.36.0.rc2.472.gf6a51f5f41