[PATCH] fix FTBFS with glib

classic Classic list List threaded Threaded
8 messages Options
Michael J Gruber Michael J Gruber
Reply | Threaded
Open this post in threaded view
|

[PATCH] fix FTBFS with glib

With newer glib, notmuch FTBFS because of C linkage error. This is due
to a misplaced include (inside an extern "C") which was always there
but exposed only recently through this change in glib:

https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715

Move to the include to the outside of the extern block.

Signed-off-by: Michael J Gruber <[hidden email]>
---
 lib/notmuch-private.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h
index 2fbf7ab9..46845253 100644
--- a/lib/notmuch-private.h
+++ b/lib/notmuch-private.h
@@ -31,6 +31,8 @@
 
 #include "notmuch.h"
 
+#include "gmime-extra.h"
+
 NOTMUCH_BEGIN_DECLS
 
 #include <stdlib.h>
@@ -47,8 +49,6 @@ NOTMUCH_BEGIN_DECLS
 
 #include <talloc.h>
 
-#include "gmime-extra.h"
-
 #include "xutil.h"
 #include "error_util.h"
 #include "string-util.h"
--
2.30.0.368.g1c478ce6f6
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] fix FTBFS with glib

Michael J Gruber <[hidden email]> writes:

> With newer glib, notmuch FTBFS because of C linkage error. This is due
> to a misplaced include (inside an extern "C") which was always there
> but exposed only recently through this change in glib:
>
> https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715
>
> Move to the include to the outside of the extern block.

Thanks for the patch. I have some questions / comments.

1) What version of glib are we talking about? Is it released yet?
2) The reason this works is that gmime-extra.h has its own extern
"C". If respinning the patch, it might be worth commenting on that.
3) I observed that just deleting #include "gmime-extra.h" from
notmuch-private.h works fine, presumably because it is included where it
is actually needed. In some sense this seems like a nicer solution. What
do you think?

d
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Michael J Gruber Michael J Gruber
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] fix FTBFS with glib

David Bremner venit, vidit, dixit 2021-02-12 13:57:29:

> Michael J Gruber <[hidden email]> writes:
>
> > With newer glib, notmuch FTBFS because of C linkage error. This is due
> > to a misplaced include (inside an extern "C") which was always there
> > but exposed only recently through this change in glib:
> >
> > https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715
> >
> > Move to the include to the outside of the extern block.
>
> Thanks for the patch. I have some questions / comments.
>
> 1) What version of glib are we talking about? Is it released yet?

This showed up due to massive FTBFS on Fedora 34 (not released yet, but
branched for release).

glib 2.67.3 has the pertaining commit 51003d40.

> 2) The reason this works is that gmime-extra.h has its own extern
> "C". If respinning the patch, it might be worth commenting on that.

Yes. If you don't distinguish betwenn h/hpp then that is the way to go.

> 3) I observed that just deleting #include "gmime-extra.h" from
> notmuch-private.h works fine, presumably because it is included where it
> is actually needed. In some sense this seems like a nicer solution. What
> do you think?

Interesting. I assumed it's there for a reason. You introduced it in

cbb2d560 ("lib/cli: replace use of g_mime_message_get_sender", 2017-05-05)

so I guess you're the best person to ask whether it's till needed :)

Removing an unnecessary include would be the best solution, of course.

Cheers
Michael
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Tomi Ollila-2 Tomi Ollila-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] fix FTBFS with glib

In reply to this post by Michael J Gruber
On Thu, Feb 11 2021, Michael J. Gruber wrote:

> With newer glib, notmuch FTBFS because of C linkage error. This is due

If/when the alternative change is send (if it works), then it would be
nice if this FTBFS were opened (i searched it but deliberately leave
it still a mystery for some of us ;)

Tomi

> to a misplaced include (inside an extern "C") which was always there
> but exposed only recently through this change in glib:
>
> https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715
>
> Move to the include to the outside of the extern block.
>
> Signed-off-by: Michael J Gruber <[hidden email]>
> ---
>  lib/notmuch-private.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h
> index 2fbf7ab9..46845253 100644
> --- a/lib/notmuch-private.h
> +++ b/lib/notmuch-private.h
> @@ -31,6 +31,8 @@
>  
>  #include "notmuch.h"
>  
> +#include "gmime-extra.h"
> +
>  NOTMUCH_BEGIN_DECLS
>  
>  #include <stdlib.h>
> @@ -47,8 +49,6 @@ NOTMUCH_BEGIN_DECLS
>  
>  #include <talloc.h>
>  
> -#include "gmime-extra.h"
> -
>  #include "xutil.h"
>  #include "error_util.h"
>  #include "string-util.h"
> --
> 2.30.0.368.g1c478ce6f6
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Michael J Gruber Michael J Gruber
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] fix FTBFS with glib

Tomi Ollila venit, vidit, dixit 2021-02-12 19:48:27:
> On Thu, Feb 11 2021, Michael J. Gruber wrote:
>
> > With newer glib, notmuch FTBFS because of C linkage error. This is due
>
> If/when the alternative change is send (if it works), then it would be
> nice if this FTBFS were opened (i searched it but deliberately leave
> it still a mystery for some of us ;)

Hi Tomi,

I don't fully grok your sentence - do you mean I should spell out FTBFS
as "fails to build from source"? It's packager lingo, sorry ;)

Michael
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

[PATCH] fix build failure with glib 2.67

In reply to this post by Michael J Gruber
From: Michael J Gruber <[hidden email]>

Based on a patch from Michael J Gruber [1].  As of glib 2.67 (more
specifically [2]), including "gmime-extra.h" inside an extern "C"
block causes build failures, because glib is using C++ features.

Observing that "gmime-extra.h" is no longer needed in
notmuch-private.h, which can simply delete that include, but
we have to correspondingly move the includes which might include
it (in particular crypto.h) out of the extern "C" block also.

This seems less fragile than only moving gmime-extra, and relying on
preprocessor sentinels to keep the deeper includes from happening.

Move to the include to the outside of the extern block.

[1]: id:[hidden email]
[2]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715
---
 lib/notmuch-private.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h
index 57ec7f72..41aff342 100644
--- a/lib/notmuch-private.h
+++ b/lib/notmuch-private.h
@@ -31,6 +31,12 @@
 
 #include "notmuch.h"
 
+#include "xutil.h"
+#include "error_util.h"
+#include "string-util.h"
+#include "crypto.h"
+#include "repair.h"
+
 NOTMUCH_BEGIN_DECLS
 
 #include <stdlib.h>
@@ -47,14 +53,6 @@ NOTMUCH_BEGIN_DECLS
 
 #include <talloc.h>
 
-#include "gmime-extra.h"
-
-#include "xutil.h"
-#include "error_util.h"
-#include "string-util.h"
-#include "crypto.h"
-#include "repair.h"
-
 #ifdef DEBUG
 # define DEBUG_DATABASE_SANITY 1
 # define DEBUG_THREADING 1
--
2.30.0
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

[PATCH] fix build failure with glib 2.67

Based on a patch from Michael J Gruber [1].  As of glib 2.67 (more
specifically [2]), including "gmime-extra.h" inside an extern "C"
block causes build failures, because glib is using C++ features.

Observing that "gmime-extra.h" is no longer needed in
notmuch-private.h, which can simply delete that include, but
we have to correspondingly move the includes which might include
it (in particular crypto.h) out of the extern "C" block also.

This seems less fragile than only moving gmime-extra, and relying on
preprocessor sentinels to keep the deeper includes from happening.

Move to the include to the outside of the extern block.

[1]: id:[hidden email]
[2]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715
---

 I neglected to change the author when amending. No fair blaming
 Michael for my potential mistakes
 
 lib/notmuch-private.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h
index 57ec7f72..41aff342 100644
--- a/lib/notmuch-private.h
+++ b/lib/notmuch-private.h
@@ -31,6 +31,12 @@
 
 #include "notmuch.h"
 
+#include "xutil.h"
+#include "error_util.h"
+#include "string-util.h"
+#include "crypto.h"
+#include "repair.h"
+
 NOTMUCH_BEGIN_DECLS
 
 #include <stdlib.h>
@@ -47,14 +53,6 @@ NOTMUCH_BEGIN_DECLS
 
 #include <talloc.h>
 
-#include "gmime-extra.h"
-
-#include "xutil.h"
-#include "error_util.h"
-#include "string-util.h"
-#include "crypto.h"
-#include "repair.h"
-
 #ifdef DEBUG
 # define DEBUG_DATABASE_SANITY 1
 # define DEBUG_THREADING 1
--
2.30.0
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Michael J Gruber Michael J Gruber
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] fix build failure with glib 2.67

David Bremner venit, vidit, dixit 2021-02-15 21:59:17:

> Based on a patch from Michael J Gruber [1].  As of glib 2.67 (more
> specifically [2]), including "gmime-extra.h" inside an extern "C"
> block causes build failures, because glib is using C++ features.
>
> Observing that "gmime-extra.h" is no longer needed in
> notmuch-private.h, which can simply delete that include, but
> we have to correspondingly move the includes which might include
> it (in particular crypto.h) out of the extern "C" block also.
>
> This seems less fragile than only moving gmime-extra, and relying on
> preprocessor sentinels to keep the deeper includes from happening.
>
> Move to the include to the outside of the extern block.
>
> [1]: id:[hidden email]
> [2]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715
> ---
>
>  I neglected to change the author when amending. No fair blaming
>  Michael for my potential mistakes

You never know before whether we share the fame or the blame :)

Anyway, the current patch is fully yours.

Cheers
Michael
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]