Commit graph

7507 commits

Author SHA1 Message Date
David Bremner
112c53535a test: add known broken test for bad utf8 in config
We should ideally print an informative error message, but at the very
least we should not exit with success.
2023-09-23 08:22:51 -03:00
David Bremner
6ed3484749 debian: start changelog for 0.38.1~pre0-1 2023-09-23 08:16:20 -03:00
David Bremner
14bc0cc56b NEWS: add header for 0.38.1
Actual news items to be filled in after they are applied.
2023-09-23 08:14:21 -03:00
David Bremner
50aaab91b5 version: update to 0.38.1~pre0
Start preparations for point release
2023-09-23 08:12:06 -03:00
Eric Blake
e392daa729 .gitignore: ignore __pycache__
Python likes to leave behind cache files; noticeable when doing an
in-tree build.
2023-09-19 06:50:40 -03:00
David Bremner
d4e0aaa76b devel/nmweb: read mail files in binary mode.
"ju" reported on IRC that browsing

    https://nmbug.notmuchmail.org/nmweb/show/20160719094205.qmf5sjnja6crt5t3%40gotlib

crashed. The underlying issue is that python3 defaults to utf8
decoding files unless they are opened in binary mode. The file in
question (in the nmbug archive; it depends a bit on the routing the
message took) has

        Content-Type: text/plain; charset=iso-8859-1
        Content-Transfer-Encoding: 8bit

and some of it is not valid utf8.
2023-09-18 06:13:25 -03:00
David Bremner
28a0978ec0 Merge branch 'release' 2023-09-13 20:28:42 -03:00
David Bremner
40a44bfe61 debian: upload 0.38-2: disable most autopkgtests 2023-09-13 20:04:33 -03:00
David Bremner
cb309ae03a Merge branch 'release' 2023-09-12 08:56:22 -03:00
David Bremner
60b5ea319a bindings/python-cffi: clean up notmuch2.egg-info
This is created (at least) by the Debian build, but there seems no
harm in cleaning it for everyone.
2023-09-12 08:37:38 -03:00
David Bremner
c31f8c0b3b debian: note introduction of autopkgtests
Having autopkgtests changes Debian package migration (for better and
worse), so make a note when they were introduced to unstable.
2023-09-12 08:33:35 -03:00
David Bremner
a76c16b75e NEWS: quote function name
This avoids spurious underline/italics when exporting to markdown.
2023-09-12 08:31:49 -03:00
David Bremner
972283777a NEWS: set release date for 0.38 2023-09-12 08:28:57 -03:00
David Bremner
b21747e0c3 build: clean up __pycache__ directories
These are generated indirectly by certain uses of python in the build.
2023-09-12 08:07:37 -03:00
David Bremner
14e05a3eee debian: rely on main notmuch (dist)clean.
The python setuputils clean relys on including _notmuch_config.py,
which is cleaned up. Rather than relying on careful ordering, just do
all the cleaning from the GNU Make based build system.
2023-09-12 07:48:54 -03:00
David Bremner
32f24b97d0 bindings/python-cffi: clean up _notmuch_config.py
_notmuch_config.py is generated by configure, and cannot be cleaned up
by the current python build system, since it is imported as a module
by that same build system.

Use DISTCLEAN rather than CLEAN for consistency with other configure
related things.
2023-09-12 07:37:32 -03:00
David Bremner
db8bf6f7ad debian: changelog for 0.38-1 2023-09-11 20:19:25 -03:00
David Bremner
139ea43f3d version: bump to 0.38 2023-09-11 19:56:21 -03:00
David Bremner
8dc8cedb3b NEWS: NEWS for 0.38 2023-09-09 19:49:36 -03:00
David Bremner
5303e35089 Merge branch 'release' 2023-09-03 10:20:40 -03:00
David Bremner
2c81de8f5f debian: changelog for 0.38~rc2-1 2023-09-03 09:11:53 -03:00
David Bremner
ed5b8f65fc version: bump to 0.31~rc2 2023-09-03 09:09:22 -03:00
Kevin Boulain
c1a23a64ae test: suppress all interceptors in glib
On ppc64el, races are detected by TSan:
  WARNING: ThreadSanitizer: data race (pid=4520)
    Read of size 8 at 0x7ffff20016c0 by thread T1:
      #0 strlen ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:386 (libtsan.so.2+0x77c0c)
      #1 strlen ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:378 (libtsan.so.2+0x77c0c)
      #2 g_strdup ../../../glib/gstrfuncs.c:362 (libglib-2.0.so.0+0xa4ac4)

    Previous write of size 8 at 0x7ffff20016c0 by thread T2:
      #0 malloc ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:647 (libtsan.so.2+0x471f0)
      #1 g_malloc ../../../glib/gmem.c:130 (libglib-2.0.so.0+0x7bb68)

    Location is heap block of size 20 at 0x7ffff20016c0 allocated by thread T2:
      #0 malloc ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:647 (libtsan.so.2+0x471f0)
      #1 g_malloc ../../../glib/gmem.c:130 (libglib-2.0.so.0+0x7bb68)

This appears to be a false positive in GLib, as explained at
https://gitlab.gnome.org/GNOME/glib/-/issues/1672#note_1831968
In short, a call to fstat fails under TSan and GLib's g_sterror will
intern the error message, which will be reused by other threads.

Since upstream appears to be aware that GLib doesn't play nicely with
TSan, suppress everything coming from the library instead of
maintaining a fine grained list.

Reported at
https://buildd.debian.org/status/fetch.php?pkg=notmuch&arch=ppc64el&ver=0.38%7Erc0-1&stamp=1692959868&raw=0
2023-09-02 07:45:30 -03:00
Michael J Gruber
a84dc2f7e6 compat: probe for strcasestr more thoroughly
Depending on compiler (gcc, g++, clang) and standard options (c99, c11),
string.h may or may not include strings.h, leading to possibly missing
or conflicting declarations of strcasestr.

Include both so that both detection and compilation phases use the same
(possibly optimised) implementations.

Suggested-by: Thomas Schneider <qsx@chaotikum.eu>
Suggested-by: Florian Weimer <fweimer@redhat.com>
Suggested-by: Tomi Ollila <tomi.ollila@iki.fi>
2023-08-27 19:39:23 -03:00
David Bremner
9a1126241d debian: changelog for 0.38~rc1-1 2023-08-26 08:31:49 -03:00
David Bremner
240e9fff90 version: bump to 0.38~rc1 2023-08-26 08:29:45 -03:00
David Bremner
90c6182825 debian: skip T810-tsan on ppc64el
Hopefully just a temporary measure.
2023-08-26 08:28:33 -03:00
David Bremner
25c933d7e6 debian: use architecture.mk
I plan to add further architecture dependent checks, which makes this
preferable to directly calling dpkg-architecture.
2023-08-26 08:22:33 -03:00
David Bremner
115d4d69eb test: minimize impact of native compilation.
Native compilation is kindof useless in the test suite because we
throw away the cache after every subtest.  The test suite could in
principle share an eln cache within a given test file; for now try to
minimize the amount of native-compilation. There is an intermittent
bug where emacs loses track of its default-directory; I suspect (but
have no proof) that bug is related to native compilation and/or race
conditions. This patch seems to prevent that bug (or at least reduce
its frequency).
2023-08-26 07:45:36 -03:00
David Bremner
8c8fda965f debian: set suite to experimental 2023-08-24 10:56:33 -03:00
David Bremner
5ed121bed9 doc: update copyright date 2023-08-24 08:03:46 -03:00
David Bremner
695f663f81 debian: changelog for 0.38~rc0-1 2023-08-24 08:00:55 -03:00
David Bremner
aa5674fce0 NEWS: start NEWS for 0.38 2023-08-24 07:58:51 -03:00
David Bremner
2f874fb2cc version: set up 0.38~rc0 2023-08-24 07:58:19 -03:00
David Bremner
368e0f61d5 test/setup: ignore blank lines in generated config
The presense of the blank lines between sections depends on the
version of glib. Strip them before comparison.
2023-08-21 19:30:54 -03:00
David Bremner
df45194d5f CLI/config: simulate top level comments when creating config
According to discussion on

          https://gitlab.gnome.org/GNOME/glib/-/issues/3078

it looks like upstream will stop supporting top of file comments.

