Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network-manager-strongswan fails to build with --with-gtk4 and warnings as errors #1829

Open
vpa1977 opened this issue Aug 4, 2023 · 2 comments
Labels

Comments

@vpa1977
Copy link

vpa1977 commented Aug 4, 2023

System (please complete the following information):

  • OS: Ubuntu 23.10
  • network-manager-strongswan version(s): 1.6.0
  • Tested/confirmed with the latest version: yes

Describe the bug

Building network-manager-strongswan with --with-gtk4 option produces following warnings:

nm-strongswan.c: In function ‘check_validity’:
nm-strongswan.c:122:9: error: ‘gtk_combo_box_get_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
122 | switch (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)))
| ^~~~~~
In file included from /usr/include/gtk-4.0/gtk/gtk.h:92,
from nm-strongswan.c:28:
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:85:15: note: declared here
85 | int gtk_combo_box_get_active (GtkComboBox *combo_box);
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c: In function ‘update_cert_fields’:
nm-strongswan.c:166:9: error: ‘gtk_combo_box_get_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
166 | switch (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)))
| ^~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:85:15: note: declared here
85 | int gtk_combo_box_get_active (GtkComboBox *combo_box);
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:169:25: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
169 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c: In function ‘update_sensitive’:
nm-strongswan.c:194:9: error: ‘gtk_combo_box_get_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
194 | switch (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)))
| ^~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:85:15: note: declared here
85 | int gtk_combo_box_get_active (GtkComboBox *combo_box);
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:197:25: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
197 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c: In function ‘chooser_button_update’:
nm-strongswan.c:279:9: error: ‘gtk_file_chooser_get_file’ is deprecated [-Werror=deprecated-declarations]
279 | file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (chooser));
| ^~~~
In file included from /usr/include/gtk-4.0/gtk/gtk.h:127:
/usr/include/gtk-4.0/gtk/deprecated/gtkfilechooser.h:120:22: note: declared here
120 | GFile * gtk_file_chooser_get_file (GtkFileChooser *chooser);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c: In function ‘chooser_response_cb’:
nm-strongswan.c:293:9: error: ‘gtk_widget_hide’ is deprecated: Use 'gtk_widget_set_visible' instead [-Werror=deprecated-declarations]
293 | gtk_widget_hide (GTK_WIDGET (chooser));
| ^~~~~~~~~~~~~~~
In file included from /usr/include/gtk-4.0/gtk/gtkapplication.h:27,
from /usr/include/gtk-4.0/gtk/gtkwindow.h:33,
from /usr/include/gtk-4.0/gtk/gtkaboutdialog.h:30,
from /usr/include/gtk-4.0/gtk/gtk.h:34:
/usr/include/gtk-4.0/gtk/gtkwidget.h:275:12: note: declared here
275 | void gtk_widget_hide (GtkWidget *widget);
| ^~~~~~~~~~~~~~~
nm-strongswan.c: In function ‘chooser_show_cb’:
nm-strongswan.c:305:9: error: ‘gtk_widget_show’ is deprecated: Use 'gtk_widget_set_visible or gtk_window_present' instead [-Werror=deprecated-declarations]
305 | gtk_widget_show (widget);
| ^~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/gtkwidget.h:273:12: note: declared here
273 | void gtk_widget_show (GtkWidget *widget);
| ^~~~~~~~~~~~~~~
nm-strongswan.c: In function ‘init_chooser’:
nm-strongswan.c:365:17: error: ‘gtk_file_chooser_set_file’ is deprecated [-Werror=deprecated-declarations]
365 | gtk_file_chooser_set_file (GTK_FILE_CHOOSER (widget), file, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkfilechooser.h:122:22: note: declared here
122 | gboolean gtk_file_chooser_set_file (GtkFileChooser *chooser,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c: In function ‘init_plugin_ui’:
nm-strongswan.c:434:9: error: ‘gtk_combo_box_text_append_text’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
434 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), _("EAP (Username/Password)"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-4.0/gtk/gtk.h:93:
/usr/include/gtk-4.0/gtk/deprecated/gtkcomboboxtext.h:43:15: note: declared here
43 | void gtk_combo_box_text_append_text (GtkComboBoxText *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:435:9: error: ‘gtk_combo_box_text_append_text’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
435 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), _("Certificate"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcomboboxtext.h:43:15: note: declared here
43 | void gtk_combo_box_text_append_text (GtkComboBoxText *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:436:9: error: ‘gtk_combo_box_text_append_text’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
436 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), _("EAP-TLS"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcomboboxtext.h:43:15: note: declared here
43 | void gtk_combo_box_text_append_text (GtkComboBoxText *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:437:9: error: ‘gtk_combo_box_text_append_text’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
437 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), _("Pre-shared key"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcomboboxtext.h:43:15: note: declared here
43 | void gtk_combo_box_text_append_text (GtkComboBoxText *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:440:25: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
440 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:447:25: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
447 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:450:25: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
450 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 2);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:453:25: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
453 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 3);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:456:9: error: ‘gtk_combo_box_get_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
456 | if (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)) == -1)
| ^~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:85:15: note: declared here
85 | int gtk_combo_box_get_active (GtkComboBox *combo_box);
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:458:17: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
458 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:463:9: error: ‘gtk_combo_box_text_append_text’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
463 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), _("Certificate/private key"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcomboboxtext.h:43:15: note: declared here
43 | void gtk_combo_box_text_append_text (GtkComboBoxText *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:464:9: error: ‘gtk_combo_box_text_append_text’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
464 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), _("Certificate/ssh-agent"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcomboboxtext.h:43:15: note: declared here
43 | void gtk_combo_box_text_append_text (GtkComboBoxText *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:465:9: error: ‘gtk_combo_box_text_append_text’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
465 | gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), _("Smartcard"));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcomboboxtext.h:43:15: note: declared here
43 | void gtk_combo_box_text_append_text (GtkComboBoxText *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:474:25: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
474 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:477:25: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
477 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:480:25: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
480 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 2);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:483:9: error: ‘gtk_combo_box_get_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
483 | if (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)) == -1)
| ^~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:85:15: note: declared here
85 | int gtk_combo_box_get_active (GtkComboBox *combo_box);
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c:485:17: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
485 | gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:87:15: note: declared here
87 | void gtk_combo_box_set_active (GtkComboBox *combo_box,
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c: In function ‘save_file_chooser’:
nm-strongswan.c:600:9: error: ‘gtk_file_chooser_get_file’ is deprecated [-Werror=deprecated-declarations]
600 | file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (chooser));
| ^~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkfilechooser.h:120:22: note: declared here
120 | GFile * gtk_file_chooser_get_file (GtkFileChooser *chooser);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c: In function ‘save_cert’:
nm-strongswan.c:633:9: error: ‘gtk_combo_box_get_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
633 | switch (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)))
| ^~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:85:15: note: declared here
85 | int gtk_combo_box_get_active (GtkComboBox *combo_box);
| ^~~~~~~~~~~~~~~~~~~~~~~~
nm-strongswan.c: In function ‘update_connection’:
nm-strongswan.c:688:9: error: ‘gtk_combo_box_get_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
688 | switch (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)))
| ^~~~~~
/usr/include/gtk-4.0/gtk/deprecated/gtkcombobox.h:85:15: note: declared here
85 | int gtk_combo_box_get_active (GtkComboBox *combo_box);
| ^~~~~~~~~~~~~~~~~~~~~~~~

To Reproduce
Steps to reproduce the behavior:

  1. configure --with-gtk4
  2. build

Expected behavior
build sucessfull

Logs/Backtraces
Failing build

Additional context
Add any other context about the problem here.

@tobiasbrunner
Copy link
Member

Since the same file is also compiled against GTK 3 (the GUI file is simply converted with gtk4-builder-tool on the fly), I've currently no plans to do much about this until the deprecated functions are actually removed (or we don't need support for GTK 3 anymore). I guess some functions (e.g. gtk_widget_show()) we could handle like the existing defines at the top of the file, but e.g. GtkDropDown doesn't exist in GTK 3, neither does GtkFileDialog.

What's weird is that the compilation works with GDK_DISABLE_DEPRECATION_WARNINGS, i.e. that these are only warnings as we do currently set GDK_DISABLE_DEPRECATED in CFLAGS.

@tobiasbrunner tobiasbrunner removed the new label Aug 4, 2023
@thystra
Copy link

thystra commented Oct 12, 2023

I ran into this problem, I added
#define GDK_DISABLE_DEPRECATION_WARNINGS
to the top of config.h and it successfully compiled and made & installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants