]> git.notmuchmail.org Git - notmuch/log
notmuch
3 years agolib: encapsulate the use of notmuch_database_t field 'mode'
David Bremner [Sun, 26 Jul 2020 23:31:35 +0000 (20:31 -0300)]
lib: encapsulate the use of notmuch_database_t field 'mode'

The plan is to change the underlying representation.

3 years agolib: drop two gratuitous assignments to database mode
David Bremner [Sun, 26 Jul 2020 23:31:34 +0000 (20:31 -0300)]
lib: drop two gratuitous assignments to database mode

I'm not sure what the point of modifying that right before destroying
the object is. In a future commit I want to remove that element of the
object, so simplify that task.

3 years agotest: Explicitly state that we want to sign with sender
Jonas Bernoulli [Mon, 27 Jul 2020 15:25:03 +0000 (17:25 +0200)]
test: Explicitly state that we want to sign with sender

Since Emacs 27 'mml-secure-epg-sign' errors out if we don't opt-in to
signing as the sender using 'mml-secure-openpgp-sign-with-sender'.

3 years agotest: Remove misguided emacs testing utilities
Jonas Bernoulli [Mon, 27 Jul 2020 15:25:02 +0000 (17:25 +0200)]
test: Remove misguided emacs testing utilities

The goal of this abstraction was to save space.  But that failed as
the result actually was that four trivial lines got replace with 15
fairly complicated lines.  The opposite of what it was supposed to
do.

Also it made it harder to come up with the fix in the previous commit;
simply grepping for the relevant symbols did not work because they get
constructed at run-time instead of appearing in the source file.

3 years agotest: Deal with Emacs 27 switching to lexical scope by default
Jonas Bernoulli [Mon, 27 Jul 2020 15:25:01 +0000 (17:25 +0200)]
test: Deal with Emacs 27 switching to lexical scope by default

Starting with Emacs 27 undeclared variables in evaluated interactive
code uses lexical scope.  This includes code passed with '--eval' as
we do in the Emacs tests, which also happen to assume dynamic scope.

- This can affect variables defined by libraries that we use.  We
  let-bind such variables to change the behavior of functions which we
  then call with these bindings in effect.  If these libraries are not
  loaded beforehand, then the bindings are lexical and fail to have
  the effect we intended.

  At this time only 'smtpmail' has to be loaded explicitly (for the
  variables let-bound in emacs_deliver_message and emacs_fcc_message).

  'message' doesn't have to be loaded explicitly, because loading
  'notmuch' (in 'run_emacs') already takes care of that, indirectly.

- Our own testing-only variables also have to be declared explicitly.
  We should have done that anyway, but because of how and where these
  variables are used it was very easy to overlook that (i.e. it isn't
  something the byte-compiler ever looks at).  Not so in Emacs 27
  anymore; here this oversight caused four tests to fail.

  The numeric values of these variables get incremented by functions
  that we add to hooks that are run by many tests, not just the tests
  where we actually inspect the value and therefore take care to let-
  bind the values to 0 before we begin.  The global values therefore
  have to be numeric values as well.  I have chosen -100 instead of 0
  as the default in case someone writes a test that inspects the value
  but forgets to let-bind the value.  I hope that the unusual negative
  value that one is going to see in such a case will help debugging
  the issue.

3 years agogitignore: Ignore generated sphinx.config
Jonas Bernoulli [Mon, 27 Jul 2020 15:25:00 +0000 (17:25 +0200)]
gitignore: Ignore generated sphinx.config

3 years agotest: add known broken test for n_d_get_default_indexopts
David Bremner [Sun, 19 Jul 2020 13:11:13 +0000 (10:11 -0300)]
test: add known broken test for n_d_get_default_indexopts

Xapian exceptions are swallowed and turned into default return value.

3 years agolib: fix error return bug with n_d_set_config.
David Bremner [Sun, 19 Jul 2020 12:51:03 +0000 (09:51 -0300)]
lib: fix error return bug with n_d_set_config.

The catch block either needs to return, or the function needs to
return "status". Choose the latter for consistency with
n_d_get_config.

