unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / Atom feed
* [PATCH] fix FTBFS with glib
@ 2021-02-11 14:51 Michael J Gruber
  2021-02-12 12:57 ` David Bremner
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Michael J Gruber @ 2021-02-11 14:51 UTC (permalink / raw)
  To: notmuch

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 <git@grubix.eu>
---
 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix FTBFS with glib
  2021-02-11 14:51 [PATCH] fix FTBFS with glib Michael J Gruber
@ 2021-02-12 12:57 ` David Bremner
  2021-02-12 15:01   ` Michael J Gruber
  2021-02-12 18:48 ` Tomi Ollila
  2021-02-13 21:22 ` [PATCH] fix build failure with glib 2.67 David Bremner
  2 siblings, 1 reply; 8+ messages in thread
From: David Bremner @ 2021-02-12 12:57 UTC (permalink / raw)
  To: Michael J Gruber, notmuch

Michael J Gruber <git@grubix.eu> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix FTBFS with glib
  2021-02-12 12:57 ` David Bremner
@ 2021-02-12 15:01   ` Michael J Gruber
  0 siblings, 0 replies; 8+ messages in thread
From: Michael J Gruber @ 2021-02-12 15:01 UTC (permalink / raw)
  To: David Bremner, notmuch

David Bremner venit, vidit, dixit 2021-02-12 13:57:29:
> Michael J Gruber <git@grubix.eu> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix FTBFS with glib
  2021-02-11 14:51 [PATCH] fix FTBFS with glib Michael J Gruber
  2021-02-12 12:57 ` David Bremner
@ 2021-02-12 18:48 ` Tomi Ollila
  2021-02-12 19:51   ` Michael J Gruber
  2021-02-13 21:22 ` [PATCH] fix build failure with glib 2.67 David Bremner
  2 siblings, 1 reply; 8+ messages in thread
From: Tomi Ollila @ 2021-02-12 18:48 UTC (permalink / raw)
  To: Michael J Gruber, notmuch

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 <git@grubix.eu>
> ---
>  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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix FTBFS with glib
  2021-02-12 18:48 ` Tomi Ollila
@ 2021-02-12 19:51   ` Michael J Gruber
  0 siblings, 0 replies; 8+ messages in thread
From: Michael J Gruber @ 2021-02-12 19:51 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] fix build failure with glib 2.67
  2021-02-11 14:51 [PATCH] fix FTBFS with glib Michael J Gruber
  2021-02-12 12:57 ` David Bremner
  2021-02-12 18:48 ` Tomi Ollila
@ 2021-02-13 21:22 ` David Bremner
  2021-02-15 20:59   ` David Bremner
  2 siblings, 1 reply; 8+ messages in thread
From: David Bremner @ 2021-02-13 21:22 UTC (permalink / raw)
  To: Michael J Gruber, notmuch

From: Michael J Gruber <git@grubix.eu>

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:aee618a3d41f7889a7449aa16893e992325a909a.1613055071.git.git@grubix.eu
[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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] fix build failure with glib 2.67
  2021-02-13 21:22 ` [PATCH] fix build failure with glib 2.67 David Bremner
@ 2021-02-15 20:59   ` David Bremner
  2021-02-15 21:29     ` Michael J Gruber
  0 siblings, 1 reply; 8+ messages in thread
From: David Bremner @ 2021-02-15 20:59 UTC (permalink / raw)
  To: David Bremner, Michael J Gruber, notmuch

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:aee618a3d41f7889a7449aa16893e992325a909a.1613055071.git.git@grubix.eu
[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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix build failure with glib 2.67
  2021-02-15 20:59   ` David Bremner
@ 2021-02-15 21:29     ` Michael J Gruber
  0 siblings, 0 replies; 8+ messages in thread
From: Michael J Gruber @ 2021-02-15 21:29 UTC (permalink / raw)
  To: David Bremner, notmuch

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:aee618a3d41f7889a7449aa16893e992325a909a.1613055071.git.git@grubix.eu
> [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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-02-15 21:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11 14:51 [PATCH] fix FTBFS with glib Michael J Gruber
2021-02-12 12:57 ` David Bremner
2021-02-12 15:01   ` Michael J Gruber
2021-02-12 18:48 ` Tomi Ollila
2021-02-12 19:51   ` Michael J Gruber
2021-02-13 21:22 ` [PATCH] fix build failure with glib 2.67 David Bremner
2021-02-15 20:59   ` David Bremner
2021-02-15 21:29     ` Michael J Gruber

unofficial mirror of notmuch@notmuchmail.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/notmuch/0 notmuch/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 notmuch notmuch/ https://yhetil.org/notmuch \
		notmuch@notmuchmail.org
	public-inbox-index notmuch

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.mail.notmuch.general
	nntp://news.gmane.io/gmane.mail.notmuch.general


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git