It is questionable whether we really need this feature, but for now
update notmuch-config to simulate it.
2023-08-21 19:30:54 -03:00
David Bremner
1719b9e568 test/emacs: adapt to breaking change in Gnus defaults
As of Emacs 29.1, In-Reply-To is in the default value for
message-hidden-headers. We actually want to see that in the test
suite, so remove it again. To future proof the tests, fix a default
value for message-hidden-headers specifically for the test suite.
2023-08-20 14:32:02 -03:00
David Bremner
b6f144abe1 lib/n_d_remove_message: do not remove unique filename
It is wasteful to remove a filename term when the whole message
document is about to be removed from the database. Profiling with perf
shows this takes a significant portion of the time when cleaning up
removed files in the database.

The logic of n_d_remove_message becomes a bit more convoluted here in
order to make the change minimal.

It is possible that this function can be further optimized, since the
expansion of filename terms into filenames is probably not needed
here.
2023-07-22 07:15:59 -03:00
David Bremner
d93d49b6ae lib/message: check message type before deleting document
It isn't really clear how this worked before. Traversing the terms of
a document after deleting it from the database seems likely to be
undefined behaviour at best
2023-07-22 07:11:46 -03:00
David Bremner
08ca74d715 debian: add autopkgtests
We generate output to stderr for BROKEN tests, which are not failures,
so tell the test runner not to fail because of output on stderr.
2023-07-21 07:41:50 -03:00
David Bremner
ec26eeaeec test: support testing notmuch as installed
We put some effort into testing the built copy rather than some
installed copy. On the other hand for people like packagers, testing
the installed copy is also of interest.

When NOTMUCH_TEST_INSTALLED is set to a nonempty value, tests do not
require a built notmuch tree or running configure.

Some of the tests marked as broken when running against installed
notmuch are probably fixable.
2023-07-21 07:41:50 -03:00
David Bremner
73f3081160 test: Guess a value for NOTMUCH_PYTHON
python3 will work for many people, and reduce the friction to running
the tests without running configure first.
2023-07-21 07:07:43 -03:00
David Bremner
f6fcdf12da test: check for empty/missing files in test_expect_equal_message_body
Messages can have empty bodies, but empty files are not messages.
2023-07-21 07:07:43 -03:00
David Bremner
dfa43a1921 test: treat undefined feature variables as 0
When running the test suite without building first, it is desirable to
have the tests consider these variables being undefined as equivalent
to the feature not being present, and in particular for the tests not
to generate errors.
2023-07-21 06:58:16 -03:00
Tim Culverhouse
e9ff896f84 schemata: document 'excluded' field in structured output
Include the 'excluded' field in the structured output schema.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2023-07-09 12:26:56 -03:00
David Bremner
f873790b6f perf-test: update corpus signature
In the decade (!) since this corpus was last updated, the keyserver
network is essentially dead, and I have migrated gpg keys. Bump the
version number as a clean way of switching signatures. Also update the
instructions to suggest using "--locate-external-key" to download the
public key. By default this uses WKD, which is now supported for my
UID.
2023-07-09 12:14:29 -03:00
David Bremner
a62b8a95c0 doc/lib: clarify ownership for notmuch_database_get_revision
The ownership is implicit in the const declaration (I think!), but
that does not show up in the doxygen generated API docs.
2023-07-09 12:08:28 -03:00
David Bremner
808fd6f258 test: add known broken test for message-id with embedded spaces.
According to my reading of RFC5322, there is an obsolete syntax for
Message-Id which permits folding whitespace (i.e. to be removed /
ignored by parsers). In [1] Paul Wise observed that notmuch removed
whitespace on indexing, but does not do any corresponding
normalization of queries. Mark the latter as a bug by adding a failing
test.

[1]: id:20230409044143.4041560-1-pabs3@bonedaddy.net
2023-07-09 11:59:43 -03:00
Michael J Gruber
3771832b01 python: adjust legacy bindings to py 3.12
Py 3.12 finally pulled the plug on the `SafeConfigParser` class which
has been deprecated since py 3.2.

We use it in the legacy bindings only, so take the easy route of
importing `ConfigParser` as `SafeConfigParser` and monkey-patching so
that the class has the expected interface.
2023-07-09 11:43:21 -03:00
Felipe Contreras
95a4bf3817 ruby: db: reorganize initializer
In order to make it more extensible.

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-05-29 07:51:02 -03:00