3 years agotest: add known broken test for n_d_set_config
David Bremner [Sun, 19 Jul 2020 12:44:05 +0000 (09:44 -0300)]
test: add known broken test for n_d_set_config

Error status is currently lost.

3 years agotest: add regression test for n_d_get_config
David Bremner [Sun, 19 Jul 2020 12:39:16 +0000 (09:39 -0300)]
test: add regression test for n_d_get_config

Xapian exceptions seem to handled OK, at least for this case.

3 years agolib: add regresion test for n_d_get_all_tags
David Bremner [Sun, 19 Jul 2020 10:57:39 +0000 (07:57 -0300)]
lib: add regresion test for n_d_get_all_tags

Existing error handling seems adequate, if not ideal.

3 years agolib: add regression test for n_d_find_message_by_filename
David Bremner [Sun, 19 Jul 2020 10:43:36 +0000 (07:43 -0300)]
lib: add regression test for n_d_find_message_by_filename

At least this Xapian exception is caught. Make sure it stays that way.

3 years agolib: rename _n_d_create to _n_d_find_or_create
David Bremner [Sun, 19 Jul 2020 10:36:47 +0000 (07:36 -0300)]
lib: rename _n_d_create to _n_d_find_or_create

The error message and name were confusing when called in some "read
only" context.

3 years agotest: add known broken test for notmuch_database_remove_message
David Bremner [Sun, 19 Jul 2020 10:13:06 +0000 (07:13 -0300)]
test: add known broken test for notmuch_database_remove_message

The current error message is a bit confusing; fix in next commit.

3 years agolib: convert relative filenames to absolute in n_d_index_file
David Bremner [Sun, 19 Jul 2020 00:11:28 +0000 (21:11 -0300)]
lib: convert relative filenames to absolute in n_d_index_file

The API docs promise to handle relative filenames, but the code did
not do it.

Also check for files outside the mail root, as implied by the API
description.

This fixes the bug reported at

     id:87sgdqo0rz.fsf@tethera.net

3 years agotest: add known broken test for indexing relative path
David Bremner [Fri, 17 Jul 2020 11:02:14 +0000 (08:02 -0300)]
test: add known broken test for indexing relative path

The current code seems to look for the path relative to the current
working directory, rather than the mail store root.

3 years agotest: regression test for n_d_index_file closed db
David Bremner [Fri, 17 Jul 2020 10:51:24 +0000 (07:51 -0300)]
test: regression test for n_d_index_file closed db

Current exception handling seems OK, at least for this case.

3 years agotest: add regression test for n_d_get_directory
David Bremner [Fri, 17 Jul 2020 10:38:09 +0000 (07:38 -0300)]
test: add regression test for n_d_get_directory

At least this exception is already handled correctly.

3 years agotest: regression test for n_d_get_revision
David Bremner [Thu, 16 Jul 2020 23:04:12 +0000 (20:04 -0300)]
test: regression test for n_d_get_revision

This function only accesses data cached by notmuch, so being closed is
not a problem.

3 years agotest: add regression test for n_d_{begin,end}_atomic
David Bremner [Thu, 16 Jul 2020 22:48:19 +0000 (19:48 -0300)]
test: add regression test for n_d_{begin,end}_atomic

Xapian currently succeeds to begin/end a transaction on a closed database,
or at least does not throw an exception. Make the test robust against
this changing.

3 years agotest: regression test for n_d_upgrade
David Bremner [Thu, 16 Jul 2020 22:34:02 +0000 (19:34 -0300)]
test: regression test for n_d_upgrade

The logic is that if it's acceptable to return SUCCESS for read only
database, it's acceptable for a closed one.

3 years agolib/n_d_needs_upgrade: handle error return from n_d_get_version
David Bremner [Thu, 16 Jul 2020 22:28:22 +0000 (19:28 -0300)]
lib/n_d_needs_upgrade: handle error return from n_d_get_version

Also clarify documentation of error return from n_d_needs_upgrade.

3 years agotest: add known broken test for n_d_needs_upgrade
David Bremner [Thu, 16 Jul 2020 22:22:05 +0000 (19:22 -0300)]
test: add known broken test for n_d_needs_upgrade

