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 783882 - geary fails to build on s390x
geary fails to build on s390x
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: build
master
Other Linux
: Normal normal
: 0.12.0
Assigned To: Geary Maintainers
Geary Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-06-17 02:30 UTC by Jeremy Bicha
Modified: 2017-09-25 03:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that fixes the issue (1.63 KB, patch)
2017-08-10 13:27 UTC, Gianfranco Costamagna
none Details | Review

Description Jeremy Bicha 2017-06-17 02:30:15 UTC
geary git master fails to build on s390x on Ubuntu 17.10 Alpha but it builds on other architectures.

Full build log at
https://launchpad.net/ubuntu/+source/geary/0.12~20170613-0ubuntu1/+build/12760898


[ 83%] Generating .geary-web-process.stamp
cd "/<<PKGBUILDDIR>>/obj-s390x-linux-gnu/src" && /usr/bin/valac -C -b /<<PKGBUILDDIR>>/src -d /<<PKGBUILDDIR>>/obj-s390x-linux-gnu/src --pkg=geary-engine --pkg=gee-0.8 --pkg=gtk+-3.0 --pkg=javascriptcore-4.0 --pkg=libsoup-2.4 --pkg=webkit2gtk-web-extension-4.0 --pkg=gee-0.8 --pkg=gio-2.0 --pkg=glib-2.0 --pkg=gmime-2.6 --pkg=javascriptcore-4.0 --pkg=libxml-2.0 --pkg=posix --pkg=sqlite3 --vapidir=/<<PKGBUILDDIR>>/obj-s390x-linux-gnu/src --vapidir=/<<PKGBUILDDIR>>/bindings/vapi --metadatadir=/<<PKGBUILDDIR>>/bindings/metadata --target-glib=2.42 --thread --debug --enable-checking --enable-deprecated --fatal-warnings -D HAVE_LIBMESSAGINGMENU -D HAVE_LIBUNITY -D GTK_3_20 -D GTK_3_22 /<<PKGBUILDDIR>>/src/client/web-process/web-process-extension.vala
/<<PKGBUILDDIR>>/src/client/web-process/web-process-extension.vala:89.26-89.72: error: Assignment: Cannot convert from `void*' to `JS.GlobalContext'
        JS.GlobalContext context = frame.get_javascript_global_context();
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/<<PKGBUILDDIR>>/src/client/web-process/web-process-extension.vala:92.17-92.23: error: The name `context' does not exist in the context of `GearyWebExtension.should_load_remote_images'
                context, "geary.allowRemoteImages", int.parse("__LINE__")
                ^^^^^^^
/<<PKGBUILDDIR>>/src/client/web-process/web-process-extension.vala:94.42-94.48: error: The name `context' does not exist in the context of `GearyWebExtension.should_load_remote_images'
            should_load = ret.to_boolean(context);
                                         ^^^^^^^
/<<PKGBUILDDIR>>/src/client/web-process/web-process-extension.vala:106.26-106.72: error: Assignment: Cannot convert from `void*' to `JS.GlobalContext'
        JS.GlobalContext context = frame.get_javascript_global_context();
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/<<PKGBUILDDIR>>/src/client/web-process/web-process-extension.vala:109.17-109.23: error: The name `context' does not exist in the context of `GearyWebExtension.remote_image_load_blocked'
                context, "geary.remoteImageLoadBlocked();", int.parse("__LINE__")
                ^^^^^^^
/<<PKGBUILDDIR>>/src/client/web-process/web-process-extension.vala:121.26-121.72: error: Assignment: Cannot convert from `void*' to `JS.GlobalContext'
        JS.GlobalContext context = frame.get_javascript_global_context();
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/<<PKGBUILDDIR>>/src/client/web-process/web-process-extension.vala:124.17-124.23: error: The name `context' does not exist in the context of `GearyWebExtension.selection_changed'
                context, "geary.selectionChanged();", int.parse("__LINE__")
                ^^^^^^^
Compilation failed: 7 error(s), 0 warning(s)
src/CMakeFiles/geary-web-process.dir/build.make:67: recipe for target 'src/.geary-web-process.stamp' failed
make[3]: *** [src/.geary-web-process.stamp] Error 1
Comment 1 Gianfranco Costamagna 2017-08-10 13:26:08 UTC
I have tried a patch that "fixed" the issue, however I'm not sure if something breaks at runtime (I looked at vala binding, and a casting seems to be good enough, even if I don't know why they return void* and why only s390x breaks)

```
+--- geary-0.12~20170613.orig/src/client/web-process/web-process-extension.vala
++++ geary-0.12~20170613/src/client/web-process/web-process-extension.vala
+@@ -86,7 +86,7 @@ public class GearyWebExtension : Object
+     private bool should_load_remote_images(WebKit.WebPage page) {
+         bool should_load = false;
+         WebKit.Frame frame = page.get_main_frame();
+-        JS.GlobalContext context = frame.get_javascript_global_context();
++        JS.GlobalContext context = (JS.GlobalContext) frame.get_javascript_global_context();
+         try {
+             JS.Value ret = execute_script(
+                 context, "geary.allowRemoteImages", int.parse("__LINE__")
+@@ -103,7 +103,7 @@ public class GearyWebExtension : Object
+ 
+     private void remote_image_load_blocked(WebKit.WebPage page) {
+         WebKit.Frame frame = page.get_main_frame();
+-        JS.GlobalContext context = frame.get_javascript_global_context();
++        JS.GlobalContext context = (JS.GlobalContext) frame.get_javascript_global_context();
+         try {
+             execute_script(
+                 context, "geary.remoteImageLoadBlocked();", int.parse("__LINE__")
+@@ -118,7 +118,7 @@ public class GearyWebExtension : Object
+ 
+     private void selection_changed(WebKit.WebPage page) {
+         WebKit.Frame frame = page.get_main_frame();
+-        JS.GlobalContext context = frame.get_javascript_global_context();
++        JS.GlobalContext context = (JS.GlobalContext) frame.get_javascript_global_context();
+         try {
+             execute_script(
+                 context, "geary.selectionChanged();", int.parse("__LINE__")

```
Comment 2 Gianfranco Costamagna 2017-08-10 13:27:06 UTC
Created attachment 357339 [details] [review]
patch that fixes the issue
Comment 3 Jeremy Bicha 2017-09-24 20:29:22 UTC
Gianfranco's patch also fixes the same build failure on Debian's ppc64 architecture.
Comment 4 Michael Gratton 2017-09-25 02:11:13 UTC
Pushed to master as commit ee76477. Thanks!
Comment 5 Michael Gratton 2017-09-25 03:01:32 UTC
Should be able to revert this workaround once Bug 788113 lands.