stronnag / wayfarer

screen recorder for GNOME / Wayland / pipewire
GNU General Public License v3.0
102 stars 2 forks source link

Build failure: ../src/utils.vala:17.33-17.43: error: Argument 1: Cannot convert from `unowned uint8[]' to `unowned string' #4

Closed maximumsomething closed 1 year ago

maximumsomething commented 1 year ago

Building on Debian. Here's the output of the build commands:

$ meson setup build --buildtype=release --prefix=~/.local
The Meson build system
Version: 1.2.1
Source dir: /home/max/tempmy/wayfarer
Build dir: /home/max/tempmy/wayfarer/build
Build type: native build
Project name: wayfarer
Project version: 1.1.1
C compiler for the host machine: cc (gcc 13.2.0 "cc (Debian 13.2.0-2) 13.2.0")
C linker for the host machine: cc ld.bfd 2.41
Vala compiler for the host machine: valac (valac 0.56.11)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Message: Debian GNU/Linux : Linux-6.4.0-2-amd64-x86_64-with-glibc2.37
Configuring wayfarer-config.h using configuration
Fallback to subproject blueprint-compiler which provides program blueprint-compiler

Executing subproject blueprint-compiler 

blueprint-compiler| Project name: blueprint-compiler
blueprint-compiler| Project version: 0.10.1
blueprint-compiler| Program python3 found: YES (/usr/bin/python3)
blueprint-compiler| Configuring blueprint-compiler.pc using configuration
blueprint-compiler| Configuring blueprint-compiler using configuration
blueprint-compiler| Program blueprint-compiler found: YES (/home/max/tempmy/wayfarer/build/subprojects/blueprint-compiler/blueprint-compiler)
blueprint-compiler| Build targets in project: 1
blueprint-compiler| Subproject blueprint-compiler finished.

Program blueprint-compiler found: YES (overridden)
Found pkg-config: /usr/bin/pkg-config (1.8.1)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Found pkg-config: /usr/bin/pkg-config (1.8.1)
Run-time dependency glib-2.0 found: YES 2.77.2
Run-time dependency gtk4 found: YES 4.10.5
Run-time dependency gio-2.0 found: YES 2.77.2
Run-time dependency gstreamer-1.0 found: YES 1.22.5
Run-time dependency gstreamer-pbutils-1.0 found: YES 1.22.5
Run-time dependency libpulse-mainloop-glib found: YES 16.1
Library posix found: YES
Library m found: YES
Dependency gio-2.0 found: YES 2.77.2 (cached)
Library posix found: YES
Dependency gio-2.0 found: YES 2.77.2 (cached)
Program glib-compile-schemas found: YES (/usr/lib/x86_64-linux-gnu/glib-2.0/glib-compile-schemas)
Program gtk4-update-icon-cache found: YES (/usr/bin/gtk4-update-icon-cache)
Program update-desktop-database found: YES (/usr/bin/update-desktop-database)
Build targets in project: 6

wayfarer 1.1.1

  Subprojects
    blueprint-compiler: YES

  User defined options
    buildtype         : release
    prefix            : ~/.local

Found ninja-1.11.1 at /usr/bin/ninja
$ ninja install -C build
ninja: Entering directory `build'
[6/22] Compiling Vala source ../src/gst-reco...la ../src/encoders.vala ../src/settings.vala
FAILED: wayfarer.p/src/gst-recording.c wayfarer.p/src/recman.c wayfarer.p/src/utils.c wayfarer.p/src/xdg-notify.c wayfarer.p/src/portal.c wayfarer.p/src/wayfarer.c wayfarer.p/src/selection.c wayfarer.p/src/pipeline.c wayfarer.p/src/encoders.c wayfarer.p/src/settings.c 
valac -C --enable-deprecated --vapidir /home/max/tempmy/wayfarer/src/vapi --pkg wayfarer --pkg posix --pkg libpulse-mainloop-glib --pkg gstreamer-pbutils-1.0 --pkg gstreamer-1.0 --pkg gio-2.0 --pkg gtk4 --color=always --directory wayfarer.p --basedir ../ --gresources=../data/wayfarer.gresource.xml ../src/gst-recording.vala ../src/recman.vala ../src/utils.vala ../src/xdg-notify.vala ../src/portal.vala ../src/wayfarer.vala ../src/selection.vala ../src/pipeline.vala ../src/encoders.vala ../src/settings.vala
../src/utils.vala:17.33-17.43: error: Argument 1: Cannot convert from `unowned uint8[]' to `unowned string'
   17 |         provider.load_from_data(CSSSTR.data);
      |                                 ^~~~~~~~~~~  
../src/utils.vala:17.9-17.44: error: 1 missing arguments for `void Gtk.CssProvider.load_from_data (string, ssize_t)'
   17 |         provider.load_from_data(CSSSTR.data);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
../src/selection.vala:332.33-332.40: error: Argument 1: Cannot convert from `unowned uint8[]' to `unowned string'
  332 |         provider.load_from_data(css.data);
      |                                 ^~~~~~~~  
../src/selection.vala:332.9-332.41: error: 1 missing arguments for `void Gtk.CssProvider.load_from_data (string, ssize_t)'
  332 |         provider.load_from_data(css.data);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Compilation failed: 4 error(s), 0 warning(s)
[7/22] Generating data/blueprints with a custom command
warning: Gtk.ComboBoxText is deprecated
at ../data/wayfarer.blp line 88 column 7:
  88 |      Gtk.ComboBoxText media_sel {
     |      ^
hint: Use [class@Gtk.DropDown] with a [class@Gtk.StringList]
  instead

warning: Gtk.ComboBoxText is deprecated
at ../data/wayfarer.blp line 99 column 7:
  99 |      Gtk.ComboBoxText audiosource {
     |      ^
hint: Use [class@Gtk.DropDown] with a [class@Gtk.StringList]
  instead

warning: Gtk.Dialog is deprecated
at ../data/wayfarer.blp line 217 column 1:
 217 |Gtk.Dialog wayfarerprefs {
     |^
hint: Use [class@Gtk.Window] instead

ninja: build stopped: subcommand failed.
stronnag commented 1 year ago

Seems like either the latest valac for a Gtk update. It fails on Arch as well.

stronnag commented 1 year ago

Fix committed (49d86c0) to development. Let's see if it breaks older stuff.

stronnag commented 1 year ago

and of course it does

../src/utils.vala:17.9-17.33: error: `Gtk.CssProvider.load_from_string' is not available in gtk4 4.10.4. Use gtk4 >= 4.12
   17 |         provider.load_from_string(CSSSTR);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~         
../src/selection.vala:332.9-332.33: error: `Gtk.CssProvider.load_from_string' is not available in gtk4 4.10.4. Use gtk4 >= 4.12
  332 |         provider.load_from_string(css);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~      
Compilation failed: 2 error(s), 0 warning(s)

Thank you so much Gtk developers.

maximumsomething commented 1 year ago

I know very nothing about Vala and also don't know if this breaks older versions but provider.load_from_data(CSSSTR, CSSSTR.data.length) seems to do the trick

stronnag commented 1 year ago

The correct fix is already in the development branch (works in 4.10 and 4.12).

stronnag commented 1 year ago

GTK is broken beyond redemption ...

FreeBSD

$ valac --version
Vala 0.56.8

$ pkg-config --modversion gtk4
4.10.4

public void load_from_data ([CCode (array_length_cname = "length", array_length_pos = 1.1,
 array_length_type = "gssize")] uint8[] data);

Debian Testing

$ valac --version
Vala 0.56.11

$ pkg-config --modversion gtk4
4.10.5

[Version (since = "4.12")]
public void load_from_bytes (GLib.Bytes data);
[Version (deprecated = true, deprecated_since = "4.12")]
public void load_from_data (string data, ssize_t length);
...
[Version (since = "4.12")]
public void load_from_string (string str);

Arch Riscv64

$ valac --version
Vala 0.56.11

$ pkg-config --modversion gtk4
4.10.4

[Version (since = "4.12")]
public void load_from_bytes (GLib.Bytes data);
[Version (deprecated = true, deprecated_since = "4.12")]
public void load_from_data (string data, ssize_t length);
[Version (since = "4.12")]
public void load_from_string (string str);

Arch x86_64

$ valac --version
Vala 0.56.12

$ pkg-config --modversion gtk4
4.12.0

[Version (since = "4.12")]
public void load_from_bytes (GLib.Bytes data);
[Version (deprecated = true, deprecated_since = "4.12")]
public void load_from_data (string data, ssize_t length);
[Version (since = "4.12")]
public void load_from_string (string str);

Alpine

$ valac --version
Vala 0.56.7

$ pkg-config --modversion gtk4
4.10.4

public void load_from_data ([CCode (array_length_cname = "length",
 array_length_pos = 1.1, array_length_type = "gssize")] uint8[] data);

Ubuntu 23.04

$ valac --version
Vala 0.56.7

$ pkg-config --modversion gtk4
4.10.4

public void load_from_data ([CCode (array_length_cname = "length", array_length_pos = 1.1,
  array_length_type = "gssize")] uint8[] data);
stronnag commented 1 year ago

fixed by https://github.com/stronnag/wayfarer/commit/b31dced00aeb644e297fbe9a1bd1ef06745cf204 for all three variants of the GTK API.