It's a bit arbitrary which value to return for errors, but the same
argument as for read only databases applies for errors.

3 years agotest: add regression tests for notmuch database destroy
David Bremner [Thu, 16 Jul 2020 02:05:54 +0000 (23:05 -0300)]
test: add regression tests for notmuch database destroy

Either an open or closed database should be ok to destroy

3 years agotest: regression test for closing a closed database
David Bremner [Thu, 16 Jul 2020 01:59:58 +0000 (22:59 -0300)]
test: regression test for closing a closed database

This does not currently throw an error, and it should stay that way.

3 years agolib/n_d_get_version: catch exceptions and clarify the API
David Bremner [Tue, 14 Jul 2020 22:31:10 +0000 (19:31 -0300)]
lib/n_d_get_version: catch exceptions and clarify the API

notmuch_database_get_version previously returned 0 on some errors, but
did not document this. Luckily 0 is not a valid database version.

3 years agolib: move deallocation of memory from n_d_close to n_d_destroy
David Bremner [Tue, 14 Jul 2020 11:25:28 +0000 (08:25 -0300)]
lib: move deallocation of memory from n_d_close to n_d_destroy

In order to mimic the "best effort" API of Xapian to provide
information from a closed database when possible, do not
destroy the Xapian database object too early.

Because the pointer to a Xapian database is no longer nulled on close,
introduce a flag to track whether the notmuch database is open or not.

3 years agotest: add known broken test for n_d_get_version on closed db
David Bremner [Tue, 14 Jul 2020 00:30:52 +0000 (21:30 -0300)]
test: add known broken test for n_d_get_version on closed db

This should not crash, but it does currently.

3 years agotest: regression tests for n_d_status_string and n_d_get_path
David Bremner [Tue, 14 Jul 2020 00:21:03 +0000 (21:21 -0300)]
test: regression tests for n_d_status_string and n_d_get_path

These do not crash on a closed database, and we want to keep it that
way.

Start a new file of tests as T560-lib-error was starting to get unwieldy.

3 years agolib: fix exception messages for n_m_message_*
David Bremner [Wed, 22 Jul 2020 11:19:28 +0000 (08:19 -0300)]
lib: fix exception messages for n_m_message_*

The original generic handler had an extra '%s' in the format
string. Update tests that failed to catch this because the template to
print status strings checked 'stat', which was not set.

3 years agotest: sanitize line numbers in exception reports
David Bremner [Wed, 22 Jul 2020 11:35:42 +0000 (08:35 -0300)]
test: sanitize line numbers in exception reports

Prevent test suite churn when reported line numbers change.

3 years agoemacs: notmuch-search: avoid wiping out buffer-local variables
Sean Whitton [Wed, 22 Jul 2020 15:11:32 +0000 (08:11 -0700)]
emacs: notmuch-search: avoid wiping out buffer-local variables

3 years agolib: fix return value for n_m_reindex
David Bremner [Thu, 9 Jul 2020 00:17:09 +0000 (21:17 -0300)]
lib: fix return value for n_m_reindex

Also update the documentation for the behaviour of n_m_get_thread_id
that this fix relies on.

3 years agotest: add known broken test for n_m_reindex on closed db
David Bremner [Thu, 9 Jul 2020 00:17:08 +0000 (21:17 -0300)]
test: add known broken test for n_m_reindex on closed db

This is another case where the code should not call INTERNAL_ERROR.

3 years agotest: regression for retrieving closed db from message
David Bremner [Thu, 9 Jul 2020 00:17:07 +0000 (21:17 -0300)]
test: regression for retrieving closed db from message

This is actually one of the few potentially useful things you can do
with a message belonging to a closed database, since in principle you
could re-open the database.

3 years agotest: regression test for destroying message with closed db
David Bremner [Thu, 9 Jul 2020 00:17:06 +0000 (21:17 -0300)]
test: regression test for destroying message with closed db

This should be fine because the message belongs to the
database (talloc context wise).

