Subject: bug#33679: closed (Re: bug#33679: Emacs uses APIs deprecated in WebKitGTK 2.21.1)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 21 Aug 2020 21:53:02 +0000

Your bug report

#33679: Emacs uses APIs deprecated in WebKitGTK 2.21.1

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
33679: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33679
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#33679: Emacs uses APIs deprecated in WebKitGTK 2.21.1
From: Paul Eggert <[email-masked]>
To: Lars Ingebrigtsen <[email-masked]>
Cc: Ricardo Wurmus <[email-masked]>, [email-masked], Joakim Verona <[email-masked]>
Date: Fri, 21 Aug 2020 14:51:54 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

On 8/21/20 5:10 AM, Lars Ingebrigtsen wrote:
> Paul, it looks like this patch was never applied?

The patch was applied, but was later removed when Jimmy Aguilar Mena fixed the 
underlying problem in 2019-09-17T20:00:[email-masked]. Closing the 
bug report.

Subject: Emacs uses APIs deprecated in WebKitGTK 2.21.1
From: Paul Eggert <[email-masked]>
To: Emacs bug reports <[email-masked]>
Cc: Ricardo Wurmus <[email-masked]>, Joakim Verona <[email-masked]>
Date: Sat, 8 Dec 2018 15:59:36 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

I hadn't built Emacs lately with xwidgets support. When I tried it on Fedora 29 
via './configure --with-xwidgets --enable-gcc-warnings' the build failed with 
the diagnostics at the end of this message. Apparently WebKitGTK has mutated and 
Emacs hasn't kept up. Although I plan to work around the immediate problem by 
installing the attached patch on master, could an xwidgets expert please fix 
this the "right" way by using the JavaScriptCore GLib API instead? Thanks.

   CC       xwidget.o
xwidget.c: In function ‘webkit_javascript_finished_cb’:
xwidget.c:393:2: error: ‘webkit_javascript_result_get_global_context’ is 
deprecated [-Werror=deprecated-declarations]
   context = webkit_javascript_result_get_global_context (js_result);
   ^~~~~~~
In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:54,
                  from xwidget.c:30:
/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:49:1: note: declared 
here
  webkit_javascript_result_get_global_context (WebKitJavascriptResult *js_result);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xwidget.c:394:2: error: ‘webkit_javascript_result_get_value’ is deprecated: Use 
'webkit_javascript_result_get_js_value' instead [-Werror=deprecated-declarations]
   value = webkit_javascript_result_get_value (js_result);
   ^~~~~
In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:54,
                  from xwidget.c:30:
/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:52:1: note: declared 
here
  webkit_javascript_result_get_value          (WebKitJavascriptResult *js_result);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:384: xwidget.o] Error 1
make[1]: Leaving directory '/home/eggert/src/gnu/emacs/master-tmp/src'
make: *** [Makefile:421: src] Error 2
>From bcdda254cb249950812a6b7122278a4d63761194 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Sat, 8 Dec 2018 15:29:07 -0800
Subject: [PATCH] Suppress WebKitGTK+ 2.21.1 diagnostics

* src/xwidget.c: Suppress deprecation warnings.
---
 src/xwidget.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/xwidget.c b/src/xwidget.c
index 6da7a0bb3f..24f7d39077 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -30,6 +30,14 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include <webkit2/webkit2.h>
 #include <JavaScriptCore/JavaScript.h>
 
+/* Suppress GCC deprecation warnings starting in WebKitGTK+ 2.21.1 for
+   webkit_javascript_result_get_global_context and
+   webkit_javascript_result_get_value.
+   FIXME: Use the JavaScriptCore GLib API instead, and remove this hack.  */
+#if WEBKIT_CHECK_VERSION (2, 21, 1) && GNUC_PREREQ (4, 2, 0)
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 static struct xwidget *
 allocate_xwidget (void)
 {
-- 
2.19.2