aBothe / Mono-D

D Add-In for MonoDevelop
http://wiki.dlang.org/Mono-D
Other
113 stars 26 forks source link

0.5.2 broke my project #251

Closed simendsjo closed 11 years ago

simendsjo commented 11 years ago

I get this when opening the project.

The file <filename here> could not be opened. Exception has been thrown by the target of an invocation.

Trying to open one of the files gives this:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'Mono.TextEditor.Highlighting.ResourceStreamProvider' from assembly 'Mono.TextEditor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0 
  at Mono.Addins.TypeExtensionNode.CreateInstance () [0x00000] in <filename unknown>:0 
  at MonoDevelop.SourceEditor.SyntaxModeCodon.get_SyntaxMode () [0x00000] in <filename unknown>:0 
  at MonoDevelop.SourceEditor.SyntaxModeService+<SyntaxModeService>c__AnonStorey17.<>m__62 (Mono.TextEditor.TextDocument d) [0x00000] in <filename unknown>:0 
  at Mono.TextEditor.Highlighting.SyntaxModeProvider.Create (Mono.TextEditor.TextDocument doc) [0x00000] in <filename unknown>:0 
  at Mono.TextEditor.Highlighting.SyntaxModeService.GetSyntaxMode (Mono.TextEditor.TextDocument doc, System.String mimeType) [0x00000] in <filename unknown>:0 
  at MonoDevelop.SourceEditor.SourceEditorView.UpdateMimeType (System.String fileName) [0x00000] in <filename unknown>:0 
  at MonoDevelop.SourceEditor.SourceEditorView.Load (System.String fileName, System.Text.Encoding loadEncoding) [0x00000] in <filename unknown>:0 
  at MonoDevelop.SourceEditor.SourceEditorView.Load (System.String fileName) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.LoadFileWrapper.Invoke (System.String fileName) [0x00000] in <filename unknown>:0 
simendsjo commented 11 years ago

I see you updated to xs-4.0.2 which might have been the problem. Unfortunately, this doesn't exist in my package manager yet, and building from source requires me to first build mono 2.10.9 from source (doesn't exist in the manager either) as 2.10.8 is unable to build monodevelop (bug in mono).

You can probably close this while I eagerly await updated packages.

simendsjo commented 11 years ago

Ok, I finally got it working, but it won't run with mono-2.10.8..

What I did: 1) Compiled the mono-2-10 branch (2.10.12), but removed all .tree generation from the makefiles. 2) Copied all missing libraries from 2.10.8 gac to 2.10.12 gac. 3) Compiled MD using 2.10.12 4) Run MD using 2.10.12

aBothe commented 11 years ago

Hmm. Though these instructions may be correct and working, I doubt that everyone wants to clone & do all the stuff manually :-/ - I'll put in a link to this issue on the blog.

simendsjo commented 11 years ago

I've uploaded a full installation here: http://dl.dropbox.com/u/36543537/xs-4.0.2-full.tar.gz This is obviously a very ugly works-for-me hack, but if it works on other systems too, it might be suitable until package repositories get the new mono+monodevelop versions.

aBothe commented 11 years ago

Okay thx for the dropbox link, so one at least doesn't have to compile MD and struggle with xbuild anymore. Do you think it's worth to pack mono, too? I dunno, perhaps for x86, then for x64 systems, so you'll just end up with having one directory for mono and one for monodevelop -- I'm just thinking of make install, just not into /usr/local but perhaps /home/myCustomDirectory or so..

aBothe commented 11 years ago

http://inorton.wordpress.com/2013/03/13/mono-3-0-6-gtk3-and-monodevelop-4-0/ straight from G+

https://github.com/jvlppm/build_monodevelop -- Useful MonoDevelop installation scripts for Ubuntu. Gonna test them this afternoon.

trikko commented 11 years ago

why not /opt/mycustom as used by other apps like chrome & c.

aBothe commented 11 years ago

yeah sure, it was just an example..

simendsjo commented 11 years ago

Mono is included in the package as monodevelop throws if started with mono 2.10.8.

simendsjo commented 11 years ago

Ok, I've uploaded the full package to my server - a lot faster than dropbox, and no download-limit (as long as it's less than 2TB/month). It installs to /opt/xs-4.0.2-mono-d

$ wget http://simendsjo.me/files/xs-4.0.2-mono-d.tar.gz
$ tar -xPf xs-4.0.2-mono-d.tar.gz
$ /opt/xs-4.0.2-mono-d/monodevelop
aBothe commented 11 years ago

Awesome, thanks.

simendsjo commented 11 years ago

Let's hope it works on other setups than mine.. Could you test it before publishing info on it?

aBothe commented 11 years ago

Sure, but just in a couple of hours, not now.

trikko commented 11 years ago

Doesn't work for me. Mute output from console and no app is loaded. :) Ubuntu 12.10. 64bit Why don't you try to publish it using a ppa? http://askubuntu.com/questions/71510/how-do-i-create-a-ppa

simendsjo commented 11 years ago

Try running without redirecting output to log:

$ /opt/xs-4.0.2-mono-d/mono-2.10.12/bin/mono /opt/xs-4.0.2-mono-d/xs-4.0.2/lib/monodevelop/bin/MonoDevelop.exe --no-redirect
trikko commented 11 years ago

FATAL ERROR [2013-03-20 15:01:48Z]: MonoDevelop failed to start. Some of the assemblies required to run MonoDevelop (for example gtk-sharp)may not be properly installed in the GAC. System.DllNotFoundException: glibsharpglue-2 at (wrapper managed-to-native) GLib.Marshaller:glibsharp_strlen (intptr) at GLib.Marshaller.Utf8PtrToString (IntPtr ptr) [0x00000] in :0 at GLib.Marshaller.PtrToStringGFree (IntPtr ptr) [0x00000] in :0 at Gtk.Rc.get_ModuleDir () [0x00000] in :0 at MonoDevelop.Ide.IdeStartup.SetupTheme () [0x00000] in :0 at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) [0x00000] in :0 at MonoDevelop.Ide.IdeStartup.Main (System.String[] args) [0x00000] in :0

simendsjo commented 11 years ago

Seems you are missing gtk-sharp-2: http://packages.ubuntu.com/lucid/libs/gtk-sharp2

Edit: This is what my package manager says:

/usr/lib/libglibsharpglue-2.so is owned by gtk-sharp-2 2.12.11-1
trikko commented 11 years ago

I have gtk-sharp2 (not -2) installed. Notice: XamarinStudio works, and MonoDevelop.exe inside your folder work too if launched directly (but with my mono version: it gives the error we know).

simendsjo commented 11 years ago

I'm not following.. XamarinStudio works - do you mean 4.0.1 that's packaged with ubuntu? MonoDevelop.exe form this pack works: Launched directly as in with your installed mono? mono --version says? my mono version: The one I packaged?

This package doesn't work with mono 2.10.8. It only works with the one I packaged (at least for me)

trikko commented 11 years ago

About XamarinStudio: I mean 4.0 build 2003 (built by Alexander). I guess it needs that library too, doesn't it?

About MonoDevelop.exe: mono --version says Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-5ubuntu1) if i start: /opt/xs-4.0.2-mono-d/xs-4.0.2/lib/monodevelop/bin/MonoDevelop.exe It works, I can install mono-d plugin from repository but it gives errors when I try to open a D file

aBothe commented 11 years ago

The 'old' version 4.0 indeed needs everything related to Mono 2.10.8 only.

I'll drive home now and test the new zip then.

simendsjo commented 11 years ago

All of those options are expected. You have to run the mono packaged in xs-4.0.2-mono-d. If you just run MonoDevelop.exe, your system mono will launch it. This doesn't work for me either. Try running

/opt/xs-4.0.2-mono-d/monodevelop

This should launch the correct mono. Or the command I specified earlier which doesn't redirect monodevelops output (note the first part which uses the correct mono):

/opt/xs-4.0.2-mono-d/mono-2.10.12/bin/mono /opt/xs-4.0.2-mono-d/xs-4.0.2/lib/monodevelop/bin/MonoDevelop.exe --no-redirect
trikko commented 11 years ago

No way. I'm missing something!

$ /opt/xs-4.0.2-mono-d/mono-2.10.12/bin/mono /opt/xs-4.0.2-mono-d/xs-4.0.2/lib/monodevelop/bin/MonoDevelop.exe --no-redirect FATAL ERROR [2013-03-20 15:51:14Z]: MonoDevelop failed to start. Some of the assemblies required to run MonoDevelop (for example gtk-sharp)may not be properly installed in the GAC. System.DllNotFoundException: glibsharpglue-2 at (wrapper managed-to-native) GLib.Marshaller:glibsharp_strlen (intptr) at GLib.Marshaller.Utf8PtrToString (IntPtr ptr) [0x00000] in :0 at GLib.Marshaller.PtrToStringGFree (IntPtr ptr) [0x00000] in :0 at Gtk.Rc.get_ModuleDir () [0x00000] in :0 at MonoDevelop.Ide.IdeStartup.SetupTheme () [0x00000] in :0 at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) [0x00000] in :0 at MonoDevelop.Ide.IdeStartup.Main (System.String[] args) [0x00000] in :0

simendsjo commented 11 years ago

It's probably something wrong with my package as it's a big hack. You have libglibsharpglue-2 installed?

$ locate libglibsharpglue-2
/usr/lib/libglibsharpglue-2.so

To avoid having to build every single required library, I copied dll's from my 2.10.8 gac to this package.. Try replacing my packaged gtk-sharp with the ones from your 2.10.8 install

/opt/xs-4.0.2-mono-d/mono-2.10.12/lib/mono/gac/gtk-sharp/
and
/opt/xs-4.0.2-mono-d/mono-2.10.12/lib/mono/gtk-sharp-2.0
aBothe commented 11 years ago

Meh. I've got x86..and you..'ve got a x64 OS.. can't execute the mono version you put in.

simendsjo commented 11 years ago

Anyone still using x86..? :) I'll guess I'll have to recompile two versions.

simendsjo commented 11 years ago

Hmm.. I didn't find a way to trigger crosscompiling without hacking it in (adding TARGET manually after it's been set by checking the host system). I get many errors though:

exceptions-x86.c: In function ‘mono_arch_monoctx_to_sigctx’:
exceptions-x86.c:962:25: error: lvalue required as left operand of assignment
exceptions-x86.c:963:25: error: lvalue required as left operand of assignment
( etc etc etc )

It would probably be easier to just compile on a x86 system.

As this has been pretty much experimentation, I don't have any automation, but here are my notes:

$ cat mono-install.sh 
# MONO
# ----
# TODO: Fetch
#       Select branch
#       Configure
#       Apply no-doc patch
#       Make
#       Make install
# Add missing assamblies
cp -rn /usr/lib/mono/* /opt/xs-4.0.2-mono-d/mono-2.10.12/lib/mono/

# MONODEVELOP
# -----------
# TODO: Fetch
#       Select branch
#       Apply custom-mono patch
#       Configure
#       Make
#       Make install

# PUBLISH
# -------
tar -czPf /opt/xs-4.0.2-mono-d /tmp/xs-4.0.2-mono-d.tar.gz
# Upload to server
scp /tmp/xs-4.0.2-mono-d.tar.gz simendsjo@simendsjo.me:/opt/public_www_files

The following might also be disabled by uncommenting $(ASSEMBLED_DOCS) in this file or perhaps docs/Makefile in configure.in:

$ cat mono_no-docs.patch
diff --git a/mcs/docs/Makefile b/mcs/docs/Makefile
index 0c808b3..3a71e3d 100644
--- a/mcs/docs/Makefile
+++ b/mcs/docs/Makefile
@@ -20,11 +20,11 @@ DOC_SOURCE_FILES = \
    Novell.source

 ASSEMBLED_DOCS = \
-   cs-errors.tree cs-errors.zip      \
-   ecma334.tree ecma334.zip          \
-   Mono.tree Mono.zip                \
-   netdocs.tree netdocs.zip          \
-   Novell.tree Novell.zip            
+   #cs-errors.tree cs-errors.zip      \
+   #ecma334.tree ecma334.zip          \
+   #Mono.tree Mono.zip                \
+   #netdocs.tree netdocs.zip          \
+   #Novell.tree Novell.zip            

 MONODOC_SOURCES_INSTALL_FILES = \
    $(ASSEMBLED_DOCS)             \

The main thing in monodevelop in using our custom built mono as both the different compilers in use and for GAC. Note that this patch also fixes xbuild.input to set the full path of our new xbuild explicitly.

$ cat monodevelop_custom-mono.patch 
diff --git a/main/configure.in b/main/configure.in
index 242e562..d41f99a 100644
--- a/main/configure.in
+++ b/main/configure.in
@@ -14,8 +14,11 @@ ASSEMBLY_VERSION=4.0.0.0
 # 2) "VERSION_NUMBER BUILD_TYPE BUILD_NUMBER"      "2.0 Alpha 1"
 PACKAGE_VERSION_LABEL="4.0.2"

-AC_PATH_PROG(MONO, mono)
-AC_PATH_PROG(MCS, gmcs)
+#AC_PATH_PROG(MONO, mono)
+#AC_PATH_PROG(MCS, gmcs)
+MONO_PATH=/opt/xs-4.0.2-mono-d/mono-2.10.12
+AC_SUBST(MONO, $MONO_PATH/bin/mono)
+AC_SUBST(MCS, $MONO_PATH/bin/gmcs)

 if test "x$MONO" = "x" ; then
    AC_MSG_ERROR([Can't find "mono" in your PATH])
@@ -30,7 +33,8 @@ AC_SUBST(PATH)
 AC_SUBST(PKG_CONFIG_PATH)
 AC_SUBST(LD_LIBRARY_PATH)
 AC_SUBST(DYLD_FALLBACK_LIBRARY_PATH)
-AC_SUBST(MONO_GAC_PREFIX)
+#AC_SUBST(MONO_GAC_PREFIX)
+AC_SUBST(MONO_GAC_PREFIX, $MONO_PATH/lib/mono/gac)

 default_gnomeplatform=no
 default_windowsplatform=no
@@ -102,8 +106,10 @@ if test "x$has_mono" = "xtrue"; then
    LIB_PREFIX=
    LIB_SUFFIX=.dylib
     else
-   AC_PATH_PROG(RUNTIME, mono, no)
-   AC_PATH_PROG(CSC, dmcs, no)
+   #AC_PATH_PROG(RUNTIME, mono, no)
+   #AC_PATH_PROG(CSC, dmcs, no)
+    AC_SUBST(RUNTIME, $MONO_PATH/bin/mono)
+    AC_SUBST(CSC, $MONO_PATH/bin/dmcs)
    LIB_PREFIX=.so
    LIB_SUFFIX=
     fi
diff --git a/main/xbuild.include b/main/xbuild.include
index 49e1b36..7e5d987 100644
--- a/main/xbuild.include
+++ b/main/xbuild.include
@@ -13,7 +13,7 @@ if ENABLE_WINDOWSPLATFORM
 PROFILE_NAME=DebugWin32
 endif

-XBUILD=xbuild
+XBUILD=/opt/xs-4.0.2-mono-d/mono-2.10.12/bin/xbuild
 XBUILD_VERBOSITY=quiet
 XBUILD_ARGS=/verbosity:$(XBUILD_VERBOSITY) /nologo /property:CodePage=65001
 XBUILD_PROFILE=/property:Configuration=$(PROFILE_NAME)
aBothe commented 11 years ago

Will do this stuff on an other day. I think I got my linux messed up because it's just permanently having >5% cpu load which lets the shit become&stay hot...meh..

aBothe commented 11 years ago

God damn it there's already an upstream for Mono 2.11 on launchpad.. https://launchpad.net/~keks9n/+archive/mono-upstream Dunno what I should do without this guy..

aBothe commented 11 years ago

Okay. When trying to build XS (stable) with that version, there are unresolved glade-sharp/gnome-something libraries. Meh.

simendsjo commented 11 years ago

I say we wait for package managers to "catch up". This probably won't happen until mono states another release is stable (strangely, they have an 2.10.11 tag. Should think they only tagged stable releases). The last one was 2.10.9, which was a "mac only release" (yeah right..).

aBothe commented 11 years ago

One successful installation just happened on Fedora - the guy still had to copy the libMonoPosixHelper.so from /usr/local/lib to /usr/lib or so.. he says he loves XS now. But we still need the entire thingy for x86 environments.. well, let's see

DEscalierX commented 11 years ago

hi.. i'm using Arch Linux x86 environment, i'm looking for XS x86... it's still not available?

aBothe commented 11 years ago

It's 'just' required to build at least one mono 2.10.11 (or similar) version on linux x86... @DEscalierX, I unfortunately recently gave up with building it..was too awkward and time-consuming for me

aBothe commented 11 years ago

@DEscalierX Despite it's now a couple of weeks ago.. yes, there finally is a release! http://simendsjo.me/files/abothe/