3 years agotest: regression tests of n_m_freeze and n_m_thaw on closed db
David Bremner [Thu, 9 Jul 2020 00:17:05 +0000 (21:17 -0300)]
test: regression tests of n_m_freeze and n_m_thaw on closed db

Neither of these accesses the database, so should be safe. Add the
tests to catch any changes in exception throwing.

3 years agolib: handle xapian exception in n_m_remove_all_tags
David Bremner [Thu, 9 Jul 2020 00:17:04 +0000 (21:17 -0300)]
lib: handle xapian exception in n_m_remove_all_tags

At least the exception we already catch should be reported properly.

3 years agotest: add broken test for n_m_remove_all_tags
David Bremner [Thu, 9 Jul 2020 00:17:03 +0000 (21:17 -0300)]
test: add broken test for n_m_remove_all_tags

The Xapian exception is actually caught here, but the NULL return is
not dealt with properly.

3 years agotest: add regression test for n_m_maildir_flags_to_tags
David Bremner [Thu, 9 Jul 2020 00:17:02 +0000 (21:17 -0300)]
test: add regression test for n_m_maildir_flags_to_tags

This function currently catches at least the obvious Xapian exceptions
and we want to keep it that way.

3 years agocli/new: replace newly deprecated n_m_has_maildir_flag
David Bremner [Mon, 13 Jul 2020 23:51:07 +0000 (20:51 -0300)]
cli/new: replace newly deprecated n_m_has_maildir_flag

Boolean return values have no out-of-band-values to signal errors. The
change here is that a (somewhat unlikely) fatal error after indexing
will now be caught.

3 years agolib: add notmuch_message_has_maildir_flag_st
David Bremner [Thu, 9 Jul 2020 00:17:01 +0000 (21:17 -0300)]
lib: add notmuch_message_has_maildir_flag_st

Initially the new function is mainly tested indirectly via the
wrapper.

3 years agotest: add regression test for notmuch_message_has_maildir_flag
David Bremner [Thu, 9 Jul 2020 00:17:00 +0000 (21:17 -0300)]
test: add regression test for notmuch_message_has_maildir_flag

This passes the NULL return inside _ensure_maildir_flags does not
break anything. Probably this should be handled more explicitely.

3 years agoconfigure: replace multiple redirects with redirected block
David Bremner [Wed, 15 Jul 2020 12:36:27 +0000 (09:36 -0300)]
configure: replace multiple redirects with redirected block

This belatedly implements Tomi's suggestion from

     id:m25zaukv6u.fsf@guru.guru-group.fi

3 years agobindings/ruby: replacy use of deprecated notmuch_message_get_flag
David Bremner [Sat, 11 Jul 2020 18:30:08 +0000 (15:30 -0300)]
bindings/ruby: replacy use of deprecated notmuch_message_get_flag

Depending on the flag, this actually can return an errror, so raise a
ruby exception if so.

3 years agolib/thread: replace use of deprecated notmuch_message_get_flag
David Bremner [Sat, 11 Jul 2020 18:30:07 +0000 (15:30 -0300)]
lib/thread: replace use of deprecated notmuch_message_get_flag

This adds one more reason why _notmuch_thread_create might return
NULL, but those were not previously enumerated, so no promises are
broken.

3 years agolib/add-message: drop use of deprecated notmuch_message_get_flag.
David Bremner [Sat, 11 Jul 2020 18:30:06 +0000 (15:30 -0300)]
lib/add-message: drop use of deprecated notmuch_message_get_flag.

As a side effect, we revert the switch from notmuch_bool_t to bool
here. This is because those two types are not actually compatible when
passing by reference.

3 years agocli/show: replace deprecated notmuch_message_get_flag
David Bremner [Sat, 11 Jul 2020 18:30:05 +0000 (15:30 -0300)]
cli/show: replace deprecated notmuch_message_get_flag

This can be seen as moving an abort out of the library, into the CLI
where we can both print to stderr and shut the process down without
ill effect.

3 years agocli/search: replace deprecated notmuch_message_get_flag
David Bremner [Sat, 11 Jul 2020 18:30:04 +0000 (15:30 -0300)]
cli/search: replace deprecated notmuch_message_get_flag

Our handling of errors is all or nothing here, but it's an improvement
on the status quo, and it avoids rippling internal API changes.

3 years agolib: catch exceptions in n_m_get_flag, provide n_m_get_flag_st
David Bremner [Sat, 4 Jul 2020 15:18:05 +0000 (12:18 -0300)]
lib: catch exceptions in n_m_get_flag, provide n_m_get_flag_st

It's not very nice to return FALSE for an error, so provide
notmuch_message_get_flag_st as a migration path.

Bump LIBNOTMUCH_MINOR_VERSION because the API is extended.

3 years agoconfigure: make sure WITH_PYTHON_DOCS is initialized
David Bremner [Thu, 16 Jul 2020 18:59:45 +0000 (15:59 -0300)]
configure: make sure WITH_PYTHON_DOCS is initialized

Thanks to pazz for reporting the problem.

3 years agodoc: add new python bindings to main documentation tree.
David Bremner [Sat, 11 Jul 2020 13:20:27 +0000 (10:20 -0300)]
doc: add new python bindings to main documentation tree.

A separate conf.py and doc directory (or will be needed if someone wants
to build the bindings docs separately from notmuch.

3 years agodoc: replace use of environment variables with a generated config
David Bremner [Sat, 11 Jul 2020 13:20:26 +0000 (10:20 -0300)]
doc: replace use of environment variables with a generated config

It is getting unwieldy to pass configuration options on the
sphinx-build command line, and I anticipate further use of
conditionals.

As far as I could tell, execing a string is the idiomatic way to
emulate include in Python.

3 years agolib: use COERCE_STATUS in n_m_{add,remove}_tag
David Bremner [Sun, 5 Jul 2020 13:00:26 +0000 (10:00 -0300)]
lib: use COERCE_STATUS in n_m_{add,remove}_tag

Currently I don't know of a good way of testing this, but at least in
principle a Xapian exception in _notmuch_message_{add,remove}_term
would cause an abort in the library.

3 years agolib: catch Xapian exceptions in n_m_remove_tag
David Bremner [Sun, 5 Jul 2020 13:00:25 +0000 (10:00 -0300)]
lib: catch Xapian exceptions in n_m_remove_tag

The churn here is again mainly re-indentation.

3 years agotest: add broken test for n_m_remove_tag
David Bremner [Sun, 5 Jul 2020 13:00:24 +0000 (10:00 -0300)]
test: add broken test for n_m_remove_tag

Exception will be caught in next commit.

3 years agolib: catch Xapian exceptions in n_m_add_tag
David Bremner [Sun, 5 Jul 2020 13:00:23 +0000 (10:00 -0300)]
lib: catch Xapian exceptions in n_m_add_tag

This is mostly just (horizontal) code movement due to wrapping
everything in a try / catch.

3 years agotest: add known broken test for n_m_add_tag with closed db
David Bremner [Sun, 5 Jul 2020 13:00:22 +0000 (10:00 -0300)]
test: add known broken test for n_m_add_tag with closed db

Exception will be caught in next commit.

3 years agolib: catch Xapian exceptions in n_m_count_files
David Bremner [Sun, 5 Jul 2020 13:00:21 +0000 (10:00 -0300)]
lib: catch Xapian exceptions in n_m_count_files

This will require some care for the caller to check the sign, and not
just add error returns into a running total.

3 years agotest: add known broken test for n_m_count_files
David Bremner [Sun, 5 Jul 2020 13:00:20 +0000 (10:00 -0300)]
test: add known broken test for n_m_count_files

This will be fixed in the next commit.

3 years agolib: catch Xapian exceptions in n_m_get_tags
David Bremner [Sun, 5 Jul 2020 13:00:19 +0000 (10:00 -0300)]
lib: catch Xapian exceptions in n_m_get_tags

This allows the function to return an error value rather than
crashing.

3 years agotest: add known broken test for n_m_get_tags
David Bremner [Sun, 5 Jul 2020 13:00:18 +0000 (10:00 -0300)]
test: add known broken test for n_m_get_tags

This will be fixed in the next commit.

3 years agolib: use LOG_XAPIAN_EXCEPTION in n_m_get_date
David Bremner [Sun, 5 Jul 2020 13:00:17 +0000 (10:00 -0300)]
lib: use LOG_XAPIAN_EXCEPTION in n_m_get_date

This should not change functionality, but does slightly reduce code
duplication. Perhaps more importantly it allows consistent changes to
all of the similar exception handling in message.cc.

3 years agolib: add regression test for n_m_get_date; clarify API
David Bremner [Sun, 5 Jul 2020 13:00:16 +0000 (10:00 -0300)]
lib: add regression test for n_m_get_date; clarify API

This function catches Xapian exceptions. The test is intended to make
sure it stays that way.

3 years agotest: add known broken for n_m_get_flag on closed db
David Bremner [Sat, 4 Jul 2020 14:22:25 +0000 (11:22 -0300)]
test: add known broken for n_m_get_flag on closed db

Exception caught in next commit. Note that FLAG_GHOST is the only one
that triggers the I/O code path.

3 years agolib: catch exceptions in n_m_get_filenames
David Bremner [Sat, 4 Jul 2020 14:09:09 +0000 (11:09 -0300)]
lib: catch exceptions in n_m_get_filenames

This is essentially copied from the change to notmuch_message_get_filename

3 years agotest: add known broken test for n_m_get_filenames
David Bremner [Sat, 4 Jul 2020 14:06:37 +0000 (11:06 -0300)]
test: add known broken test for n_m_get_filenames

This will be fixed in the next commit

3 years agolib/n_m_g_filename: catch Xapian exceptions, document NULL return
David Bremner [Sat, 4 Jul 2020 12:20:31 +0000 (09:20 -0300)]
lib/n_m_g_filename: catch Xapian exceptions, document NULL return

This is the same machinery as applied for

     notmuch_message_get_{thread,message}_id

3 years agolib: add known broken test for notmuch_message_get_filename
David Bremner [Sat, 4 Jul 2020 12:16:30 +0000 (09:16 -0300)]
lib: add known broken test for notmuch_message_get_filename

This will be fixed in the next commit

3 years agolib/n_m_get_replies: doc return, initial regression test
David Bremner [Sat, 4 Jul 2020 12:09:09 +0000 (09:09 -0300)]
lib/n_m_get_replies: doc return, initial regression test

We need to to set a query and retrieve the threads to meaningfully
test this function.

3 years agotest: add regression test for n_m_get_header
David Bremner [Sat, 4 Jul 2020 11:35:08 +0000 (08:35 -0300)]
test: add regression test for n_m_get_header

This function already catches Xapian exceptions, and we want to make
sure it stays that way.

3 years agolib/message: use LOG_XAPIAN_EXCEPTION in n_m_get_header
David Bremner [Sat, 4 Jul 2020 11:33:41 +0000 (08:33 -0300)]
lib/message: use LOG_XAPIAN_EXCEPTION in n_m_get_header

This is just for consistency, and a small reduction in the amount of
boilerplate.

3 years agotest: drop use of assert in closed db tests
David Bremner [Sat, 4 Jul 2020 12:29:41 +0000 (09:29 -0300)]
test: drop use of assert in closed db tests

Instead of printing the same static string for each test, can replace
the assert with something simpler (or at least easier to integrate
into the test suite).

3 years agotest: remove unused backup_database calls
David Bremner [Sat, 4 Jul 2020 11:12:21 +0000 (08:12 -0300)]
test: remove unused backup_database calls

Since these backups are never restored, they should be safe to remove.

3 years agodebian: drop ValueRangeProcessor symbols
David Bremner [Sat, 11 Jul 2020 22:52:21 +0000 (19:52 -0300)]
debian: drop ValueRangeProcessor symbols

These are not used since b90d852

3 years agotest: drop upgrade from v1 tests
David Bremner [Tue, 7 Jul 2020 10:56:47 +0000 (07:56 -0300)]
test: drop upgrade from v1 tests

These are less crucial since we stopped generating new database
versions and relied primarily on features. They also rely on a
pre-generated v1 database which happens to be chert format. This
backend is not supported by Xapian 1.5.

Also drop the tool gen-testdb.sh, which is currently broken, due to
changes in the testing infrastructure.

3 years agolib: migrate from Xapian ValueRangeProcessor to RangeProcessor
David Bremner [Tue, 7 Jul 2020 10:56:46 +0000 (07:56 -0300)]
lib: migrate from Xapian ValueRangeProcessor to RangeProcessor

This will be mandatory as of Xapian 1.5.  The API is also more
consistent with the FieldProcessor API, which helps code re-use a bit.

Note that this switches to using the built-in Xapian support for
prefixes on ranges (i.e. deleted code at beginning of
ParseTimeRangeProcessor::operator(), added prefix to constructor).

Another side effect of the migration is that we are generating smaller
queries, using one OP_VALUE_RANGE instead of an AND of two OP_VALUE_*
queries.

3 years agolib: migrate to post Xapian 1.3.4 compact support
David Bremner [Tue, 7 Jul 2020 10:56:45 +0000 (07:56 -0300)]
lib: migrate to post Xapian 1.3.4 compact support

The old API was deprecated in Xapian 1.3.4 and (will be) removed in 1.5.0

3 years agodoc: make gzipped man pages reproducible
Jonas Witschel [Sat, 11 Jul 2020 16:04:35 +0000 (18:04 +0200)]
doc: make gzipped man pages reproducible

gzip includes the name of the uncompressed file and its modification
timestamp into the compressed archive. The latter makes it hard to
reproduce the generated files bit for bit at a later time, so omit this
information from the archive using the "--no-name" option. This is a
reproducibility best practice, see
https://wiki.debian.org/ReproducibleBuilds/TimestampsInGzipHeaders

3 years agoMerge branch 'release'
David Bremner [Sat, 11 Jul 2020 02:24:41 +0000 (23:24 -0300)]
Merge branch 'release'

3 years agoNEWS: update date for release 0.30 archive/debian/0.30-1 debian/0.30-1
David Bremner [Sat, 11 Jul 2020 01:25:04 +0000 (22:25 -0300)]
NEWS: update date for release

3 years agodebian: changelog for 0.30
David Bremner [Sat, 11 Jul 2020 01:24:41 +0000 (22:24 -0300)]
debian: changelog for 0.30

3 years agoversion: set to 0.30
David Bremner [Sat, 11 Jul 2020 01:21:19 +0000 (22:21 -0300)]
version: set to 0.30

3 years agolib/message: catch exception in n_m_get_thread_id
David Bremner [Tue, 30 Jun 2020 01:14:11 +0000 (22:14 -0300)]
lib/message: catch exception in n_m_get_thread_id

This allows us to return an error value from the library.

3 years agotest: add known broken test for n_m_get_thread_id on closed db
David Bremner [Tue, 30 Jun 2020 01:14:10 +0000 (22:14 -0300)]
test: add known broken test for n_m_get_thread_id on closed db

This will be fixed in the next commit.

3 years agolib: catch error from closed db in n_m_get_message_id
David Bremner [Tue, 30 Jun 2020 01:14:09 +0000 (22:14 -0300)]
lib: catch error from closed db in n_m_get_message_id

By catching it at the library top level, we can return an error value.

3 years agotest: add known broken test for error handling on closed database
David Bremner [Tue, 30 Jun 2020 01:14:08 +0000 (22:14 -0300)]
test: add known broken test for error handling on closed database

Based on id:87d05je1j6.fsf@powell.devork.be

3 years agobuild: produce signatures for release candidate tarballs. 0.30_rc3 debian/0.30_rc3-1
David Bremner [Tue, 16 Jun 2020 14:17:55 +0000 (11:17 -0300)]
build: produce signatures for release candidate tarballs.

Today Defalos on #notmuch asked for a signed tarball for
0.30~rc2. This is a minimal change to support this in the future.  The
question of automagically uploading will need more thought; currently
I like the fact that tags from pre-releases are only pushed manually.

3 years agotest: fix python 3.8.4 related regression in T210-raw
David Bremner [Fri, 3 Jul 2020 10:23:32 +0000 (07:23 -0300)]
test: fix python 3.8.4 related regression in T210-raw

It seems (at least in 3.8.4~rc1-1 on Debian) that set_content requires
at least one line.

3 years agodebian: changelog fo 0.30~rc3-1
David Bremner [Fri, 3 Jul 2020 09:50:16 +0000 (06:50 -0300)]
debian: changelog fo 0.30~rc3-1

3 years agoversion: bump to 0.30~rc3
David Bremner [Fri, 3 Jul 2020 09:45:17 +0000 (06:45 -0300)]
version: bump to 0.30~rc3

3 years agobindings/python-cffi: copy version file into bindings dir
David Bremner [Tue, 30 Jun 2020 00:22:47 +0000 (21:22 -0300)]
bindings/python-cffi: copy version file into bindings dir

Attempt to avoid breaking "pip install ."

As far as I can tell, we need to have a copy (not just a relative
symlink) of the version file.

3 years agodoc: update install suggestions for fedora derivatives
David Bremner [Fri, 26 Jun 2020 11:11:00 +0000 (08:11 -0300)]
doc: update install suggestions for fedora derivatives

Fedora still has an old gmime-devel which is 2.6.x. This is no longer
supported by notmuch. Also apparently dnf is a better choice than yum.

3 years agotests: mark sig verification known-broken with session keys on buggy gpgme
Daniel Kahn Gillmor [Thu, 2 Jul 2020 18:00:49 +0000 (14:00 -0400)]
tests: mark sig verification known-broken with session keys on buggy gpgme

We make use of the just-introduced configure test.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
3 years agoconfigure: can gpgme can verify signatures when decrypting with a session key?
Daniel Kahn Gillmor [Thu, 2 Jul 2020 18:00:48 +0000 (14:00 -0400)]
configure: can gpgme can verify signatures when decrypting with a session key?

If https://dev.gnupg.org/T3464 is unresolved in the version of gpgme
we are testing against, then we should know about it, because it
affects the behavior of notmuch.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
3 years agotest: mark two tests broken on machines with 32 bit time_t
David Bremner [Wed, 24 Jun 2020 14:32:34 +0000 (11:32 -0300)]
test: mark two tests broken on machines with 32 bit time_t

I haven't traced the code path as exhaustively for the SMIME test, but
the expiry date in question is larger then representable in a signed
32 bit integer.

3 years agoconfigure: detect 64 bit time_t
David Bremner [Wed, 24 Jun 2020 14:32:33 +0000 (11:32 -0300)]
configure: detect 64 bit time_t

Certain tests involving timestamps > 32 bits cannot pass with the
current libnotmuch API. We will avoid this issue for now by disabling
those tests on "old" architectures with 32 bit time_t.

3 years agoMakefile.global: drop -std=gnu99. C11 (or later) compiler required
Tomi Ollila [Wed, 24 Jun 2020 20:11:20 +0000 (23:11 +0300)]
Makefile.global: drop -std=gnu99. C11 (or later) compiler required

Since October 2018 building notmuch has actually required compiler
that knows C11.

Also this -std=gnu99 was not used in code compiled by configure,
so in theory this could have caused problems...

...but no related reports have been sent, perhaps ever.

Both gcc and clang has been shipping compilers supporting C11
(or later) by default for more than four years now.

Therefore, just dropping -std=gnu99 (and not checking C11
compatibility for now, for simplicity) is easiest to do,
and removes inconsistency between configure and build time
compilations.

3 years agopython-cffi: read version from notmuch version file
Floris Bruynooghe [Fri, 19 Jun 2020 09:46:28 +0000 (11:46 +0200)]
python-cffi: read version from notmuch version file

This keeps it in sync with the main notmuch version which is less
confusing to users.

3 years agodebian: changelog stanza for 0.30~rc2-1 archive/debian/0.30_rc2-1 debian/0.30_rc2-1
David Bremner [Tue, 16 Jun 2020 11:32:51 +0000 (08:32 -0300)]
debian: changelog stanza for 0.30~rc2-1