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

gnome.marshal() accept files in addition to strings for the sources #9827

Closed
flaphoschi opened this issue Jan 14, 2022 · 7 comments · Fixed by #9828
Closed

gnome.marshal() accept files in addition to strings for the sources #9827

flaphoschi opened this issue Jan 14, 2022 · 7 comments · Fixed by #9828

Comments

@flaphoschi
Copy link

flaphoschi commented Jan 14, 2022

Hello!
Since meson > 0.61 the method gnome.marshal() doesn't accept anymore a list of files for the parameter sources. According to the documentation this is correct:

sources []str required: List of string sources to consume
sources: the list of sources to use as inputs

I assume a more strict and therefore better type checking. The maintainers of gnome-terminal prefer to keep passing files. Is it possible to extend the API?

@eli-schwartz
Copy link
Member

eli-schwartz commented Jan 14, 2022

The argument is semantically files, and as such we generally expect to allow files objects in addition to strings naming a file.

The added type checking violated that constraint in many places -- I already fixed this for gtkdoc() and gdbus_codegen() in git master, but I didn't do a full cleanup, so more are probably lurking...

This is a regression and needs to be fixed for 0.61.1.

Update: apparently we used to only accept a string or an array of strings, with homebrew typechecking that only validated a list but not what was in it. However, it is not unreasonable to use files() here, and we immediately pass it in to a custom_target as inputs, which obviously works flawlessly, so the error message if you used files('foo')[0] (not an array, just a files object) was wrong and bad IMO.

eli-schwartz added a commit to eli-schwartz/meson that referenced this issue Jan 14, 2022
It used to support:
- a single string
- an array of anything

And as long as CustomTarget supported it too, everything worked fine.
So, a `files('foo')` worked but a `files('foo')[0]` did not, which is
silly... and it's not exactly terrible to use files() here, the input is
literally a list of source files.

Fixes building gnome-terminal
Fixes mesonbuild#9827
@eli-schwartz
Copy link
Member

Can you try the linked PR?

eli-schwartz added a commit to eli-schwartz/meson that referenced this issue Jan 14, 2022
It used to support:
- a single string
- an array of anything

And as long as CustomTarget supported it too, everything worked fine.
So, a `files('foo')` worked but a `files('foo')[0]` did not, which is
silly... and it's not exactly terrible to use files() here, the input is
literally a list of source files.

Fixes building gnome-terminal
Fixes mesonbuild#9827
@gardotd426
Copy link

Trying the PR gives no sources []str required: List of string sources to consume sources: the list of sources to use as inputs error, but it fails at:


gnome-terminal-3.42.2/data/meson.build:20:5: ERROR: Function does not take positional arguments.

A full log can be found at /home/matt2/.cache/yay/gnome-terminal-fedora/src/build/meson-logs/meson-log.txt
==> ERROR: A failure occurred in build().
    Aborting...

Here's the entire log from makepkg -s 2>&1 | tee build.log

Here's the entire ~/.cache/yay/gnome-terminal-fedora/src/build/meson-logs/meson-log.txt

nirbheek pushed a commit to eli-schwartz/meson that referenced this issue Jan 15, 2022
It used to support:
- a single string
- an array of anything

And as long as CustomTarget supported it too, everything worked fine.
So, a `files('foo')` worked but a `files('foo')[0]` did not, which is
silly... and it's not exactly terrible to use files() here, the input is
literally a list of source files.

Fixes building gnome-terminal
Fixes mesonbuild#9827

Test updated by Nirbheek Chauhan <nirbheek@centricular.com>
@flaphoschi
Copy link
Author

Thanks for your help! The other problem with the positional arguments is already fixed in the master branch of gnome-terminal.

@gardotd426
Copy link

Still failing, with new errors:

Found ninja-1.10.2 at /usr/bin/ninja
ninja: Entering directory `/home/matt2/.cache/yay/gnome-terminal-fedora/src/build'                  
[33/201] Generating src/terminal-marshal_c with a custom command
INFO: Reading ../gnome-terminal-3.42.2/src/terminal-marshal.list...
[34/201] Generating src/terminal-marshal_h with a custom command
INFO: Reading ../gnome-terminal-3.42.2/src/terminal-marshal.list...
[129/201] Generating man/gnome-terminal.1 with a custom command
Warn: meta author : no refentry/info/author                        gnome-terminal
Note: meta author : see http://www.docbook.org/tdg5/en/html/autho  gnome-terminal
Warn: meta author : no author data, so inserted a fixme            gnome-terminal
[189/201] Compiling C++ object src/gnome-terminal-server.p/terminal-screen.cc.o
FAILED: src/gnome-terminal-server.p/terminal-screen.cc.o 
ccache c++ -Isrc/gnome-terminal-server.p -Isrc -I../gnome-terminal-3.42.2/src -I. -I../gnome-terminal-3.42.2 -I/usr/include/dconf -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -I/usr/include/gsettings-desktop-schemas -I/usr/include/uuid -I/usr/include/vte-2.91 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -std=gnu++14 -Waggregate-return -Wall -Wcast-align -Wendif-labels -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Wextra -Wfloat-equal -Wformat-signedness -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-switch-enum -Wno-unused-parameter -Wpacked -Wshadow -Wsign-compare -Wstrict-aliasing=2 -Wundef -Wuninitialized -Wunsafe-loop-optimizations -Wvla -Wwrite-strings -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing -Wimplicit-fallthrough=5 -Wnon-virtual-dtor -Wstrict-null-sentinel -fvisibility-inlines-hidden -fvisibility=hidden -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -D_FORTIFY_SOURCE=2 -fPIE -pthread -DTERMINAL_COMPILATION -DVTE_DISABLE_DEPRECATION_WARNINGS '-DTERM_LOCALEDIR="/usr/share/locale"' '-DTERM_PKGLIBDIR="/usr/lib/gnome-terminal"' -MD -MQ src/gnome-terminal-server.p/terminal-screen.cc.o -MF src/gnome-terminal-server.p/terminal-screen.cc.o.d -o src/gnome-terminal-server.p/terminal-screen.cc.o -c ../gnome-terminal-3.42.2/src/terminal-screen.cc
In file included from /usr/lib/glib-2.0/include/glibconfig.h:9,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:22,
                 from ../gnome-terminal-3.42.2/src/terminal-screen.hh:22,
                 from ../gnome-terminal-3.42.2/src/terminal-screen.cc:23:
../gnome-terminal-3.42.2/src/terminal-screen.cc: In function ‘gboolean terminal_screen_reexec_from_screen_with_override_command(TerminalScreen*, TerminalScreen*, char**, GCancellable*, GError**)’:
../gnome-terminal-3.42.2/src/terminal-screen.cc:891:29: error: ‘data’ was not declared in this scope
  891 |       g_return_val_if_fail (data != nullptr, FALSE);
      |                             ^~~~
/usr/include/glib-2.0/glib/gmacros.h:1081:8: note: in definition of macro ‘_G_BOOLEAN_EXPR’
 1081 |    if (expr)                                    \
      |        ^~~~
/usr/include/glib-2.0/glib/gmessages.h:645:9: note: in expansion of macro ‘G_LIKELY’
  645 |     if (G_LIKELY (expr)) \
      |         ^~~~~~~~
../gnome-terminal-3.42.2/src/terminal-screen.cc:891:7: note: in expansion of macro ‘g_return_val_if_fail’
  891 |       g_return_val_if_fail (data != nullptr, FALSE);
      |       ^~~~~~~~~~~~~~~~~~~~
../gnome-terminal-3.42.2/src/terminal-screen.cc:893:19: error: ‘data’ was not declared in this scope
  893 |       g_strfreev (data->argv);
      |                   ^~~~
[198/201] Compiling C++ object src/gnome-terminal-server.p/terminal-window.cc.o
../gnome-terminal-3.42.2/src/terminal-window.cc: In function ‘void action_set_title_cb(GSimpleAction*, GVariant*, gpointer)’:
../gnome-terminal-3.42.2/src/terminal-window.cc:845:56: warning: cast between incompatible function types from ‘void (*)(GtkWidget*)’ {aka ‘void (*)(_GtkWidget*)’} to ‘GtkCallback’ {aka ‘void (*)(_GtkWidget*, void*)’} [-Wcast-function-type]
  845 |   gtk_container_foreach (GTK_CONTAINER (message_area), (GtkCallback) gtk_widget_hide, nullptr);
      |                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:24,
                 from /usr/include/glib-2.0/gobject/gbinding.h:29,
                 from /usr/include/glib-2.0/glib-object.h:22,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28,
                 from /usr/include/gtk-3.0/gdk/gdk.h:32,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from ../gnome-terminal-3.42.2/src/terminal-window.cc:28:
/usr/include/gtk-3.0/gtk/deprecated/gtkmisc.h:38:59: warning: ‘GType gtk_misc_get_type()’ is deprecated [-Wdeprecated-declarations]
   38 | #define GTK_TYPE_MISC                  (gtk_misc_get_type ())
      |                                         ~~~~~~~~~~~~~~~~~~^~
/usr/include/glib-2.0/gobject/gtype.h:2417:61: note: in definition of macro ‘_G_TYPE_CIC’
 2417 |     ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt))
      |                                                             ^~
/usr/include/gtk-3.0/gtk/deprecated/gtkmisc.h:39:41: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_CAST’
   39 | #define GTK_MISC(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MISC, GtkMisc))
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-3.0/gtk/deprecated/gtkmisc.h:39:76: note: in expansion of macro ‘GTK_TYPE_MISC’
   39 | #define GTK_MISC(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MISC, GtkMisc))
      |                                                                            ^~~~~~~~~~~~~
../gnome-terminal-3.42.2/src/terminal-window.cc:851:27: note: in expansion of macro ‘GTK_MISC’
  851 |   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
      |                           ^~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtklabel.h:32,
                 from /usr/include/gtk-3.0/gtk/gtkaccellabel.h:35,
                 from /usr/include/gtk-3.0/gtk/gtk.h:33,
                 from ../gnome-terminal-3.42.2/src/terminal-window.cc:28:
/usr/include/gtk-3.0/gtk/deprecated/gtkmisc.h:70:9: note: declared here
   70 | GType   gtk_misc_get_type      (void) G_GNUC_CONST;
      |         ^~~~~~~~~~~~~~~~~
../gnome-terminal-3.42.2/src/terminal-window.cc:851:26: warning: ‘void gtk_misc_set_alignment(GtkMisc*, gfloat, gfloat)’ is deprecated [-Wdeprecated-declarations]
  851 |   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
      |   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtklabel.h:32,
                 from /usr/include/gtk-3.0/gtk/gtkaccellabel.h:35,
                 from /usr/include/gtk-3.0/gtk/gtk.h:33,
                 from ../gnome-terminal-3.42.2/src/terminal-window.cc:28:
/usr/include/gtk-3.0/gtk/deprecated/gtkmisc.h:72:9: note: declared here
   72 | void    gtk_misc_set_alignment (GtkMisc *misc,
      |         ^~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
    Aborting...

Though I don't know if that's meson or gnome-terminal.

nirbheek pushed a commit to eli-schwartz/meson that referenced this issue Jan 15, 2022
It used to support:
- a single string
- an array of anything

And as long as CustomTarget supported it too, everything worked fine.
So, a `files('foo')` worked but a `files('foo')[0]` did not, which is
silly... and it's not exactly terrible to use files() here, the input is
literally a list of source files.

Fixes building gnome-terminal
Fixes mesonbuild#9827

Test updated by Nirbheek Chauhan <nirbheek@centricular.com>
nirbheek pushed a commit to eli-schwartz/meson that referenced this issue Jan 15, 2022
It used to support:
- a single string
- an array of anything

And as long as CustomTarget supported it too, everything worked fine.
So, a `files('foo')` worked but a `files('foo')[0]` did not, which is
silly... and it's not exactly terrible to use files() here, the input is
literally a list of source files.

Fixes building gnome-terminal
Fixes mesonbuild#9827

Test updated by Nirbheek Chauhan <nirbheek@centricular.com>
nirbheek pushed a commit that referenced this issue Jan 15, 2022
It used to support:
- a single string
- an array of anything

And as long as CustomTarget supported it too, everything worked fine.
So, a `files('foo')` worked but a `files('foo')[0]` did not, which is
silly... and it's not exactly terrible to use files() here, the input is
literally a list of source files.

Fixes building gnome-terminal
Fixes #9827

Test updated by Nirbheek Chauhan <nirbheek@centricular.com>
@eli-schwartz
Copy link
Member

/cc @paper42 for linked PR

nirbheek pushed a commit that referenced this issue Jan 16, 2022
It used to support:
- a single string
- an array of anything

And as long as CustomTarget supported it too, everything worked fine.
So, a `files('foo')` worked but a `files('foo')[0]` did not, which is
silly... and it's not exactly terrible to use files() here, the input is
literally a list of source files.

Fixes building gnome-terminal
Fixes #9827

Test updated by Nirbheek Chauhan <nirbheek@centricular.com>
@flaphoschi
Copy link
Author

flaphoschi commented Jan 16, 2022

Still failing, with new errors:
...
Though I don't know if that's meson or gnome-terminal.

Not related to meson.

The PATCH 16/16 you use relies upon a revert within the branch gnome-41 which is not present in master. I assume gnome-terminal will release a 3.42.3 which contains the fix which removes the positional arguments and you will be fine.

Sorry for Off-Topic.
Thanks for all your help 🙂

Dudemanguy pushed a commit to Dudemanguy/meson that referenced this issue Jan 21, 2022
It used to support:
- a single string
- an array of anything

And as long as CustomTarget supported it too, everything worked fine.
So, a `files('foo')` worked but a `files('foo')[0]` did not, which is
silly... and it's not exactly terrible to use files() here, the input is
literally a list of source files.

Fixes building gnome-terminal
Fixes mesonbuild#9827

Test updated by Nirbheek Chauhan <nirbheek@centricular.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants