After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 424744 - Erode Camel's dependency on libedataserver
Erode Camel's dependency on libedataserver
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
1.10.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2007-03-31 04:03 UTC by Matthew Barnes
Modified: 2008-05-07 02:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch for evolution-data-server (53.58 KB, patch)
2007-05-29 17:25 UTC, Matthew Barnes
needs-work Details | Review
Proposed patch for evolution (10.86 KB, patch)
2007-05-29 18:46 UTC, Matthew Barnes
none Details | Review
Port of the patch to Tinymail's Camel (45.56 KB, patch)
2007-06-06 07:20 UTC, Philip Van Hoof
needs-work Details | Review
Revised patch for evolution-data-server (102.41 KB, patch)
2007-06-06 14:06 UTC, Matthew Barnes
none Details | Review
Revised patch for evolution-data-server (72.29 KB, patch)
2008-04-06 04:01 UTC, Matthew Barnes
committed Details | Review
Revised patch for evolution (10.62 KB, patch)
2008-04-06 04:02 UTC, Matthew Barnes
committed Details | Review

Description Matthew Barnes 2007-03-31 04:03:16 UTC
One of the tasks I'd like to focus on during the 2.11 development cycle is eroding Camel's dependency on libedataserver, with the ultimate (probably post-2.12) goal of either eliminating or reversing the dependency.

