Bug 52516 - Error building gnome-sharp-2.24.2 with gtk-sharp-2.12.42
Summary: Error building gnome-sharp-2.24.2 with gtk-sharp-2.12.42
Status: RESOLVED FIXED
Alias: None
Product: Gtk#
Classification: Mono
Component: gnome-sharp ()
Version: 2.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marius Ungureanu
URL:
: 52592 ()
Depends on:
Blocks:
 
Reported: 2017-02-14 23:59 UTC by André
Modified: 2017-04-17 08:31 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
All gnome generated files [gnome-sharp-2.24.2/gnome/generated] (38.73 KB, application/x-bzip2)
2017-02-21 11:13 UTC, André
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description André 2017-02-14 23:59:12 UTC
Env:
Linux 4.4.38 x86_64
gcc-5.3.0
gcc-g++-5.3.0

libgdiplus-4.2
libbonobo-2.32.1
libbonoboui-2.24.5
libgnome-2.32.1
libgnome-keyring-3.12.0
libgnomecanvas-2.30.3
libgnomeui-2.24.5
ORBit2-2.14.19

gtk+-1.2.10
gtk+2-2.24.31
gtk+3-3.18.9
gtkmm2-2.24.4
gtkmm3-3.18.1

gnome-vfs-2.24.4
gnome-keyring-3.16.0
gnome-mime-data-2.18.0
gnome-themes-standard
gnome-vfs-2.24.4
polkit-gnome-0.105

nuget-2.8.6
gtk-sharp-2.12.42
mono-addins-1.1
referenceassemblies-pcl-20140414
fsharp-4.0.1.20
mono-4.6.2.16

I'm trying to build gnome-sharp 2.24.2, but I getting this error message:

(...)

Defaulting MenuPositionFunc param to 'call' scope in method Popup.MenuDoPopup
Defaulting MenuPositionFunc param to 'call' scope in method Popup.MenuDoPopupModal

Generation Summary:
  Enums: 23  Structs: 7  Boxed: 0  Opaques: 9  Interfaces: 0  Objects: 39  Callbacks: 10
  Properties: 210  Signals: 46  Methods: 447  Constructors: 27  Throttled: 19
Total Nodes: 837

cp ../gtk-sharp.snk .
cp ../AssemblyInfo.cs .
/usr/bin/mcs -define:GTK_SHARP_2_6 -define:GTK_SHARP_2_8 -define:GNOME_SHARP_2_16 -define:GNOME_SHARP_2_20 -define:GNOME_SHARP_2_24 -nowarn:0169,0612,0618 -unsafe -out:gnome-sharp.dll -target:library -r:/usr/lib64/pkgconfig/../../lib/mono/gtk-sharp-2.0/pango-sharp.dll -r:/usr/lib64/pkgconfig/../../lib/mono/gtk-sharp-2.0/atk-sharp.dll -r:/usr/lib64/pkgconfig/../../lib/mono/gtk-sharp-2.0/gdk-sharp.dll -r:/usr/lib64/pkgconfig/../../lib/mono/gtk-sharp-2.0/gtk-sharp.dll -r:/usr/lib64/pkgconfig/../../lib/mono/gtk-sharp-2.0/glib-sharp.dll  /r:../art/art-sharp.dll  /r:../gnomevfs/gnome-vfs-sharp.dll -r:Mono.Cairo generated/*.cs  ./BonoboUIVerb.cs  ./IconTheme.cs  ./Modules.cs AssemblyInfo.cs
AssemblyInfo.cs(6,11): warning CS1699: Use compiler option `keyfile' or appropriate project settings instead of `AssemblyKeyFile' attribute
generated/App.cs(125,17): warning CS0108: `Gnome.App.Name' hides inherited member `Gtk.Widget.Name'. Use the new keyword if hiding was intended
/usr/lib64/pkgconfig/../../lib/mono/gtk-sharp-2.0/gtk-sharp.dll (Location of the symbol related to previous warning)
generated/ThemeFile.cs(59,26): warning CS0809: Obsolete member `Gnome.ThemeFile.ToString()' overrides non-obsolete member `object.ToString()'
/usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous warning)
generated/CanvasPathDef.custom(25,67): error CS1502: The best overloaded method match for `Gnome.CanvasPathDef.gnome_canvas_path_def_new_from_bpath(ref Art.Bpath)' has some invalid arguments
generated/CanvasPathDef.cs(260,24): (Location of the symbol related to previous error)
generated/CanvasPathDef.custom(25,105): error CS1620: Argument `#1' is missing `ref' modifier
Compilation failed: 2 error(s), 3 warnings
Makefile:685: recipe for target 'gnome-sharp.dll' failed
make[3]: *** [gnome-sharp.dll] Error 1
make[3]: Leaving directory '/tmp/SBo/gnome-sharp-2.24.2/gnome'
Makefile:379: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/tmp/SBo/gnome-sharp-2.24.2/gnome'
Makefile:315: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/SBo/gnome-sharp-2.24.2'
Makefile:241: recipe for target 'all' failed
make: *** [all] Error 2
Comment 1 Matt Ward 2017-02-17 09:26:28 UTC
*** Bug 52592 has been marked as a duplicate of this bug. ***
Comment 2 Matt Ward 2017-02-17 09:28:14 UTC
Copying in Jo on this gnome-sharp build error.
Comment 3 Jo Shields 2017-02-21 08:14:26 UTC
Can you attach your ./gnome/generated/CanvasPathDef.cs ?
Comment 4 André 2017-02-21 11:13:40 UTC
Created attachment 19892 [details]
All gnome generated files [gnome-sharp-2.24.2/gnome/generated]
Comment 5 Jo Shields 2017-02-21 11:34:54 UTC
OK, this is related to https://github.com/mono/gtk-sharp/commit/449d4e29a689a53a93927a5b72ec7f3586434480 which seems to have broken the API for gapi-codegen consumers.

I'll add Marius to the bug to see what he suggests.
Comment 6 Marius Ungureanu 2017-02-21 12:06:25 UTC
Urgh, I didn't expect to end up with breaking changes in virtual methods for the ref changes. There is no way to revert those changes without impacting performance yet again.

Is it possible to have conditional compilation enabled or an update done to gnome-sharp to have this fixed and in-sync?
Comment 7 Marius Ungureanu 2017-02-21 12:08:08 UTC
I haven't touched gnome-sharp or any other repositories other than gtk-sharp, since I do not know which have dependencies on it.
Comment 8 Alexandros Couloumbis 2017-03-10 09:02:50 UTC
I was bitten by this too. 

with gtk-sharp-2.12.41, gnome-sharp-2.24.2 compiles just fine.
Comment 9 Que Quotion 2017-04-02 08:17:02 UTC
I knew it couldn't be this easy, but I tried adding the "ref" modifier the second part of the error message asks for:

--- gnome/CanvasPathDef.custom
+++ gnome/CanvasPathDef.custom
@@ -22,7 +22,7 @@
 		public static CanvasPathDef NewFromBpath (Art.Bpath bpath)
 		{
                         IntPtr native_bpath = GLib.Marshaller.StructureToPtrAlloc (bpath);
-                        CanvasPathDef result = new CanvasPathDef (gnome_canvas_path_def_new_from_bpath (native_bpath));
+                        CanvasPathDef result = new CanvasPathDef (gnome_canvas_path_def_new_from_bpath (ref native_bpath));
 			GLib.Marshaller.Free (native_bpath);
 			return result;
 		}

This resulted in a different error at the same place:

generated/CanvasPathDef.custom(25,67): error CS1502: The best overloaded method match for `Gnome.CanvasPathDef.gnome_canvas_path_def_new_from_bpath(ref Art.Bpath)' has some invalid arguments
generated/CanvasPathDef.cs(260,24): (Location of the symbol related to previous error)
generated/CanvasPathDef.custom(25,109): error CS1503: Argument `#1' cannot convert `ref System.IntPtr' expression to type `ref Art.Bpath'

Obviously that won't do it, but I still wonder if it's possible to fix this with a few changes in gnome-sharp.
Comment 10 Marius Ungureanu 2017-04-03 09:06:50 UTC
Yea, you need to pass ref bpath and remove the native_bpath alltogether.
Comment 11 Marius Ungureanu 2017-04-03 11:24:56 UTC
The fix is now in master.
Comment 12 Mirco Bauer 2017-04-17 08:31:47 UTC
For the record, the fix is:
https://github.com/mono/gnome-sharp/commit/d797ce61a18f8238acd2f9a7bf97b157ae70b443