Bug 570559 - Compilation error in SWT native build
Summary: Compilation error in SWT native build
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.19   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.19 M3   Edit
Assignee: Sravan Kumar Lakkimsetti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-21 21:17 EST by Sravan Kumar Lakkimsetti CLA
Modified: 2021-02-06 02:45 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sravan Kumar Lakkimsetti CLA 2021-01-21 21:17:29 EST
We are getting compilation error during native build

cc -O -Wall -fPIC -DSWT_VERSION=4942r17    -DLINUX -DGTK -I/opt/tools/java/oracle/jdk-8/latest/include -I/opt/tools/java/oracle/jdk-8/latest/include/linux -DJNI64 -Werror `pkg-config --cflags gtk+-3.0 gtk+-unix-print-3.0` -c os_custom.c
 os_custom.c: In function 'Java_org_eclipse_swt_internal_gtk_GTK__1gtk_1im_1context_1filter_1keypress':
 os_custom.c:164:9: error: unknown option after '#pragma GCC diagnostic' kind [-Werror=pragmas]
  #pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
          ^
 os_custom.c:165:2: error: passing argument 2 of 'gtk_im_context_filter_keypress' from incompatible pointer type [-Werror]
   rc = (jboolean)gtk_im_context_filter_keypress((GtkIMContext *)arg0, (GdkEvent *)arg1);
   ^
 In file included from /usr/include/gtk-3.0/gtk/gtkentry.h:38:0,
                  from /usr/include/gtk-3.0/gtk/gtktreeview.h:29,
                  from /usr/include/gtk-3.0/gtk/gtkcombobox.h:27,
                  from /usr/include/gtk-3.0/gtk/gtkappchooserbutton.h:29,
                  from /usr/include/gtk-3.0/gtk/gtk.h:42,
                  from os.h:30,
                  from os_structs.h:19,
                  from os_custom.c:17:
 /usr/include/gtk-3.0/gtk/gtkimcontext.h:108:10: note: expected 'struct GdkEventKey *' but argument is of type 'union GdkEvent *'
  gboolean gtk_im_context_filter_keypress     (GtkIMContext       *context,
           ^
 cc1: all warnings being treated as errors
 make: *** [os_custom.o] Error 1
 [0;31m*** GTK3 Build failed, aborting further actions..[0m

https://ci.eclipse.org/releng/job/gtk_linux_x86_64_pipeline_chromium/187/console

This was introduced by https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a743711b6bfaf322eebcfd54f7cfa79598b2b141
Comment 1 Alexander Kurtakov CLA 2021-01-26 15:01:53 EST
Sravan, I propose moving the rhel 7 build machines to rhel 8 that would bump gcc from 4.8 to 8.3 while gtk3 stays at gtk 3.22 level. RHEL 7 is in maitenance phase 2 so we should start phasing it out as not much (if anything) that's important for us will change on it.
Having to align to gcc 4.8 features nowadays becomes too hard requirement to fullfill and consider on changes.
Comment 2 Alexandr Miloslavskiy CLA 2021-01-26 15:23:28 EST
According to what I see in documentation the build machine must be super ancient.
'#pragma GCC diagnostic ignored' is since gcc 4.2.0 [1] released in 2007 [3]
'#pragma GCC diagnostic pop'     is since gcc 4.6.0 [2] released in 2011 [3]

According to the error, features from 2007 are still not supported on build machine! Indeed it's a pain to support that. For comparison, GTK 3.22 is from 2016.

[1] https://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Diagnostic-Pragmas.html
[2] https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Diagnostic-Pragmas.html
[3] https://gcc.gnu.org/releases.html
Comment 3 Alexandr Miloslavskiy CLA 2021-01-26 19:03:06 EST
The problem was solved with a revert [1], I have now submitted an improved fix in Bug 570533

[1] https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/175194
Comment 4 Sravan Kumar Lakkimsetti CLA 2021-01-26 23:36:23 EST
(In reply to Alexander Kurtakov from comment #1)
> Sravan, I propose moving the rhel 7 build machines to rhel 8 that would bump
> gcc from 4.8 to 8.3 while gtk3 stays at gtk 3.22 level. RHEL 7 is in
> maitenance phase 2 so we should start phasing it out as not much (if
> anything) that's important for us will change on it.
> Having to align to gcc 4.8 features nowadays becomes too hard requirement to
> fullfill and consider on changes.

I am fine with that. Right now we are blocked with bug 570675. We cannot build new docker image for build because of that.
Comment 5 Sravan Kumar Lakkimsetti CLA 2021-01-27 05:45:23 EST
(In reply to Alexandr Miloslavskiy from comment #2)
> According to what I see in documentation the build machine must be super
> ancient.
> '#pragma GCC diagnostic ignored' is since gcc 4.2.0 [1] released in 2007 [3]
> '#pragma GCC diagnostic pop'     is since gcc 4.6.0 [2] released in 2011 [3]
> 
> According to the error, features from 2007 are still not supported on build
> machine! Indeed it's a pain to support that. For comparison, GTK 3.22 is
> from 2016.
> 
> [1] https://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Diagnostic-Pragmas.html
> [2] https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Diagnostic-Pragmas.html
> [3] https://gcc.gnu.org/releases.html

But we are using gcc-4.8.5-44.el7.x86_64

See: https://ci.eclipse.org/releng/view/Docker%20Build/job/Build-Docker-images/lastSuccessfulBuild/artifact/eclipse.platform.releng.aggregator/cje-production/dockerfiles/swt_build.log/*view*/
Comment 6 Eclipse Genie CLA 2021-01-27 05:51:27 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.releng.aggregator/+/175401
Comment 7 Alexander Kurtakov CLA 2021-01-27 05:54:03 EST
It is possible that the version we have support for pragmas ignored in general but not for all warning types and specifically the one I tried to use. Either way I don't plan spending more time investigating what's wrong with gcc 4.8 - it's dead version for me and Alexandr started working on better approach already. This doesn't remove the need to update our infrastructure though.