Some progress in this direction has already been made.  EMutex and EThread, upon which Camel used to depend heavily, have been superseded by equivalent data structures in GLib (bug #356177, bug #362638).  Camel still uses EMsgPort for its file descriptor feature, but Evolution will soon have no need for it (bug #362638).  Several structures in libedataserver that optimize memory usage (used by both Camel and Evolution) may be able to be replaced by equivalent structures in GLib (bug #363695).

In addition, there are several modules in libedataserver that I think would make sense to move to Camel, either because the module is only used by Camel or because it seems to be a better fit for Camel than libedataserver.

Here are ones I think are obvious candidates for moving to Camel:

EMsgPort
--------

     Once bug #362638 and bug #415891 are accepted, Evolution will no longer
     use EMsgPort.  Camel still uses EMsgPort for it's pipe feature, which
     allows you to cancel a blocking I/O operation when a message arrives on
     a dedicated "cancellation" EMsgPort.  I propose deprecating EMsgPort
     and introducing an equivalent data structure in Camel (CamelMsgPort).


e-iconv
-------

     Deprecate the e_iconv_* functions in libedataserver and introduce
     equivalent camel_iconv_* functions in Camel.  Camel depends heavily on
     these functions, and I think it makes more sense for this functionality
     to live in Camel.  Evolution's Mail component also uses them, as does
     a few custom widgets in Evolution.  But it would be a simple matter to
     adapt to the change; just switch the "e" prefix to "camel".


e-trie
------

     This data structure is only used by Camel.


md5-utils  (possibly)
---------

     This module is primarily used by Camel.  The only other use is in
     e-dbhash.c, which has several calls to md5_get_digest().  I suggest we
     deprecate but not remove the MD5 API in libedataserver so that e-dbhash
     can continue to use it, and introduce an equivalent API in Camel.  Then
     once the Camel -> libedataserver dependency has been reversed, remove
     the MD5 API in libedataserver and have e-dbhash use the Camel MD5 API.


These changes would not completely eliminate Camel's dependency on libedataserver, but they would get us significantly closer to the goal.
Comment 1 Matthew Barnes 2007-03-31 04:13:56 UTC
harish / srini / varadhan - Any thoughts?

(And what's harish's Bugzilla email at the moment?)
Comment 2 Philip Van Hoof 2007-05-13 11:58:17 UTC
Tinymail's camel-lite has some work for getting-rid-of the dependency on libedataserver. You can of course take a look at which items I needed to compile to create a static library of libedataserver that only has the things Camel needs:

pvanhoof@schtrumpf:~/repos/tinymail/trunk/libtinymail-camel/camel-lite/libedataserver$ ls *c *h
e-data-server-util.c  e-iconv.h   e-msgport.c  e-sexp.h        e-trie.c                  md5-utils.c
e-data-server-util.h  e-memory.c  e-msgport.h  e-time-utils.c  e-trie.h                  md5-utils.h
e-iconv.c             e-memory.h  e-sexp.c     e-time-utils.h  libedataserver-private.h
pvanhoof@schtrumpf:~/repos/tinymail/trunk/libtinymail-camel/camel-lite/libedataserver$ 

pvanhoof@schtrumpf:~/repos/tinymail/trunk/libtinymail-camel/camel-lite/libedataserver$ ls -alh libedataserver-1.2.a 
-rw-r--r-- 1 pvanhoof pvanhoof 87K 2007-05-09 20:37 libedataserver-1.2.a
pvanhoof@schtrumpf:~/repos/tinymail/trunk/libtinymail-camel/camel-lite/libedataserver$ 

pvanhoof@schtrumpf:~/repos/tinymail/trunk/libtinymail-camel/camel-lite/libedataserver$ strip libedataserver-1.2.a
pvanhoof@schtrumpf:~/repos/tinymail/trunk/libtinymail-camel/camel-lite/libedataserver$ ls -alh libedataserver-1.2.a 
-rw-r--r-- 1 pvanhoof pvanhoof 44K 2007-05-13 13:58 libedataserver-1.2.a
pvanhoof@schtrumpf:~/repos/tinymail/trunk/libtinymail-camel/camel-lite/libedataserver$ 

Comment 3 Matthew Barnes 2007-05-29 17:25:52 UTC
Created attachment 89019 [details] [review]
Proposed patch for evolution-data-server

This patch implements the proposal in comment #0.

Specifically, it deprecates all or part the following files:

    libedataserver/e-iconv.[ch]
    libedataserver/e-msgport.[ch]  (just the EMsgPort API)
    libedataserver/e-trie.[ch]
    libedataserver/md5-utils.[ch]

And adds the following files:

    camel/camel-iconv.c         (header already exists)
    camel/camel-msgport.[ch]
    camel/camel-trie.[ch]
    camel/camel-md5-utils.[ch]

I also applied some cosmetic changes to the new Camel headers.
Comment 4 Matthew Barnes 2007-05-29 18:07:48 UTC
Here's an additional hunk that got left out of the patch in comment #3.
I'll merge these if I wind up having to post a revised patch.

Index: camel-session.h
===================================================================
--- camel-session.h	(revision 7789)
+++ camel-session.h	(working copy)
@@ -27,12 +27,11 @@
 #ifndef CAMEL_SESSION_H
 #define CAMEL_SESSION_H 1
 
+#include <camel/camel-msgport.h>
 #include <camel/camel-object.h>
 #include <camel/camel-provider.h>
 #include <camel/camel-junk-plugin.h>
 
-#include <libedataserver/e-msgport.h>
-
 #define CAMEL_SESSION_TYPE     (camel_session_get_type ())
 #define CAMEL_SESSION(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_SESSION_TYPE, CamelSession))
 #define CAMEL_SESSION_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SESSION_TYPE, CamelSessionClass))
@@ -173,7 +172,7 @@ struct _CamelSessionThreadOps {
 };
 
 struct _CamelSessionThreadMsg {
-	EMsg msg;
+	CamelMsg msg;
 
 	int id;
 
Comment 5 Matthew Barnes 2007-05-29 18:46:44 UTC
Created attachment 89022 [details] [review]
Proposed patch for evolution

This patch makes Evolution use the camel-iconv API instead of e-iconv, which the evolution-data-server patch deprecates.
Comment 6 Philip Van Hoof 2007-06-06 07:14:19 UTC
The patch does not contain the new files, it seems
Comment 7 Philip Van Hoof 2007-06-06 07:20:48 UTC
Created attachment 89454 [details] [review]
Port of the patch to Tinymail's Camel

This is the port of the patch to Tinymail's camel-lite.

Note that I can't test this without the new files, mbarnes. Waiting for those :)
Comment 8 Philip Van Hoof 2007-06-06 07:26:50 UTC
Changing the status of your patch to needs-work, Matthew (for adding the files)
Comment 9 Matthew Barnes 2007-06-06 14:06:11 UTC
Created attachment 89475 [details] [review]
Revised patch for evolution-data-server

Gah, sorry about that.  This patch includes the new Camel files.
Comment 10 Philip Van Hoof 2007-10-07 17:07:09 UTC
Will take a look at this patch soon (to integrate with Tinymail's camel-lite). 

Bookmarked.
Comment 11 Matthew Barnes 2008-01-14 21:50:39 UTC
GLib 2.16 will be getting support for MD5 checksums, so that should clear up the md5-utils issue. I hope we can start moving forward on this for Evolution 2.24. The plan I've laid out should avoid any API/ABI breakage.
Comment 12 Matthew Barnes 2008-02-25 21:41:55 UTC
Bug #518710 has a patch for moving to GLib 2.16's checksum API.
Comment 13 Matthew Barnes 2008-04-06 04:01:11 UTC
Created attachment 108698 [details] [review]
Revised patch for evolution-data-server

Revised patch for Evolution-Data-Server 2.23.1.  With the MD5 issue resolved, this patch simply moves a few data structures from libedataserver to camel, where they belong.

   Introduces       Deprecates
   -------------    -------------
   camel-iconv      e-iconv
   CamelMsgPort     EMsgPort
   CamelTrie        ETrie
Comment 14 Matthew Barnes 2008-04-06 04:02:31 UTC
Created attachment 108699 [details] [review]
Revised patch for evolution

Revised patch for Evolution 2.23.1.
Comment 15 Matthew Barnes 2008-04-23 16:23:26 UTC
I guess I should've been CC'ing Sankar all along.

Sankar, any thoughts on this?
Comment 16 Matthew Barnes 2008-04-24 04:01:36 UTC
Bug #522639 provides a bit more motivation for this effort.
Comment 17 Matthew Barnes 2008-05-07 02:19:48 UTC
Committing the remaining patches since I haven't heard any objections to this over the past year.  There's still more work to be done in severing Camel's dependence on libedataserver.  This bug was just for the low-hanging fruit.  I'll deal with the rest in separate bugs.

Committed to trunk:
evolution revision 35474
evolution-data-server revision 8761