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

install.cobra fails to compile CobraBinding on Mac #9

Closed
ramon-rocha opened this issue Sep 24, 2012 · 12 comments
Closed

install.cobra fails to compile CobraBinding on Mac #9

ramon-rocha opened this issue Sep 24, 2012 · 12 comments
Labels

Comments

@ramon-rocha
Copy link
Owner

Failed!
$ /Library/Frameworks/Mono.framework/Commands/pkg-config --libs monodevelop
| Package monodevelop was not found in the pkg-config search path.
| Perhaps you should add the directory containing `monodevelop.pc'
| to the PKG_CONFIG_PATH environment variable
| No package 'monodevelop' found
Compilation failed - 1 error, 0 warnings

No clue on this one. I have no Mac to test on.

@ramon-rocha
Copy link
Owner Author

@ramon-rocha
Copy link
Owner Author

Something else: http://vivin.net/2011/01/24/mono-on-ubuntu-package-dotnet35-was-not-found-in-the-pkg-config-search-path/

Will need a Mac guinea pig for this issue I think...

@sergi
Copy link

sergi commented Oct 11, 2012

Getting the same exact error :(

@ramon-rocha
Copy link
Owner Author

I might be able to workaround this issue by using explicit paths for those references. I need to know the full path to the following files on a Mac:

MonoDevelop.Core.dll
MonoDevelop.Ide.dll
gtk-sharp.dll
glib-sharp.dll
atk-sharp.dll

It's probably not the "right" way to fix it but it might work.

@charles-esterbrook
Copy link
Contributor

This gets past the package issue:

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/Applications/MonoDevelop.app/Contents/MacOS/lib/pkgconfig

install.cobra could do something like:

path = '/Applications/MonoDevelop.app/Contents/MacOS/lib/pkgconfig'
if File.exists(path)
# add the path the environment

But then I get an error past that point...

@charles-esterbrook
Copy link
Contributor

The next error is:

error: Cannot load reference "/Applications/MonoDevelop.app/Contents/MacOS/lib/pkgconfig/../../lib/monodevelop/bin/MonoDevelop.Ide.dll" due to: Could not load file or assembly 'ICSharpCode.NRefactory, Version=0.0.0.0, Culture=neutral, PublicKeyToken=efe927acf176eea2' or one of its dependencies. The system cannot find the file specified.

I tried this, but not help:

export MONO_PATH=$MONO_PATH:/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin

I'll try enhancing install.cobra to work that path into a -lib: for Cobra.

@charles-esterbrook
Copy link
Contributor

I got the -lib in there for Cobra and it still bombs:

Running xbuild...
  args: Gui.csproj /p:Configuration=Debug
Running /Users/chuck/bin/cobra...
  args: -compile -copy-core -target:lib -out:"bin/Debug/MonoDevelop.CobraBinding.dll" -lib:/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/bin -ref:System.Core -ref:Cobra.Compiler -ref:../Gui/bin/Debug/MonoDevelop.CobraBinding.Gui.dll -pkg:monodevelop -pkg:gtk-sharp-2.0 -sharp-args:"-res:\"CobraBinding.addin.xml\" -res:\"CobraSyntaxMode.xml\" -res:\"templates/ConsoleProject.xpt.xml\" -res:\"templates/EmptyCobraFile.xft.xml\" -res:\"templates/EmptyProject.xpt.xml\" -res:\"templates/GtkSharp2Project.xpt.xml\" -res:\"templates/LibraryProject.xpt.xml\"" AssemblyInfo.cs CobraLanguageBinding.cobra Project/CobraCompilerParameters.cobra Project/CompilerBuildOptionsPanel.cobra TypeSystem/Parser.cobra TypeSystem/LineInformation.cobra 
Failed!
Compilation failed - 1 error, 0 warnings
Shutting down finalizer thread timed out.
* Assertion at critical-sections.c:95, condition `ret == 0' not met


error: Cannot load reference "/Applications/MonoDevelop.app/Contents/MacOS/lib/pkgconfig/../../lib/monodevelop/bin/MonoDevelop.Ide.dll" due to: Could not load file or assembly 'ICSharpCode.NRefactory, Version=0.0.0.0, Culture=neutral, PublicKeyToken=efe927acf176eea2' or one of its dependencies. The system cannot find the file specified.

Starting to run out of ideas... I don't see anything suspicious about ICSharpCode.NRefactory.dll. The file is there and using dump-assembly.cobra, its references look reasonable:

Referenced Assemblies
---------------------
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756

Any ideas?

@ramon-rocha
Copy link
Owner Author

Thanks for spending some time on this, Charles.

I get this same error on Ubuntu since Cobra switched to "reflection only" loading on Mono with CLR 4. See our email discussion titled: "shared class".

In that email, you suggested I try

export MONO_PATH=/usr/lib/monodevelop/bin

and that worked. Seemingly the same solution does not work on Mac.

You had a couple other suggestions for me to try including adding those assemblies to the GAC or copying them to the current directory. Did you already try those?

@charles-esterbrook
Copy link
Contributor

I've tried both and no luck. I've been pounding on this all night. Was just about to give up, but then decided to double check the MONO_PATH treatment. My code inside install.cobra that set MONO_PATH was not getting called due to a mistake I made in reading the code. I fixed and now the add-in gets installed! Yay!

Wow, my install.cobra has been brutalized. :-) I'll have to work through it tomorrow/Sunday to eliminate junk.

Btw in MonoDevelop I get this error when trying to build a fresh Cobra console project:

Could not find cobra.exe. Try adding its location to your PATH environment variable.

But at the command line I can enter "cobra" and also "cobra -path". Let me know if you want me to fill out a separate issue.

@ramon-rocha
Copy link
Owner Author

Woohoo! I'm looking forward to closing this bug!

As for the cobra.exe issue, it might be a regression introduced with the fix for bug #12 or maybe it never worked on Mac to begin with. Here's the relevant commit: e61223a

That error message implies that CobraCore.findCobraExe is returning nil or a zero-length string. Is that expected on your system since it's a dev machine? Can you re-open issue #12 or open a new one to keep this one about compiling the addin itself? Thanks.

@charles-esterbrook
Copy link
Contributor

I've cleaned up install.cobra and sent you the patch.

@ramon-rocha
Copy link
Owner Author

Thanks, I will apply it soon.

ramon-rocha added a commit that referenced this issue Dec 3, 2012
Sets PKG_CONFIG_PATH and MONO_PATH environment variables to appropriate
values during execution for compiling the CobraBinding project on a Mac.

Resolves issue #9

Includes additional ehnancements to aid in debugging the installer from
the command line.

Patch courtesy of @charles-esterbrook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants