Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

build error: overriding method LineContainer.get_adjustments' is incompatible with base method Mx.Scrollable.get_adjustments' #198

Closed
jokeyrhyme opened this issue Sep 21, 2013 · 9 comments

Comments

@jokeyrhyme
Copy link

Hi.

I'm attempting to build mx and finalterm for ArchLinux using the AUR packages:
https://aur.archlinux.org/packages/mx-git/
https://aur.archlinux.org/packages/finalterm-git/

mx builds fine. However, I get an error building Final Term. I've logged the builds of both here: https://gist.github.com/jokeyrhyme/6646520

For convenience, the specific error is:

/var/abs/local/finalterm-git/src/finalterm/src/TerminalView.vala:561.2-561.28: error: overriding method `LineContainer.get_adjustments' is incompatible with base method `Mx.Scrollable.get_adjustments': incompatible type of parameter 1.
    public void get_adjustments(out unowned Mx.Adjustment? hadjustment, out unowned Mx.Adjustment? vadjustment) {
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Examining the source for both mx and FinalTerm, it looks like the get_adjustments method is supposed to have 3 arguments, but when FinalTerm overrides it, it only declares 2 of them.
https://github.com/p-e-w/finalterm/blob/master/src/TerminalView.vala#L561
https://github.com/clutter-project/mx/blob/master/mx/mx-scrollable.h#L61

I don't know enough about Vala to go about fixing this myself. If there's anything further I can do to help resolve this, please don't hesitate to ask. Cheers!

@p-e-w
Copy link
Owner

p-e-w commented Sep 21, 2013

Thank you for the bug report.

The first of the 3 arguments in https://github.com/clutter-project/mx/blob/master/mx/mx-scrollable.h#L61 is actually "this", so in vala that would transform into 2 arguments (because vala uses the syntax this.method(arguments ...)).

In the .vapi file on my machine (for Mx 1.4) the method signature looks as it does in TerminalView.vala, but sure enough, in the current valadoc it doesn't (unowned has been removed).

This is an ugly problem, because if I change the signature the same error will show up on my and many other systems instead. I see only two ways to solve this problem:

  • Use conditional compilation for that line
  • Ship our own .vapi file for Mx

@jokeyrhyme
Copy link
Author

Should I try this again with Mx 1.4?

@p-e-w
Copy link
Owner

p-e-w commented Sep 21, 2013

Yes, please!

@jokeyrhyme
Copy link
Author

Urgh, I'm getting weird compile errors related to my headers for glib-2.0. I'm not sure Mx 1.4 is compatible with my system.

/usr/include/glib-2.0/glib/gmem.h:136:16: error: expected expression before ')' token
  (struct_type *) (G_GNUC_EXTENSION ({   \
../mx/mx-deform-texture.c: In function 'mx_deform_texture_init_arrays':
../mx/mx-deform-texture.c:496:3: error: unknown type name 'GLushort'
   GLushort *idx, *bf_idx;
   ^
../mx/mx-deform-texture.c:498:3: error: unknown type name 'GLushort'
   GLushort *static_indices, *static_bf_indices;

I don't know what's different going from Mx 1.4 to 2.0, but I think it might be better for me to wait until the ArchLinux maintainer for this gets a look.

Is it infeasible to support both versions of Mx? Is moving to Mx 2.0 (when it is stable) on the roadmap?

@p-e-w
Copy link
Owner

p-e-w commented Sep 21, 2013

https://github.com/clutter-project/mx/releases currently lists 1.4.7 as the latest release. I assume 2.0 will come out of the current unstable master?

As far as that goes, yes, I plan to move to the Mx master as soon as it becomes a release, because clutter-project/mx#88 will allow for a drastic simplification of TerminalView.vala.

@Lenneth006
Copy link

I add mx stable version in archlinux aur so we can use finalterm again!

@jokeyrhyme
Copy link
Author

@GGRn2 's AUR package for MX 1.4 is here: https://aur.archlinux.org/packages/mx/
It builds and installs fine for me. Yay!

The FinalTerm AUR package is here: https://aur.archlinux.org/packages/finalterm-git/
There was a sed line in the PKGBUILD file replacing references to mx-1.0 with mx-2.0, which I deleted. This now builds and install fine too. FinalTerm now launches and seems to be working.

Thanks! I'll close this now.

@Lenneth006
Copy link

Yep, i just add it :). Still wait for the finalterm maintainer to update finalterm Aur package for automatic build.

@kolewu
Copy link

kolewu commented Oct 10, 2013

One can also fix the signature with the following patch and use MX-2.0:

diff --git a/src/TerminalView.vala b/src/TerminalView.vala
index 0bfa3eb..c8002a7 100644
--- a/src/TerminalView.vala
+++ b/src/TerminalView.vala
@@ -572,7 +572,7 @@ public class LineContainer : Clutter.Actor, Mx.Scrollable {

        public Mx.Adjustment vertical_adjustment { owned get; set; default = new Mx.Adjustment(); }

-       public void get_adjustments(out unowned Mx.Adjustment? hadjustment, out unowned Mx.Adjustment? vadjustment) {
+       public void get_adjustments(out unowned Mx.Adjustment hadjustment, out unowned Mx.Adjustment vadjustment) {
                // TODO: This works, and takes care of all the owned/unowned difficulties,
                //       but is a hack nonetheless (Vala seems to implicitly create these variables)
                hadjustment = _horizontal_adjustment;

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

No branches or pull requests

4 participants